# CMPSCI 190DM: A Mathematical Foundation for Informatics

### Fall, 2015

This page contains the homework assignments for CMPSCI 190DM. In general there will be homework due at every lecture. Problems will be taken from the textbook by Ensley and Crawley, Discrete Mathematics: Mathematical Reasoning and Proof with Puzzles, Patterns, and Games, once all students have access to the book.

• Assignment #1 (Assigned 9 Sept, due in class 11 September):

Problem 1.1.3 (b): In the Josephus game J(p, s), there are p people and the skip number is s. So in J(11, 4), the first person killed is 4, then 8, then 1 (because 9, 10, and 11 are skipped), then 6 (because 2, 3, and 5 are skipped, 4 being already dead). Who is the last person to survive in game J(32, 2)? Can you tell the answer for J(1024, 2)?

Problem 1.1.5: A game of tennis continues until one player has one four or more points and leads by two or more points. Explain why a game of tennis cannot consist of exactly seven points. What other numbers of total points are impossible?

Problem 1.1.12: E&C define a grid game played by two players on a four by four grid of squares. All squares are initially blank. On her move, a player chooses one row or one column and places X's in one or more blank squares in that row or column. (She may not choose a column that is all X's.) The winner of the game is the player who places the last X, that is, the first player who cannot move on her term loses.

A hard problem would be to determine who wins the four by four game if both players play optimally. Your assignment is to determine who wins the two by two game, and justify your conclusion by explaining how that player can win the game no matter what their opponent does. If you succeed in this, take a look at the three by three game.

• Assignment #2: (assigned Fri 11 Sept, due in class Mon 14 Sept)

Problem 1.2.1: For each of these sequences, determine the next number in the sequence. Explain how you got it. Then give either a closed formula or a recursive formula (both if you can):

• (c) 2, 5, 10, 17, 26, 37, ? (Hint: Compare to the sequence 1, 4, 9, 16, 25,...)
• (l) 1, 5, 9, 13, 17, ?
• (n) 3, 5, 9, 17, 33, ?

Problem 1.2.5: For each of these sequences described in English, write out the first five (or more if necessary) terms of the sequence. Use your answer to find a closed formula for the sequence.

• (b) The sequence starts with 1, and each entry is 6 more than the previous entry.
• (d) The sequence is obtained by starting with 2, and each subsequent entry is the square of the previous entry.

Problem 1.2.7: For each of these seqeunces given in closed form, write out the first five (or more if necessary) terms of the sequence. Use your answer to discover a recursive formula for the sequence.

• (b) an = 5n - 2
• (d) an = 3n + 1
• (f) an = 3n2 + n

• Assignment #3: (assigned Mon 14 Sept, due Wed 16 Sept) E&C Problems 1.2.20, 1.2.25, and 1.2.28.

• Assignment #4: (assigned Wed 16 Sept, due Fri 18 Sept) E&C Problems 1.3.1 part c only, 1.3.4, 1.3.9, 1.3.11 part c only.

1.3.1 (c): Sovle the following puzzle using truth tables. You come across three islanders. A says, "B and C are both lying". B says, "Only one of the other two is lying". C says, "At least one of us is lying". Who, if anyone, is telling the truth?

1.3.4: You meet three islanders A, B, and C. Using p to mean "A is truthful", q to mean "B is truthful", and r to mean "C is truthful", write the following English sentences in symbolic logic notation:

• (a) A is lying and B or C is truthful.
• (b) A and B are lying, or A and C are truthful.
• (c) At least two people are telling the truth.
• (d) Exactly two people are telling the truth.

1.3.9: Use s to represent "Chris likes to play soccer", r for "Chris likes to read", and p for "Chris likes to eat pizza". Use these variables and basic logic operations to write each of the following in symbolic logic notation:

• (a) Chris likes pizza but does not like soccer.
• (b) Chris likes to read and eat pizza, or he likes to play soccer.
• (c) Chris does not like to each pizza, but he likes to play soccer or read.
• (d) Chris likes to do two of these things but not all three.

1.3.11 (c): Make a truth table showing the values of the compound propositions "p or q", "(not p) or q", and "(p or q) and ((not p) or q)" for each of the four possible settings of the variables p and q.

• Assignment #5: (assigned Fri 18 Sept, due in class Mon 24 Sept) E&C Problems 1.3.17, 1.3.21 part b, c, e only, 1.3.22, 1.3.24.

1.3.17: Use truth tables to verify that "p or (p and q)" is logically equivalent to p, establishing the second absorption property in Theorem 2.

1.3.21: Use truth tables to check if each of the given pairs of symbolic logic statements are equivalent:

• (b) "(p or q) and (not p or q)" and "q"
• (c) "(not q and p) or (not p and q)" and "not p or not q"
• (e) "(p or q) and (q or r)" and "(p and r) or q"

1.3.22: For each of the following statements, rewrite them in propositional logic notation, making the meaning of your propositional variables clear. Use truth tables to find any pairs of logically equivalent statements.

• (a) Jillian likes playing in the sand or volleyball, but she does not like sailing.
• (b) Jillian likes playing in the sand, and she likes sailing or volleyball.
• (c) Jillian likes playing in the sand and volleyball, or she likes sailing.
• (d) Jillian likes playing in the sand and sailing, or she likes volleyball and sailing.

1.3.24: By quoting hte parts of Theorem 2, verfy the following logical equivalences. In each case, start from the left side and use parts of the theorem to change the problem, ending up with the right side. (See Example 15 and the solution to Practice Problem 9.)

• "(p and not q) or p" is equivalent to "p"
• "(p and t) and (p and c)" is equivalent to "p"
• ""q and (p or r)" is equivalent to "(p and q) or (q and r)"

Note: Remember the "t" is the boolean constant "true" and "c" is the constant "false". The rules of Theorem 2 are

• Commutative: p and q equivalent to q and p, same for or,
• Associative: (p and q) and r equivalent to p and (q and r), same for or,
• Distributive: p and (q or r) equivalent to (p and q) or (p and or), same switching and and or
• Identity: p and t equivalent to p, p or c equivalent to p
• Negation: p or not p equivalent to t, p and not p equivalent to c
• Double Negative: not(not p) equivalent to p
• Idempotent: p and p equivalent to p, p or p equivalent to p
• DeMorgan's Laws: not(p and q) equivalent to not p or not q, not(p or q) equivalent to not p and not q
• Universal Bound: p or t equivalent to t, p and c equivalent to c
• Absorption: p and (p or q) equivalent to p, same switching and and or
• Negations of t and c: not t equivalent to c, not c equivalent to t

• Assignment 6: (assigned Monday 21 September, due in class Wednesday 23 September) E&C Problems 1.4.1 (parts b and d only), 1.4.2, 1.4.6, 1.4.9.

• Assignment 7: (assigned Wednesday 23 September, due in class Friday 25 September) E&C Problems 1.4.12, 1.4.16, 1.4.19, 1.4.20

• Assignment 8: (assigned Monday 5 October, due in class Wednesday 7 October) E&C Problems 1.5.17, 1.5.18, 1.5.21, 2.1.3, 2.1.4 parts b, d, f, g only

• Assignment 9: (assigned Wednedsay 7 October, due in class Friday 9 October) E&C Problems 2.1.8, 2.1.14, 2.2.4, 2.2.10, 2.2.13 part b only

• Assignment 10: (assigned Friday 9 October, due in class Tuesday 13 October (Monday schedule) E&C Problems 2.2.14 part b only, 2.2.15, 2.2.21, 2.2.27 (they mean "factored over the integers", so that x2 + ax + b would be equal to (x + c)(x + d) for integers c and d).

• Assignment 11: (assigned Tuesday 13 October, due in class Wednesday 14 October) E&C Problems 2.3.2, 2.3.4, 2.3.5.

• Assignment 12: (assigned Friday 16 October, due in class Monday 22 October) E&C Problems 2.3.9 part b only, 2.3.12, 2.4.3 parts b and c only, 2.4.9 part b only, 2.4.16.

• Assignment 13: (assigned Friday 23 October, due in class Monday 26 October) E&C Problems 2.5.12, 2.5.25, 2.5.34, 2.6.10, 2.6.18.

• Assignment 14: (assigned Monday 26 October, due in class Wednesday 28 October) E&C Problems 3.1.4, 3.1.15 parts b, d, f only, 3.1.18. 3.1.25, and 3.1.28.

• Assignment 15: (assigned Wednesday 28 October, due in class Friday 30 October) E&C Problems 3.2.10 parts b and c only, 3.2.14 (no proofs needed), 3.2.20, 3.3.3, 3.3.10.

• Assignment 16: (assigned Sunday 1 November, due in class Wednesday 4 November) (note there is no HW due on Monday 2 November) E&C Problems 4.1.11, 4.1.18, 4.2.4, 4.3.6, 4.3.13.

• Assignment 17: (assigned Tuesday 3 November, due in class Friday 6 November) E&C Problems 4.3.20, 4.4.6, 4.4.18, 4.5.11, 4.5.17.

• Assignment 18: (assigned Saturday 7 November, due in class Monday 9 November) E&C Problems 4.5.7, 5.1.2, 5.1.4 parts b, d, f only, 5.1.12 parts b, d, f only, 5.1.15.

• Assignment 19: (assigned Monday 9 November, due in class Friday 13 November) E&C Problems 5.1.21, 5.2.2, 5.2.7, 5.2.10, 5.2.15.

• Assignment 20: (assigned Friday 13 November, due in class Monday 16 November) E&C Problems 5.3.4, 5.3.9, 5.3.18. 5.3.20, 5.3.26.

• Assignment 21: (assigned Wednesday 18 November, due in class Friday 20 November) E&C Problems 5.4.2, 5.4.6, 5.4.11, 5.4.15 part b only, 5.4.24. Note the word "positive" in 5.4.24 -- this takes some work to turn into a problem like 5.4.20.

• Assignment 22: (assigned Friday 20 November, due in class Monday 23 November) E&C Problems 6.1.3 parts b and d only, 6.1.6, 6.1.9 parts b and d only, 6.1.13, 6.1.20.

• Assignment 23: (assigned Thursday 26 November, due in class Monday 30 November) E&C Problems 6.2.6, 6.2.18, 6.2.20, 6.3.10, 6.3.15.

• Assignment 24: (assigned Wednesday 2 December, due in class Friday 4 December) E&C Problems 6.5.2, 6.5.24, 6.6.2, 6.6.12, 6.6.22.

• Assignment 25: (assigned Friday 4 December, due in class Monday 7 December) E&C Problems 6.5.16, 7.1.6, 7.1.10, 7.4.2, 7.4.14.

• Assignment 26: (assigned Wednesday 9 December, due in class Friday 11 December) E&C Problems 7.2.8, 7.2.13, 7.5.2, 7.5.8, 7.5.16.