Section 1.1 Statements, Symbolic Representation, and Tautologies
21
30. Let P be the wff A S B. Prove or disprove whether P is equivalent to any of the following related wffs.
a. the converse of P, B S A
b. the inverse of P, A′ S B′
c. the contrapositive of P, B′ S A′
31. Write a logical expression for a Web search engine to find sites pertaining to dogs that are not retrievers.
32. Write a logical expression for a Web search engine to find sites pertaining to oil paintings by Van Gogh or
Rembrandt but not Vermeer.
33. Write a logical expression for a Web search engine to find sites pertaining to novels or plays about AIDS.
34. Write a logical expression for a Web search engine to find sites pertaining to coastal wetlands in Louisiana
but not in Alabama.
35. Consider the following pseudocode.
repeat
i = 1
read a value for x
if ((x < 5.0) and (2x < 10.7)) or ("5x > 5.1) then
write the value of x
end if
increase i by 1
until i > 5
The input values for x are 1.0, 5.1, 2.4, 7.2, and 5.3. What are the output values?
36. Suppose that A, B, and C represent conditions that will be true or false when a certain computer program
is executed. Suppose further that you want the program to carry out a certain task only when A or B is true
(but not both) and C is false. Using A, B, and C and the connectives AND, OR, and NOT, write a statement
that will be true only under these conditions.
37. Rewrite the following statement form with a simplified conditional expression, where the function odd(n)
returns true if n is odd.
if not((Value1 < Value2) or odd(Number))
or (not(Value1 < Value2) and odd(Number)) then
statement1
else
statement2
end if
38. You want your program to execute statement 1 when A is false, B is false, and C is true, and to execute
statement 2 otherwise. You wrote
if not(A and B) and C then
statement 1
else
statement 2
end if
Does this do what you want?
39. Verify that A S B is equivalent to A′ ~ B.
40. a. Using Exercise 39 and other equivalences, prove that the negation of A S B is equivalent to
A ` B′
b. Write the negation of the statement “If Sam passed his bar exam, then he will get the job.”
Précédent

- 38/986

Suivant