Universal Conditional Statements

advertisement

CmSc 180 Discrete Mathematics

Final Exam - Solution

I. Propositional and Predicate logic

1.

Fill in the corresponding truth values (T or F) of the expressions

P

T

T

F

F

Q

T

F

T

F expression

¬P Λ Q

P V ¬ Q

¬P 

Q

¬P → Q

Value

F

T

T

F

2.

Complete the logical identities:

P Λ P = P

P Λ F = F

P Λ T = P

P V P = P

P V T = T

P V F = P

P V ~P = T

P Λ ~P = F

1

3.

Represent as a propositional expression the sentence below, find its negation using De Morgan's laws, and translate in English the negation:

If the results are negative there is an error in the input or there is an error in the program.

Use the propositions P, Q and R:

P: The results are negative

Q: There is an error in the input

R: There is an error in the program

Expression: P

Q V R

Negation : ~ (P

Q V R) = ~ (~ P V Q V R) = P

~Q

~R

Translation: The results are negative however there is not an error in the input and there is not an error in the program

4.

Match the disjunctive representations of the following conditional statements

P → Q : 4 1. P V Q

Contrapositive:

Inverse:

Converse:

~P → Q : 1

P → ~Q : 3

~P → ~Q : 2

2. P V ~Q

3. ~P V ~Q

4. ~P V Q

5.

For the implication ~P → Q indicate which of the following expressions is its contrapositive, its converse and its inverse (circle the correct one):

P → Q, ~Q → P , P → ~Q, ~P → ~Q, ~Q → ~P, Q → ~P

P → Q, ~Q → P, P → ~Q , ~P → ~Q, ~Q → ~P, Q → ~P

P → Q, ~Q → P, P → ~Q, ~P → ~Q, ~Q → ~P, Q → ~P

2

6.

Determine whether the following arguments are valid or invalid: a. Premises:

1.

If it is stormy classes will be cancelled and the offices will be closed.

2.

It is stormy.

Therefore the offices are closed

(MT) Valid Invalid b. Premises:

1.

If it is stormy classes will be cancelled and the offices will be closed.

2.

Classes are not cancelled

Therefore it is not stormy

(MT) Valid Invalid c. Premises:

1.

If I work all night on this homework, I can answer all the exercises.

2.

If I answer all the exercises I will understand the material.

Therefore

If I don't work all night over this homework I will not understand the material.

(inverse error)

Valid Invalid d. Premises:

1. If Adams gets a Christmas bonus he will buy a new stereo or he will repair his car.

2. Adams doesn't buy a new stereo, but he repairs his car.

Therefore Adams has received a Christmas bonus. Valid Invalid

Converse error e. Premises:

1.

If my ceiling is not fixed, I will not pay the rent.

2.

If my ceiling is fixed we will have a party

3.

We don't have a party

.

Therefore I don't pay the rent. Valid Invalid

3

7.

You are about to leave for school in the morning and discover you don’t have your glasses. You know the following statements are true: a. If my glasses are on the kitchen table then I saw them at breakfast. b. I was reading the newspaper in the living room or I was reading the newspaper in the kitchen. c. If I was reading the newspaper in the living room then my glasses are on the coffee table. d. I did not see my glasses at breakfast e. If I was reading my book in bed, then my glasses are on the bed table. f. If I was reading the newspaper in the kitchen, then my glasses are on the kitchen table.

Where are the glasses?

Hints.

The sentences above contain the following atomic statements represented by propositional variables

A = My glasses are on the kitchen table

B = My glasses are on the coffee table

C = My glasses are on the bed table

D = I was reading the newspaper in the kitchen

E = I was reading the newspaper in the living room

F = I was reading my book in bed

G = I saw my glasses at breakfast

1. Represent the sentences by propositional expressions using the variables above.

2. Using the inference rules of modus ponens, modus tollens and disjunctive syllogism find out which of the statements A, B, or C can be concluded.

Write the solution as a sequence of arguments in the following way;

(use the abbreviations MT: modus tollens, MP: modus ponens, DS – disjunctive syllogism) g) from a) and d) by MT => ~A h) from g) and …. by …. => ….

Etc. a. A

G b. D v E c. E

B d. ~G e. F

C f. D

A g) From a) and d) by MT => ~A h) From f) and g) by MT => ~D i) From h) and b) by DS => E j) from i) and c) by MP => B.

The glasses are on the coffee table

4

8.

Which one of the following statements is logically equivalent to the following statement: ``If you are not part of the solution, then you are part of the problem"

(Circle the correct answer) a. If you are part of the solution, then you are not part of the problem. b. If you are not part of the problem, then you are part of the solution . c. If you are part of the problem, then you are not part of the solution. d. If you are not part of the problem, then you are not part of the solution.

9.

There is an island where two kinds of people live: knights that always tell the truth, and knaves that always lie. You visit the island and are approached by two natives A and B. A says: B is a knight. B says: A and I are of opposite type. What are A and B?

Hint: Assume that A is a knight and see what conclusions can be made. Assume that A is a knave and see what conclusions can be made.

Assume that A is a knight. Therefore A tells the truth, so B is a knight too. Therefore B tells the truth so A should be a knave. Here we see a contradiction, so A is not a knight.

A is a knave. A is lying, so B is a knave too.

In problems 10 and 11 translate the sentences in quantified expressions of predicate logic, write down the negated expression and then translate the negated expression in English.

10.

All students need financial aid. student(x), needs_aid(x) expression:

 x, student(x)

needs_aid(x) negation:

 x, student(x)

~needs_aid(x) translation: Some students don’t need financial aid

11.

Some horses do not fly horse(x), fly(x) expression:

 x, horse(x)

~ fly(x) negation:

 x, horse(x)

fly(x) translation: All horses fly

5

12.

Consider the expression:

n (integer(n)

even_square(n)

even(n))

Which of the following sentences are equivalent to the above expression: a.

All integers have even squares and are even. b.

Given any integer whose square is even, that integer is itself even . c.

There are some integers whose square is even. d.

Any integer with an even square is even. e.

All even integers have even squares.

II. Sets

13.

True or False?

True False

X

1

{2,3,1,5}

X

{1}

{2,3,1,5}

X

{1}

{2,3,1,5, {1}}

X

{1}

{2,3,1,5}

X

{1}

{2,3,{1},5}

X

{1,6}

{2,3,1,5}

X

{1,5}

{2,3,1,5}

X

{1}

{1, {1}}

X

{1}

{1, {1}}

 

{1 ,2}

X

 

{1 ,2}

X

 

{

, 1 ,2}

X

X

 

{

, 1 ,2}

6

14.

Complete the identities below a. A

~A = E b A

~A =

 c. A

E = A d. A

Ø = A e. A

E = E f. A

Ø =

 g. A

A = A h. A

A = A

Complementation Law

Exclusion Law

Identity Laws

Domination Laws

Idempotent Laws i. ~(A

B) = ~A

~B De Morgan's Laws j. ~(A

B) = ~A

~B

15.

Let the universal set be the set R of all real numbers and let

A = {x

R | -2

x

1}, B = { x

R | -1 < x < 3}.

Find each of the following:

A

B = {x

R | -2

x < 3}

A

B = {x

R | -1 < x

1}

A c = {x

R | x < -2 V x > 1}

B c

A c

A c

= {x

R | x

-1 V x

3}

B c ={x

R | x < -2 V x

3}

B c

={x

R | x

-1 V x > 1}

(A

B) c

={x

R | x < -2 V x

3}

(A

B) c ={x

R | x

-1 V x > 1}

16.

Write the power set of A = {

, {

}}, B = {

, 1, {

,1}}

P(A): {

, {

}, {{

}}, {

, {

}}}

P(B): {

, {

}, {1}, {{

,1}},

{

, 1}, {

, {

,1}}, {1, {

,1}},

{

, 1, {

,1}}}

7

17.

Let the universal set be all people. Within the universal set,

A is the set of all computer programmers,

B is the set of all accountants,

C is the set of all women,

D is the set of all people of age 40 and older.

Using set operations, write the expressions for the following sets: a.

The set of all male computer programmers who are not accountants

A

~C

~B b.

The set of all female accountants under 40

C

B

~D c.

The set of all female computer programmers of age 40 and older and all accountants under 40.

(C

A

D)

(B

~D)

18.

Represent by Venn diagrams (shadow the appropriate area): a. (B

C) – A b.

(A

C)



C)

8

c.

(A - B)

(B - C)

19.

For each Venn diagram below write down the set expression corresponding to the shaded area a) A

B

C b) (A

B)

(A

C)



A

C) c) (A

B)

(A

C)



A

C) - A

B

C d) (A

B

C)-

((A

B)

(A

C)



A

C))

9

20.

Let A = {1,2,3,4,5,6,7}. For each set below determine whether it is a partition of

A or not. If the answer is negative, explain why the set is not a partition: a.

{{1,2},{3,4,5,6},{7}} YES b.

{{1,2},{3,4,5,6}, 7 } NO, 7 is not a set c.

{{1,2}{2,4,5},{3,6,7}} NO, 2 is repeated d.

{{2,3,4},{1,5,7}} NO, 6 is missing

III. Counting

In the problems below may represent the solution using P(n,k) and/or C(n,k) and/or n! and/or numerical expression without doing the calculations.

21.

P(n, k) = n(n-1).(n-2)…..(n-k+1) = n! / (n-k)!

22.

C(n, k) = P(n,k) / k! = n! / ((n-k)! . k! )

23.

Five speakers are scheduled to address a convention. In how many different orders can they appear?

5!

24.

A baseball team has 2 catchers, 4 starting pitchers and 5 relief pitchers. A catcher, starting pitcher and relief pitcher must be chosen for an all-star game. In how many ways can this be done?

C(2,1) * C(4,1) * C(5,1) = 2 . 4. 5

25.

A foreman has a team of 15 workers. He needs 5 of them to unload a truck full of bricks, 3 to start mixing cement and 4 to clean up yesterday’s mess. In how many ways can he create the work groups?

C(15,5) * C(10,4)* C(6,3)

We choose 5 to unload the truck out of 12 (combinations: the order does not matter).

From the remaining 10 we choose 4 to clean, from the remaining 6 we choose 3 to mix the cement. The order of choosing the groups does not matter, i.e. the solution is equivalent to:

C(15,4)* C(11,5)* C(6,3), or to C(15, 5)*C(10,3)*C(7,3) , etc

26.

A student honor society has 10 juniors and 13 seniors. According to its bylaws, the president and treasurer must be seniors, and the vice-president and secretary must be juniors. In how many ways can the four offices be filled by four different students?

P(10,2) * P(13,2)

10

27.

In how many ways can 8 women be paired with 8 of 12 men at a dance?

P(12,8)

28.

From among a group of 6 men and 9 women how many three-member committees contain a. only men or only women? C(6,3) + C(9,3) = 20 + 84 = 104 b. exactly one woman? 9*C(6,2) c. at least one woman? 9*C(6,2) + 6* C(9,2) + C(9,3)

29.

How many 8-bit strings contain 6 or more 1s?

C(8,6) + C(8,7) + C(8,8) = 28 + 8 + 1

30.

Five male college students each are bringing a date to the orchestra concert. The men bought tickets for 10 consecutive seats in row 17. In how many ways can all college students be seated at the concert if each male must be seated next to his date?

2

5

* 5!

We can consider each pair as one item, and 5 items can be arranged in 5! Different ways.

For each pair we have 2 possible orders, that is why we multiply by 2

5

Optional problems:

Prove that the following formulas are true for all positive integral values of n .

Use mathematical induction. Choose 1) or 2)

1.

1 + 3 + 5 + …. + (2n-1) = n 2

Let S(n) be the sum of the first n odd numbers.

We shall prove that S(n) = n

2

I. Inductive base.

Show that P(1) : S(1) = 1 2 is true.

S(1) is the sum of the first odd number, which is 1, therefore S(1) = 1.

Therefore P(1) is true.

11

II. Inductive step .

Assume that P(k) : S(k) = k 2 is true.

Under this assumption we will show that

P(k+1): S(k+1) = (k+1)

2

is also true.

S(k+1) = S(k) + (2k+1) = k

2

+ 2k + 1 = (k+1)

2

Conclusion: By the principle of mathematical induction we conclude that the sum of the first n odd integers is n

2

.

2.

1·2 + 2·3 + 3·4 + … + n(n+1) = n(n+1)(n+2)/3

Let a n

is the n-th term in the sum above, a n

= n(n+1)

Let S(n) = a

1

+ a

2

+ … +a n

, a k

= k(k+1), k = 1, 2, …, n

We shall prove that S(n) = n(n+1)(n+2)/3

I. Inductive base .

We shall show that P(1): S(1) = 1.(1+2)(1+3)/3 = 2 is true.

S(1) = a

1

= 1.2 = 2

Therefore P(1) is true.

II. Inductive step

Assume that P(k): S(k) = k(k+1)(k+2)/3 is true for some k, 1 < k < n

Under this assumption we shall show that

P(k+1) : S(k+1) = (k+1)(k+2)(k+3)/3 is also true

S(k+1) = S(k) + a k+1

= k(k+1)(k+2)/3 + (k+1)(k+2) =

= k(k+1)(k+2)/3 + 3.(k+1)(k+2)/3 =

= (k+1)(k+2)(k+3)/3

Conclusion: By the principle of mathematical induction it follows that

1·2 + 2·3 + 3·4 + … + n(n+1) = n(n+1)(n+2)/3 for any integer n.

12

Download