CS210 Computer Systems

CS131 Fall 2023 Final Exam Practice Problems

NOTE: This review is not comprehensive. It is recommended that you review prior

homeworks or labs to prepare for the exam, although more recent material will be emphasized.

Problem 1. Prove the product of any three consecutive integers is divisible by 3.

(Hint: Instantiate/consider one integer, not three.)

Problem 2. Show that ¬(p q) ∨ ¬([(p q) r] ∧ ¬r) is a tautology.

Problem 3. Let’s define some new boolean operator ∆. Here’s the truth table for the proposition

a) Express ∆ in terms of the functionally complete set of operators {+, ·, } (i.e. or, and, and

not)

b) Prove that the set of operators {, } is functionally complete.

Problem 4. Suppose you have some function f : R − {1} → R − {0} such that f(x) =

21−x .

a) Find the inverse of the above function, then prove it is an inverse. Remember to state the domain and codomain.

b) We know that this function is bijective because it has an inverse. For the sake of practice, prove that the function is bijective by other means.

Problem 5. Suppose we define the set of all possible binary strings B as follows (assume there are no empty strings):

Basis Step: ‘1’, ‘0’ B

Inductive Step: For any x B:

1. ‘x0’ B

2. ‘x1’ B

Prove that the value of any string x B is less than 2n , where n is the length of said string.

Problem 6. Suppose the alphabet Σ consists of the 26 letters in the English alphabet. Consider the set of length-10 strings without repeating letters (e.g. ‘abcdefghij’) which we will call L.

Consider a relation R : L L, where for a, b L, aRb if a and b are anagrams, meaning you may rearrange the letters in a to get string b (in other words, they contain the exact same set of letters).

a) Prove that R is an equivalence relation.

b) How many equivalence classes are there? Give an example of one.

你可能感兴趣的:(学习方法)