Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Assignment 1 full doc, Assignments of Computer Science

Assignment 1 exercises full document

Typology: Assignments

2021/2022

Uploaded on 10/18/2022

nidzoball4
nidzoball4 🇨🇦

2 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Assignment 1
Total Points = 50
1. (2+2+2=6 points) In each of the following cases, find a proposition with the given conditions.
(a) Find a proposition with three variables p,q, and rthat is true when pand rare true
and qis false, and false otherwise.
(b) Find a proposition with three variables p,q, and rthat is true when at most one of the
three variables is true, and false otherwise.
(c) Find a proposition with three variables p,q, and rthat is never true.
2. (2+2=4 points) In each of the following cases, write an equivalent proposition as stated.
(a) Write a proposition equivalent to p ¬qthat uses only p, q, ¬, and the connective .
(b) Write a proposition equivalent to pqusing only p, q, ¬, and the connective .
3. (6 points) Prove that (q(p ¬q)) ¬pis a tautology using propositional equivalence
and the laws of logic.
4. (2*4=8 points) Using cfor “it is cold”, dfor “it is dry”, rfor “it is rainy”, and wfor “it is
windy”, write the following sentences in symbols.
(a) It is neither cold nor dry.
(b) It is rainy if it is not cold.
(c) To be windy it is necessary that it be cold.
(d) It is rainy only if it is windy and cold.
5. (4+4=8 points) There are three kinds of people living on an island: knights who always tell
the truth, knaves who always lie, and spies who can either tell the truth or lie. You encounter
three people, A,B, and C. You know one of the three people is a knight, one is a knave,
and one is a spy. Each of the three people knows the type of person each of the other two is.
How would you identify who is who, if:
(a) Asays “I am not a knight,” Bsays “I am not a spy,” and Csays “I am not a knave.”
(b) Asays “I am a spy,” Bsays “I am a spy” and Csays Bis a spy.”
6. (6 points) Determine whether the following argument is valid. Justify your answer by showing
which rules of inferences have been followed at each step.
She is a Math Major or a Computer Science Major.
If she does not know discrete math, she is not a Math Major.
If she knows discrete math, she is smart.
She is not a Computer Science Major.
Therefore, she is smart.
7. (6 points) Give a direct proof of the theorem: “if xand yare odd integers, then x+yis
even.”
8. (6 points) Give a proof by contradiction of the following: “If xand yare even integers, then
xy is even”.
1

Partial preview of the text

Download Assignment 1 full doc and more Assignments Computer Science in PDF only on Docsity!

Assignment 1

Total Points = 50

  1. (2+2+2=6 points) In each of the following cases, find a proposition with the given conditions.

(a) Find a proposition with three variables p, q, and r that is true when p and r are true and q is false, and false otherwise. (b) Find a proposition with three variables p, q, and r that is true when at most one of the three variables is true, and false otherwise. (c) Find a proposition with three variables p, q, and r that is never true.

  1. (2+2=4 points) In each of the following cases, write an equivalent proposition as stated.

(a) Write a proposition equivalent to p ∨ ¬q that uses only p, q, ¬, and the connective ∧. (b) Write a proposition equivalent to p → q using only p, q, ¬, and the connective ∨.

  1. (6 points) Prove that (q ∧ (p → ¬q)) → ¬p is a tautology using propositional equivalence and the laws of logic.
  2. (2*4=8 points) Using c for “it is cold”, d for “it is dry”, r for “it is rainy”, and w for “it is windy”, write the following sentences in symbols.

(a) It is neither cold nor dry. (b) It is rainy if it is not cold. (c) To be windy it is necessary that it be cold. (d) It is rainy only if it is windy and cold.

  1. (4+4=8 points) There are three kinds of people living on an island: knights who always tell the truth, knaves who always lie, and spies who can either tell the truth or lie. You encounter three people, A, B, and C. You know one of the three people is a knight, one is a knave, and one is a spy. Each of the three people knows the type of person each of the other two is. How would you identify who is who, if:

(a) A says “I am not a knight,” B says “I am not a spy,” and C says “I am not a knave.” (b) A says “I am a spy,” B says “I am a spy” and C says “B is a spy.”

  1. (6 points) Determine whether the following argument is valid. Justify your answer by showing which rules of inferences have been followed at each step. She is a Math Major or a Computer Science Major. If she does not know discrete math, she is not a Math Major. If she knows discrete math, she is smart. She is not a Computer Science Major. Therefore, she is smart.
  2. (6 points) Give a direct proof of the theorem: “if x and y are odd integers, then x + y is even.”
  3. (6 points) Give a proof by contradiction of the following: “If x and y are even integers, then xy is even”.