Questions tagged [induction]

Questions about mathematical induction and inductive proofs.

Mathematical induction is a proof technique which applies to inductive sets, especially the set of non-negative integers. An induction proof on a set $S$ is carried out in two steps: in the induction basis, the claim is shown to hold for the minimal element in $S$; in the induction step, it is proven that, if the claim holds for a single but arbitrary $k \in S$ (the induction hypothesis), then it holds for the next element in $S$ ($k+1$ in case $S = \mathbb{N}$).

Induction can be generalized to inductively defined structures such as trees and Boolean formulae. Proofs of this type are named structural induction proofs.

186 questions
21
votes
1 answer

How do I write a proof using induction on the length of the input string?

In my Computing Theory course, a lot of our problems involve using induction on the length of the input string to prove statements about finite automata. I understand mathematical induction, however when strings come into play I get real tripped…
20
votes
3 answers

Is path induction constructive?

I'm reading through the HoTT book and I have a hard time with path induction. When I look at the type in the section 1.12.1: $$\text{ind}_{=_A}:\prod_{C:\prod\limits_{x,y:A}(x=_Ay)\to \mathcal{U}} \left( \left(\prod_{x:A}C(x,x,\text{refl}_x)\right)…
Kostya
  • 473
  • 2
  • 10
14
votes
1 answer

What is induction-induction?

What is induction-induction? The resources I found are: the HoTT book, at the end of chapter 5.7. nLab's article a paper called Inductive-inductive definitions this blog post also mentions inductive-inductive types The first two references are too…
盛安安
  • 944
  • 5
  • 14
12
votes
3 answers

Trying to understand this Quicksort Correctness proof

This proof is a proof by induction, and goes as follows: P(n) is the assertion that "Quicksort correctly sorts every input array of length n." Base case: every input array of length 1 is already sorted (P(1) holds) Inductive step: fix n => 2. Fix…
FrostyStraw
  • 393
  • 1
  • 2
  • 11
12
votes
12 answers

Why are mathematical proofs so hard?

I am an electrical engineer and trying to make a transition into machine learning. I read in multiple articles that I have to learn data structures and algorithms, before this I have to learn about mathematical proofs. I started studying it on my…
user28324
  • 249
  • 1
  • 2
  • 5
11
votes
3 answers

Do "inductively" and "recursively" have very similar meanings?

Do "inductively" and "recursively" mean very similar? For example, if there is an algorithm that determines a n-dim vector by determine its first k+1 components based on its first k components having been determined, and is initialized with the…
Tim
  • 5,035
  • 5
  • 37
  • 71
9
votes
1 answer

Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$

Solving the recurrence relation $T(n) = 2T(\lfloor n/2 \rfloor) + n$. The book from which this example is, falsely claims that $T(n) = O(n)$ by guessing $T(n) \leq cn$ and then arguing $\qquad \begin{align*} T(n) & \leq 2(c \lfloor n/2 \rfloor ) +…
7
votes
3 answers

Proving property of a term using Induction

This is one of the example lemma that has been proved in TAPL book which I'm unable to grasp. The objective is to prove |Consts(t)| <= size(t) where t is a term. Now, Consts is a function defined like this: Consts(true) = {true} Consts(false) =…
Sibi
  • 171
  • 1
  • 3
7
votes
1 answer

Prove correctness of recursive multiplication algorithm

I'm in a first year discrete math course and we started algorithms. I created a recursive algorithm to multiply two numbers together: function multiply($n, $r) { if($n == 1) return $r; else if($r == 1) return $n; else return $r…
7
votes
4 answers

How does one know what statements in Coq require Induction?

I was trying to learn Coq using the famous book Software Foundations. In it I found the following: Theorem mult_0_r : forall n:nat, n * 0 = 0. Proof. induction n as [| n IHn]. - simpl. reflexivity. - simpl. rewrite -> IHn.…
Charlie Parker
  • 3,130
  • 22
  • 39
6
votes
2 answers

Help with proof involving weighted full binary tree

Given a full binary tree, $T$ (each node is either a leaf or possesses exactly two children), with $n$ leaf nodes: $v_1,v_2,...,v_n$, and weights associated with the leaf nodes: $w_1,w_2,...,w_n$, the cost of the tree, denoted by $|T|$, is defined…
so.very.tired
  • 1,259
  • 1
  • 15
  • 20
5
votes
2 answers

Finding nested intervals efficiently

The intervals are represented as two numbers, e.g. $(4.3, 5.6)$. The intervals are unique. If for $(x,y)$ and $(u,v)$, $x≤u$ and $v≤y$, $(u,v)$ is nested in $(x,y)$ How do I find out which intervals are nested in others efficiently? The hint is to…
The Unfun Cat
  • 1,803
  • 2
  • 19
  • 29
5
votes
1 answer

How to prove that the pre-order tree traversal algorithm terminates?

I see structural induction the usual way for proving an algorithm's termination property, but it's not that easy to prove by means of induction on a tree algorithm. Now I am struggling on proving that the pre-order tree traversal algorithm is…
5
votes
1 answer

Proof by induction over rules for mutually recursive relations

Consider the (big-step) semantics of a language ($a, e$ terms, $v$ values), defined by two mutually recursive relations, $\downarrow$ and $\Downarrow$, given by a set of rule-schemata (simplified): $\frac{a \cdot x \Downarrow e ~~ e \downarrow v}{a…
choeger
  • 620
  • 3
  • 8
5
votes
4 answers

How to find whether a grammar's language is finite or infinite?

I have this context-free grammar and I want to find out whether its language is finite or infinite. S -> XY|bb Step 1 X -> XY|SS Step 2 Y -> XY|SS Step 3 So I would do S -> XY From step 1 S -> YYY From step 2 S -> SSYY …
1
2 3
12 13