MHB Proof by induction - Really confused

Click For Summary
SUMMARY

The discussion focuses on proving two statements using mathematical induction. The first statement asserts that the number of operations required to sort an array with n > 0 items is at most n² operations, based on the premise that sorting an array with one item takes one operation and that adding an item requires at most 2n + 1 additional operations. The second statement claims that for n ≥ 1, the expression 7n − 1 is a multiple of 6. The proof for the first statement is successfully completed by showing that O(n+1) = (n+1)², confirming the induction hypothesis.

PREREQUISITES
  • Understanding of mathematical induction
  • Familiarity with sorting algorithms and their complexities
  • Basic algebraic manipulation and factoring
  • Knowledge of Big O notation
NEXT STEPS
  • Study mathematical induction proofs in detail
  • Explore sorting algorithm complexities, specifically O(n²) algorithms
  • Learn about other mathematical proofs, such as proof by contradiction
  • Investigate modular arithmetic to understand multiples and divisibility
USEFUL FOR

Students in computer science, mathematicians, and anyone interested in algorithm analysis and mathematical proofs will benefit from this discussion.

Tvtakaveli
Messages
5
Reaction score
0
Hi again. I have one other problem I'm puzzled about.

(a) A sorting algorithm takes one operation to sort an array with one item in it.
Increasing the number of items in the array from n to n + 1 requires at most an
additional 2n + 1 operations. Prove by induction that the number of operations
required to sort an array with n > 0 items requires at most n^2 operations.
(b) Show by induction that if n ≥ 1, then 7n − 1 is a multiple of 6.

So I'm confused to what the question even is and how to put it into a statement. Thank you.
 
Physics news on Phys.org
Tvtakaveli said:
Hi again. I have one other problem I'm puzzled about.

(a) A sorting algorithm takes one operation to sort an array with one item in it.
Increasing the number of items in the array from n to n + 1 requires at most an
additional 2n + 1 operations. Prove by induction that the number of operations
required to sort an array with n > 0 items requires at most n^2 operations.
(b) Show by induction that if n ≥ 1, then 7n − 1 is a multiple of 6.

So I'm confused to what the question even is and how to put it into a statement. Thank you.

(a) I would let \(O_n\) be the number of operations it takes to sort an array containing \(n\) elements. Now, we are told:

$$O_1=1$$

And so this satisfies our base case, \(P_1\). We are given the induction hypothesis \(P_n\):

$$O_n=n^2$$

And we are told:

$$O_{n+1}-O_n=2n+1$$

This can serve as our induction step, because we can add this to our induction hypothesis. What do we get?
 
Ohhh okay that makes a lot more sense. See the induction examples I find online aren't very helpful because they were just substituting n values.

I'm guessing now we would try to get both sides to be equivalent. So either by substituting a value for n that's greater than 0.
Or by just rearranging the formula so that both have the same.

Again I am missing something I just can't work it out.
So
On+1−On=2n+1
n^2+1 - n^2=2n+1
But that wouldn't make sense because
1^2+1 - 1^2 =0. 2*1+1=3

Thanks in advance.
 
Tvtakaveli said:
Ohhh okay that makes a lot more sense. See the induction examples I find online aren't very helpful because they were just substituting n values.

I'm guessing now we would try to get both sides to be equivalent. So either by substituting a value for n that's greater than 0.
Or by just rearranging the formula so that both have the same.

Again I am missing something I just can't work it out.
So
On+1−On=2n+1
n^2+1 - n^2=2n+1
But that wouldn't make sense because
1^2+1 - 1^2 =0. 2*1+1=3

Thanks in advance.

If we start with our induction hypothesis:

$$O_n=n^2$$

And add to this the induction step implied by the problem statement:

$$O_{n+1}-O_n=2n+1$$

We get:

$$O_{n+1}=n^2+2n+1$$

And upon factoring the RHS, we have:

$$O_{n+1}=(n+1)^2$$

And now we find that we've derived \(P_{n+1}\) from \(P_n\), thereby completing the proof by induction.

Does that make sense?
 
Ahhhh so it proves the hypothesis. I see now factorising was the way to do it. It's a lot more clear now thank you for the assistance. I really appreciate it.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 1 ·
Replies
1
Views
1K
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
1K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K