In this example, we prove that the map [ entry "OH":"Ohio", [ entry "AK":"Alaska", [ entry "IA":"Iowa", [ ] ] ] ] does not have key "TX."

At each step, we observe the first entry in the map. If the key in the first entry is equal to "TX," then we have shown that the map contains key "AK." If not, pop the first entry off of the map and repeat. If the map is empty, then we have shown that "TX" does not exist in the map.

For instance, the following:

map [ entry "OH": "Ohio", [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] ] contains key "TX"

is equal to:

map [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] contains key "TX"

which is equal to:

map [ entry "IA": "Iowa", [ ] ] contains key "TX"

which is equal to:

map [ ] contains key "TX"

which is False.

Quiz (1 point)

Prove that:
map [ entry "OH": "Ohio", [ entry "AK": "Alaska", [ entry "IA": "Iowa", [ ] ] ] ] contains key "TX" = False

The following properties may be helpful:

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.

Step Claim Reason (optional) Error Message (if any)
1
2
3
4
5
6
7
8
9
10

Become a subscriber to save your progress, see the correct answer, and more!