In this example, we prove that the element at index 2 of list [10, [12, [14,[]]]] is 14.
At each step, we pop an element from the front of the list and at the same time, decrease the index by 1. When the index reaches 0, we have found our element.
For instance, the following:
the element at index 2 of stack [ 10, [ 12, [ 14, [ ] ] ] ]
is equal to:
the element at index 1 of stack [ 12, [ 14, [ ] ] ]
which is equal to:
the element at index 0 of stack [ 14, [ ] ]
which is finally equal to 14
Quiz (1 point)
- the element at index i of stack [ x, y ] = the element at index (i - 1) of stack y
- 2 - 1 = 1
- the element at index i of stack [ x, y ] = the element at index (i - 1) of stack y
- 1 - 1 = 0
- the element at index 0 of stack [ x, y ] = x
if 2 - 1 = 1, then the element at index (2 - 1) of stack [ 12, [ 14, [ ] ] ] = the element at index 1 of stack [ 12, [ 14, [ ] ] ]
if the following are true:
- a = b
- b = c
then a = c
if 1 - 1 = 0, then the element at index (1 - 1) of stack [ 14, [ ] ] = the element at index 0 of stack [ 14, [ ] ]
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
if the following are true:
- a = b
- b = c
then a = c
Please write your proof in the table below. Each row should contain one claim. The last claim is the statement that you are trying to prove.