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

CSE 321 Midterm Exam Answers, Exams of Cryptography and System Security

The answers to the CSE 321 Midterm Exam held on February 8, 2008 at the University of Washington. The exam covers topics related to computer science and engineering, including logical expressions, predicates, and public key cryptography. solutions to four problems, each with a different point value. The problems require students to demonstrate their understanding of logical operators, quantifiers, and modular arithmetic. The document could be useful as study notes or exam preparation material for students taking similar courses in computer science and engineering.

Typology: Exams

Pre 2010

Uploaded on 05/11/2023

elmut
elmut 🇺🇸

4.6

(16)

285 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Washington February 10, 2008
Department of Computer Science and Engineering
CSE 321, Winter 2008
Midterm Exam Answers, Friday, February 8, 2008
Problem 1 (10 points):
a) Show that the expression (pq)(pr) is a contingency.
The expression is true if all variables are true. It is false if pand qare true, and ris false.
b) Give an expression that is logically equivalent to (pq)(pr) using the logical
operators ¬,, and (but not ).
The simplest method is just to use the equivalence ab(¬ab). This gives ¬(¬pq)
(¬pr), which can be simplified by DeMorgan’s law to (p ¬q) ¬prand can be further
simplifed to ¬p ¬qr.
Problem 2 (20 points):
Using the predicates:
Likes(p, f ): “Person plikes to eat the food f.”
Serves(r, f): “Restaurant rserves the food f.”
translate the following statements into logical expressions.
a) Every restaurant serves a food that no one likes.
rfp(Serves(r, f ) ¬Likes(p, f ))
The most common incorrect answer had the quantifers in the wrong order: rpf. This
would say “At every restaurant, everyone has something that they don’t like,”
b) Every restaurant that serves TOFU also serves a food which RANDY does not like.
rf(Serves(r, TOFU) (Serves (r, f) ¬Likes (RANDY, f )))
Translate the following logical expressions into English. (You may want to give a couple of sen-
tences of explanation - the point of this question is to demonstrate that you understand the logical
expression.)
c) rpf(Serves(r, f )Likes(p, f ))
There is a restaurant where everyone likes something it serves.
The answer “There is some restaurant that serves some food that everyone likes” is incorrect,
since that says that the same food is liked by everyone.
pf3

Partial preview of the text

Download CSE 321 Midterm Exam Answers and more Exams Cryptography and System Security in PDF only on Docsity!

University of Washington February 10, 2008 Department of Computer Science and Engineering CSE 321, Winter 2008

Midterm Exam Answers, Friday, February 8, 2008

Problem 1 (10 points):

a) Show that the expression (p → q) → (p → r) is a contingency. The expression is true if all variables are true. It is false if p and q are true, and r is false. b) Give an expression that is logically equivalent to (p → q) → (p → r) using the logical operators ¬, ∨, and ∧ (but not →). The simplest method is just to use the equivalence a → b ≡ (¬a ∨ b). This gives ¬(¬p ∨ q) ∨ (¬p ∨ r), which can be simplified by DeMorgan’s law to (p ∧ ¬q) ∨ ¬p ∨ r and can be further simplifed to ¬p ∨ ¬q ∨ r.

Problem 2 (20 points):

Using the predicates: Likes(p, f ): “Person p likes to eat the food f .” Serves(r, f ): “Restaurant r serves the food f .” translate the following statements into logical expressions.

a) Every restaurant serves a food that no one likes.

∀r∃f ∀p(Serves(r, f ) ∧ ¬Likes(p, f ))

The most common incorrect answer had the quantifers in the wrong order: ∀r∀p∃f. This would say “At every restaurant, everyone has something that they don’t like,”

b) Every restaurant that serves TOFU also serves a food which RANDY does not like.

∀r∃f (Serves(r, TOFU) → (Serves(r, f ) ∧ ¬Likes(RANDY, f )))

Translate the following logical expressions into English. (You may want to give a couple of sen- tences of explanation - the point of this question is to demonstrate that you understand the logical expression.)

c) ∃r∀p∃f (Serves(r, f ) ∧ Likes(p, f )) There is a restaurant where everyone likes something it serves. The answer “There is some restaurant that serves some food that everyone likes” is incorrect, since that says that the same food is liked by everyone.

d) ∀r∃p∀f (Serves(r, f ) → Likes(p, f )) Every restaurant has a person that likes everything it serves.

Problem 3 (10 points):

Determine the value of the following. (You will probably want to use different methods to compute the values.)

a) 3^303 mod 101 3303 mod 101 = 27 Fermat’s little theorem says that ap−^1 ≡ 1(modp) for p a prime number. Since 101 is prime, 3303 mod 101 = 3300+3^ mod 101 = 3^3 mod 101 = 27 mod 101 = 27.

b) 3^64 mod 100 364 mod 100 = 81 To compute 3^64 mod 100 we use repeated squaring to compute 3^2 , 34 , 38 , 316 , 332 , 364. The key is to reduce modulo 100 during the computations to avoiding having to do too much arithmetic.

32 mod 100 = 3 × 3 mod 100 = 9 34 mod 100 = 9 × 9 mod 100 = 81 38 mod 100 = 81 × 81 mod 100 = 61 316 mod 100 = 61 × 61 mod 100 = 21 332 mod 100 = 21 × 21 mod 100 = 41 364 mod 100 = 41 × 41 mod 100 = 81

Problem 4 (15 points):

a) What is public key cryptography? A method of exchanging secret messages that does not require a prior exchange of secret data. For RSA, the receiver publicizes an encryption key e and modulus n.

b) What is the computation that “Alice” employs when she encodes a message using RSA? M e^ mod n.

c) Why is RSA considered secure? Because very large integers are used, and there is no known method of finding the decryp- tion key efficiently. Since the number involved have hundreds of decimal digits, brute force methods are not feasible. (The answer “because there is no efficient algorithm for factoring” is technically not correct, but received full credit. If one could factor quickly, one could break RSA, but the converse is not necessarily true. It is possible that one could come up with an algorithm for breaking RSA that does not involve factoring.)