You are on page 1of 11

Chapter 1

1/

If p  r is true, find the truth value of each of these propositions:

(i) p  r
(ii) p  r

Answer: true, false

2/ If p  r is true, find the truth value of each of these propositions:

(i) pr
(ii) pr

Answer: true, false

3/

Write in symbol the sentence

“It is not true that if you are good, then you are rich”

using the propositions:

g: you are good

r: you are rich

Answer: (g  r)

4/ Find the proposition corresponding to the given truth table:

p r ?
T T F
T F T
F T F
F F F

Answer: p  r

6/
Let p and r denote propositions. Which of the following statements is/are TRUE?

(i)
(ii)

Answer: Both

7/ Find the negation of the statement “Bill knows C and Java”.

Answer: Bill doesn’t know Python or Java.

8/

Determine the truth value of each of the following statements

if the domain consists of all real numbers.

(i) x (x > 3  x  3)
(ii) x (x > 3  x  3)

Answer: true, false

9/

Which of the following arguments is/are valid?

(i) Everyone who eats water melon every day is healthy.


Anna is not healthy. Therefore, Anna does not eat water melon every day.
(ii) Every math major takes data structurers.
Ben is taking a data structurers course. Therefore, Ben is a math major.

Answer: (i) only

10/

Express the negation of the statement:

Which one is true?


Answer: (iv)

11/

Which of the following statements is/are true?

(i) {b}  {a, {b}, c}


(ii) {b}  {a, {b}, c}

Answer: (i) only

12/

Suppose that the universal set is U = {1, 2, 3, 4, 5, 6, 7, 8},

what is the bit string corresponding to the set {2, 4, 6, 8}?

Answer: 01010101

13/

Given and Find

Answer: 2-x options x 9 – x2 6

14/

Find the next two terms of the sequence 1, 5, 9, 13, 17, 21, …

Answer: 25, 29 options: 23, 25 24, 27 24, 27

15/ Find the general term of the sequence {an} if a1 = 3, a2 = 5, a3 = 7, a4 = 9, a5 = 11, a6 = 13, …

Answer: an = 2n + 1

16/
Suppose that A = {1, 3, 5, 7} and B = {5, 6, 7, 8} are two subsets

of the universal U = {1, 2, 3, 4, 5, 6, 7, 8}.

Express the set A  B with bit string.

Answer: 00001010

17/

Find the next two terms of the sequence 1, 4, 5, 9, 14, 23, 37, …

Answer: 60, 97

18/

To express the sum 4 + 7 + 10 + 13 + 16, which one can be used?

(i)

(ii)

Answer: (ii)

19/

The power set of the set {0, 1} has ___ elements.

Answer: 2

20/

Which of the following statements is/are TRUE?

(i) n + 300n2 is O(n2)


(ii) n is O(logn)

Answer: (i)

21/

Find 79 mod 51 and -79 mod 51.


Answer: 28 and 23

22/

Convert 24 to a base 3 expansion.

Answer: (220)3

23/ Which of the following integers is/are congruent to 7 modulo 11?

Answer: 29 28 14 21

24/

Find the decimal expansion of (102)5.

Answer: 25 + 2 = 27 options: 12 63 30

25

Find gcd(15, 32).

Answer: 1 10 111

26/ A sequence of pseudorandom numbers are generated by:

xn+1 = (3xn + 7) mod 13,

with seed x0 = 1.

Find x1 and x2.

Answer: 10, 11

27/ Consider the set A defined recursively by:


Find {1, 2, 3, 4, 5, 6} – A.

Answer: {3} {3, 4, 5, 6}


28/ Give a recursive definition of the function f(n) = -2n, for n = 1, 2, 3, …

Answer: f(1) = -2 and f(n) = f(n-1) – 2 if n > 1.

29/ Find f(3), f(4) if f is defined recursively by f(1) = 2, f(2) = 3 and for n = 3, 4, ...

f(n) = 3f(n-1) – f(n-2).

Answer: 7, 18

30/

Consider the recursive algorithm:

procedure tinh(n: positive integer)

if (n = 1) then result:= 5

else result:= tinh(n-1) + 1

return result

What is the output after calling tinh(4)?

Answer: 8 options 5 9 6

31/

Find f(3), f(4) if f is defined recursively by f(1) = 3, f(2) = 2 and for n = 3, 4, ...

f(n) = f(n-1) + 2f(n-2).

Answer: 8, 12 options

5/

Give a recursive definition of the function f(n) = 7n + 1, n = 1, 2, 3, …

Answer: f(1) = 8 and f(n) = f(n-1) + 7 if n > 1.

32/ Consider the following algorithm:

procedure thuattoan(n: positive integer)


if n = 1 then

return 3

else

return thuattoan(n-1)

What is the output of the algorithm if n = 5?

Answer: 3 options: 18 27 6

33/ How many bit strings of length eight that start with 10 or end with 01?

Answer: 27 – 24

34/ Given two sets A and B with |A  B| = 9, |A| = 5 and |B| = 7. Find |AB|.

Answer: 3

35/ Suppose that f(n) = f(n/2) + 1, when n is an even positive integer, and f(1) = 3.

Find f(128).

Answer: 10

36

How many strings of ten uppercase English letters are there that start with D and end with M?

(Suppose that letters can be repeated).

Answer: 268

37/

How many different functions are there from the set {a, b, c, d} to the set {1, 2, 3}?

Answer: 34

38/

A multiple-choice test contains 15 questions. There are four possible answers for each question.
In how many ways can a student answer the questions on the test if the student answers every
question?

Answer: 415
39/ Let R = {(a, b) | a > b} be the relation from the set A = {1, 2, 3} to the set B = {0, 1, 2}.

How many 1s are there in the matrix representing R?

Answer: 6

40/ Given two relations on the set {0, 1}:

R = {(0, 0); (0, 1)};

S = {(1, 1)}.

Which one is reflexive?

Answer: None

41/ Let R be the relation on the set of integers such that xRy if and only if x = 5y.

Which one is true?

(i) 15R3
(ii) 1R5

Answer: (i) only

42/

Consider the relation R = {(a, 1), (a, 2), (b, 2), (c, 3), (d, 3)} from the set {a, b, c, d}

to the set {1, 2, 3}. How many elements does have?

Answer: 7

43/

Given the relation R represented by the directed graph below.

Which of the following statements is/are true?

(i) R is reflexive
(ii) R is symmetric
Answer: (ii) only

44/

Let R be the relation represented by the matrix

Find the third row of the matrix that represents R-1.

Answer: [0 1 0]

45/ Let R be the relation on the set of integers where xRy if and only if x + y = 8.

Which one is true?

(i) R is reflexive
(ii) R is symmetric

Answer: (ii) only

46/

Consider the relation R on the set {a, b, c, d} represented by the matrix:

Which one is true?

(i) R is symmetric
(ii) R is reflexive

Answer: Neither (i) nor (ii)

---------------------

47/ How many edges does a graph have if its degree sequence is 3, 3, 2, 2, 1, 1, 0?
Answer: 6 options 14 28 no such graph

48/

Which graphs have an Euler circuit?

G H

Answer: H only

49/

Suppose G is an undirected graph with 12 vertices, each of degree 3. How many edges does G
have?

Answer: 18

50/

How many leaves does a full 4-ary tree with 101 vertices have?

Answer: 76 options 20 100 505

51/

Given the coding scheme:

a: 0, b: 100, c: 111, e: 110, t: 101.

Find the word represented by 1110100.

Answer: cab options bet bee tea

52/

Suppose a coding scheme is represented by this tree


Find the word represented by 1111011110

Answer: bed options bad bee dad

53/

What is the value of the prefix expression * + 8 4 – 5 1 ?

54/ What is the value of the postfix expression 5 1 * 2 6 + - ?

55/ Which of these codes are prefix codes?

(i) a: 0, b: 11, c: 110, d: 101


(ii) a: 11, b: 011, c: 10, d: 100

You might also like