Proving p(n): v.at(n) => 11 + n

  • Thread starter Thread starter ZERO_COOL
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around the proposition p(n) defined for a sorted vector of integers, specifically addressing the relationship between the elements of the vector and the expression 11 + n. Participants are tasked with proving the validity of this proposition through mathematical induction, exploring its implications and notation within the context of C++ vector operations.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • Some participants assert that p(1) is true based on the given value of v.at(1) being 12, equating it to 11 + 1.
  • Others challenge the validity of using the implication symbol (=>) in the context of proving the proposition, suggesting it may lead to confusion.
  • There is a suggestion that the proof structure may need clarification, particularly in how the inductive step is framed.
  • Some participants note that the finite nature of the vector's size is significant in this proof, contrasting it with typical induction proofs over the positive integers.
  • Concerns are raised regarding the notation used, with some questioning whether the goal is to show that p(k) is greater than or equal to 11 + k instead of proving p(k) directly.
  • Another participant emphasizes the need for clarification on the original question, suggesting that the intent may be to demonstrate that v(n) is greater than or equal to 11 + n for all positive integers n.

Areas of Agreement / Disagreement

Participants express differing views on the validity of the proof steps, particularly regarding the use of notation and the implications of the proposition. There is no consensus on the correctness of the original proof or the interpretation of the proposition.

Contextual Notes

Participants highlight potential issues with the notation and the clarity of the proposition being proved. There are unresolved questions about the implications of the statements and the correct interpretation of the mathematical relationships involved.

Who May Find This Useful

Readers interested in mathematical proofs, particularly those involving induction and the properties of sorted sequences in programming contexts, may find this discussion relevant.

ZERO_COOL
Messages
17
Reaction score
0

Homework Statement


Suppose that v is of type Vector of Integers and we know the following:-

1. v is sorted.
2. No two items in v are the same.
3. v.at(1) is 12.

For an integer n, where 1 <= n <= v.size(), let p(n) be the following proposition: p(n): v.at(n) => 11 + n.

A. Explain why p(1) is true?
B. suppose that p(k - 1) is true (where 1 < k <= v.size()). Explain why p(k) must then be true.
C. Complete a proof that p(n) is true for all integers n with 1 <= n < v.size().


Homework Equations





The Attempt at a Solution


A.
Let n = 1.
p(1) = v.at(1) => 11 + 1 = 12
As per part 3, v.at(1) is 12 and so p(1) is true. This is the base step.

B.
As per parts 2 & 3, v.at(k - 1) < v.at(k). Then,
p(k) = v.at(k) => v.at(k - 1) + 1.
Thus p(k) is true. This is the inductive step.

C.
From the base step, p(1) = v.at(1) => 11 + 1 = 12.

Now, p(1) => 12 --> p(2) = v.at(2) => 11 + 2 = 13.
Hence, p(2) => 13 --> p(3) = v.at(3) => 11 + 3 = 14.
Hence, p(3) => 14 --> p(4) = v.at(4) => 11 + 4 = 15.
Hence, p(4) => 15 --> p(5) = v.at(5) => 11 + 5 = 16.
: :
: :
Now, p(k - 1) => 11 + k -1 --> p(k) = v.at(k) => 11 + k.

Thus, for any k => 1, p(k - 1) --> p(k) = v.at(k) => 11 + k.

Since the inductive step has been proven the proof is now complete.


*****
I'm not very confident with this and would really appreciate it if someone could double check it for me. I'm thinking most of C belongs in b because its basically proving the inductive step which is what b is asking.
 
Physics news on Phys.org
ZERO_COOL said:

Homework Statement


Suppose that v is of type Vector of Integers and we know the following:-

1. v is sorted.
2. No two items in v are the same.
3. v.at(1) is 12.

For an integer n, where 1 <= n <= v.size(), let p(n) be the following proposition: p(n): v.at(n) => 11 + n.

A. Explain why p(1) is true?
B. suppose that p(k - 1) is true (where 1 < k <= v.size()). Explain why p(k) must then be true.
C. Complete a proof that p(n) is true for all integers n with 1 <= n < v.size().


Homework Equations





The Attempt at a Solution


A.
Let n = 1.
p(1) = v.at(1) => 11 + 1 = 12
It is given that v.at(1) = 12, and 12 = 11 + 1, so p(1) is true.
You are using the proposition to show that the proposition is true, which is not valid. This is your step that I am questioning: v.at(1) => 11 + 1.

BTW, what's with the => symbol? Doesn't = work just a well?
ZERO_COOL said:
As per part 3, v.at(1) is 12 and so p(1) is true. This is the base step.

B.
As per parts 2 & 3, v.at(k - 1) < v.at(k). Then,
p(k) = v.at(k) => v.at(k - 1) + 1.
No, you can't do this.

Start by assuming p(k - 1) is true. I.e., v.at(k - 1) = 11 + (k - 1) = 10 + k.
Now use this, plus the other given information, to conclude that p(k) = 11 + k. (How to do this isn't obvious to me.)

BTW, don't write p(k) = ... p(k) represents a particular statement. Its value is either true or false.
ZERO_COOL said:
Thus p(k) is true. This is the inductive step.

C.
From the base step, p(1) = v.at(1) => 11 + 1 = 12.

Now, p(1) => 12 --> p(2) = v.at(2) => 11 + 2 = 13.
Hence, p(2) => 13 --> p(3) = v.at(3) => 11 + 3 = 14.
Hence, p(3) => 14 --> p(4) = v.at(4) => 11 + 4 = 15.
Hence, p(4) => 15 --> p(5) = v.at(5) => 11 + 5 = 16.
: :
: :
Now, p(k - 1) => 11 + k -1 --> p(k) = v.at(k) => 11 + k.

Thus, for any k => 1, p(k - 1) --> p(k) = v.at(k) => 11 + k.

Since the inductive step has been proven the proof is now complete.


*****
I'm not very confident with this and would really appreciate it if someone could double check it for me. I'm thinking most of C belongs in b because its basically proving the inductive step which is what b is asking.
 
I think that the key to this problem is that your vector has only a finite number of elements. IOW, there is a last element at index v.size(). This is different from most induction proofs, where the index is an element of the positive integers, a set without a largest element.
 
Can anyone else help with this?
 
I'm guessing the problem is in the notation. You have written

p(k)=>k + 11

which looks like some kind of implication symbol. Are you actually trying to prove:

p(k) ≥ 11 + k ?

That is very easy to show. Is that really what your question is?
 
LCKurtz said:
I'm guessing the problem is in the notation. You have written

p(k)=>k + 11

which looks like some kind of implication symbol. Are you actually trying to prove:

p(k) ≥ 11 + k ?

That is very easy to show. Is that really what your question is?

From the OP,
p(n): v.at(n) => 11 + n.
p(n) is proposition/statement n. The statement itself is v.at(n) >= 11 + n. Here, v is an instance of the vector class in C++, and at(n) is a function that returns a reference to the value at index n.
 
Mark44 said:
From the OP,

p(n) is proposition/statement n. The statement itself is v.at(n) >= 11 + n. Here, v is an instance of the vector class in C++, and at(n) is a function that returns a reference to the value at index n.

Maybe I just don't see what the problem or what it has to do with C++ or its vector class. Isn't he just asking this question:

Given sequence of {v(n)} of integers which is sorted with v(1) = 12, show that v(n) ≥ 11 + n for all positive integers n? That is a perfectly sensible and easily proven statement. If that isn't what the question is, I need more clarification.
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
Replies
8
Views
3K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
2
Views
2K
  • · Replies 0 ·
Replies
0
Views
3K
  • · Replies 27 ·
Replies
27
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K