ANSWERS-HWK2

advertisement
CS 214-01
HOMEWORK 2 - DUE: JAN. 29
SPRING 2014
Please type as much as possible for clarity. You’ll get a better grade if I can read your work!
1.
[18 points] Using the predicate symbols shown and appropriate quantifiers, write each English language
statement as a predicate wff. The domain is the set of Web sites, so x automatically is assumed to refer to a
Web site. This problem is similar to Practice Problem 18 in Chapter 1.
A(x): x has audio
V(x): x has video
a. “Every Web site has both audio and video”
(x)[A(x)  V(x)]
b. “Some Web sites have neither audio or video”
(x)[A(x)  V(x)] or … (x)[A(x)  V(x)] (DeMorgan’s Law)
c. “No Web site has audio”
(x) A(x)
2.
[20 points] Express each of the following sentences as a predicate wff using the appropriate quantifier in
each. Be sure to indicate the meaning of each predicate symbol. For example, given the sentence “If an
animal is a dog, then it is a mammal”, where the domain of interpretation consists of all animals, identify the
following predicates: D(x) = “x is a dog” and M(x) = “x is a mammal”, the predicate wff would be
(x)D(x)→M(x). NOTE: not all of the sentences will involve the “implies” operator. NOTE: the domain is
animals, so there’s no need to have a predicate A(x) : x is an animal
Let M(x): x is a mammal; L(x): x produces milk; E(x): eats meat; P(x): eats plants; H(x): is a herbivore
General rule of thumb: if the existential quantifier is used you generally will need the “and” operation; if the
universal quantifier is used implication is the usual operation. See the section called Translation on page 38.
a. “Some animals are not mammals.” (x) M(x)
b. “All mammals produce milk.” (x) (M(x) → L(x))
(x) (M(x) → L(x)) implies that all x’s are milk-producing mammals
c. “There are animals that eat meat.” (x) E(x)
d. “If an animal eats plants it is an herbivore.” (x)( P(x) →H(x))
Using the “and” operator would mean that all x’s (all animals) eat plants and are herbivores.
3.
[12 points] Problem 20, page 48.
a) : 3, b) 1, c) 3, d) 4.
4.
[25 points points] Prove or disprove each of the following conjectures, using one of the techniques explained
in Chapter 2.1. State the name of the technique that you used. Remember that you can use facts about
integers, such as the fact that an even number can be expressed as 2k, where k is an integer, and an odd
number can be expressed as 2k +1.
NOTE: When dealing with numbers, the domain is considered to be the non-negative integers. Notice that all
examples and problems in the textbook make this assumption.
NOTE: You can assume that an even integer has the form x = 2m, where m is some integer. You can assume
that an odd integer is k + 1 where k is an even number. In other words, 2m + 1 is an odd number. In the
future, I will count off if you don’t clarify this . For example 4 = k + 1 when k = 3. 4 is not odd.
a. The quotient of two even integers is an even integer.
Disprove by counterexample: 24 / 8 = 3
b. The sum of any two consecutive integers is odd. Consecutive integers occur as pairs, e.g., 6 & 7, 101
& 102, -47 & -46. (the last example shouldn’t be included since the numbers are negative)
Direct Proof:
Let x and y be two consecutive numbers; then x = k and y = k + 1, for some k.
x + y = k + k + 1 = 2k +1, where k is some integer. This is odd, by the definition of an odd number,
since 2k is even by the definition of an even integer.
c.
d.
5.
6.
If x and y are odd numbers then x – y is an odd number.
Proof by counterexample: let x = 9 and y = 3. Then x – y = 6; 6 = 2 *3, an even number. You can also
provide a direct proof easily enough.
The sum of an integer and its square is even.
Show that x + x2 is an even number for all values of x.
Since x+ x2 = x ( x + 1) it’s sufficient to show that x ( x + 1) is even for all x
Example 9, page proves that xy is odd if and only if both x and y are odd, thus
x ( x + 1) must be even.
OR: assume x is even, then x = sm and x(x+1) = 2m(2m+1) = 4m2 +2m = 2m(2m +1)
Now, assume x is odd, then x + 1 is even so let x+ 1 = 2m, x = 2m -1.
so x(x+1) = (2m – 1)(2m) = 4m2 - 2m = 2m(2m -1). And again, this is an even.
[10 points] Use inductive reasoning to develop a conjecture for each of the following. Be sure to show your
reasoning.
a. The sum of any three consecutive integers is/is not even.
Conjecture: the sum of three consecutive integers is even if the first integer in the sequence is odd
and odd if the first number in the sequence is even. (You should be able to provide a direct proof for
this). Or: : the sum of three consecutive integers is odd or even depending on the values.
Inductive evidence: 1+2+3 = 6 (even); 2+3+4 = 9 (odd), (20+21+22) = = 63, 17 + 18 + 19 = 54, …
b. The difference between two even integers is/is not odd.
Conjecture: the difference between two even integers is not odd. (or, is even)
Inductive evidence: 6-4 = 2, 12 – 6 = 6, 100 – 50 = 50, … .
[12 points] State the contrapositive of each of the following statements. Hint: First identify the antecedent
and the consequent.
a. Water and sun are necessary conditions for healthy plants. W&S = consequent Q, healthy plant =
antecedent. The original statement is equivalent to saying “If a plant is healthy it must have water
and sun.”
Q → P. If a plant did not get sufficient water and sun it is not healthy.
b. If a person studies hard she will make good grades. P = studies hard, Q = make good grades.
Q → P: If a person does not make good grades she did not study hard.
c. I cannot get to work if my car is broken. P: car is broken; Q: cannot get to work
Q → P: If I can get to work then my car is not broken.
Note that the contrapositive is not the same as the negation of a statement. For example the negation of a.) is
“Water and sun are not necessary conditions for healthy plants.”
Download