CIS301 Exercise Set 1

10 points. Due Friday, January 27
Please do your own work --- whatever you submit must be stored in your brain as well as in your computer files.

1. Type your answer in a .txt file named Q1.txt:
For this circuit,


(a) Write the proposition (linear representation) that it depicts and write the truth table for the proposition. Show the values of all the internal subexpressions of the proposition as well as the value of the overall proposition, like it's done in the lecture notes, Chapter 0. (The truth table will have 4 rows --- fill in all the columns for all the logical operators for all 4 rows.)
(b) Write a different proposition thatdoes not use the OR (v) operator that has the same behavior as the original. Prove this by writing its truth table.

2. For this exercise (and the two that follow), check your work with the CIS301 proof checker, using the checker's v (verbose) option, as demoed in class and as described in the Beginner's Guide, http://www.cis.ksu.edu/~schmidt/301s12/howtocheck.html. Place your solution in a named named Q2.py.

Prove the assertion stated at the last line of the program:

# Q2.py
x = readInt()
y = x + 1
x = x - 2
# prove:  y == 3 + x

3. Do the same here as in Question 2, with the file named Q3.py:

# Q3.py
x = readInt()
assert x >= 0
a = x + x
x = 1
x = a + x
# prove:  x > a and x > 0

4. Again, do the same, but with Q4.py:

# Q4.py
money = readInt()
withdraw = readInt()
assert money > 0 and withdraw < money
money = money - withdraw
# prove:   money > 0

How to submit your assignment on K-State Online

Please make a folder and place in it the following: Then, zip the folder and submit the zipped folder to the CIS301 page at K-State online. Please be certain to upload the zipped folder and then press the SUBMIT button. You must receive a confirmation in your web browser that says you submitted your assignment --- if you don't see the confirmation, try again and try to figure out what you forgot to do.

Bring your work with you to class on the 27th, so that we can review it on the board.