CSCI 675 - Discrete Math Practice Exam

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Which of the following are propositions? Answers: Would you like to have a cup of tea? He likes to drink tea. This tea tastes good. Give me a cup of tea, please

This tea tastes good.

The following propositional statement (P → (Q v R)) → ((P ^ Q) → R) is: Answers: satisfiable but not valid a contradiction valid Response Feedback: Students may study logic and practice at http://www.geeksforgeeks.org/propositional-and-first-order-logic-gq/

satisfiable but not valid

Identify the correct translation into logical notation of the following assertion. "Some boys in the class are taller than all the girls" Note : taller(x,y) is true if x is taller than y. Answers: (∃x) (boy(x) ∧ (∀y) (girl(y) → taller(x,y))) (∃x) (boy(x) → (∀y) (girl(y) → taller(x,y))) (∃x) (boy(x) → (∀y) (girl(y) ∧ taller(x,y))) (∃x) (boy(x) ∧ (∀y) (girl(y) ∧ taller(x,y))) Response Feedback: Student need to know Propositional and first order logic. May study at http://www.geeksforgeeks.org/proposition-logic/ and http://www.geeksforgeeks.org/mathematical-logic-propositional-equivalences/

(∃x) (boy(x) ∧ (∀y) (girl(y) → taller(x,y)))

The two linear equations above can be used to express gcd(225, 60) as a linear combination of 225 and 60: 15 = C · 225 + D · 60 What is the correct value for C? Answers: -4 -1 1 4 Response Feedback: Student needs to know Euclidean Algorithm, Extended Euclidean Algorithm, and how to calculate the multiplicative inverse

-1

Prove that 1 cross times 2 plus 2 cross times 3 plus... plus n cross times left parenthesis n plus 1 right parenthesis equals fraction numerator n left parenthesis n plus 1 right parenthesis left parenthesis n plus 2 right parenthesis over denominator 3 end fraction If we proof by mathematical induction, what will be proven under certain condition in inductive step? Answers: 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis plus left parenthesis k plus 1 right parenthesis cross times left parenthesis k plus 2 right parenthesis space equals space fraction numerator left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis left parenthesis k plus 3 right parenthesis over denominator 3 end fraction 1 cross times 2 plus 2 cross times left parenthesis 2 plus 1 right parenthesis space equals space fraction numerator 2 left parenthesis 2 plus 1 right parenthesis left parenthesis 2 plus 2 right parenthesis over denominator 3 end fraction k is positive integer and 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis equals fraction numerator k left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis over denominator 3 end fraction 1 cross times left parenthesis 1 plus 1 right parenthesis equals fraction numerator 1 left parenthesis 1 plus 1 right parenthesis left parenthesis 1 plus 2 right parenthesis over denominator 3 end fraction Response Feedback: Student shall know how to proof by mathematical induction and use mathematical induction to prove recurrence relation.

1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis plus left parenthesis k plus 1 right parenthesis cross times left parenthesis k plus 2 right parenthesis space equals space fraction numerator left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis left parenthesis k plus 3 right parenthesis over denominator 3 end fraction

Prove that 1 cross times 2 plus 2 cross times 3 plus... plus n cross times left parenthesis n plus 1 right parenthesis equals fraction numerator n left parenthesis n plus 1 right parenthesis left parenthesis n plus 2 right parenthesis over denominator 3 end fraction If we proof by mathematical induction, what will be the base case? Answers: k is positive integer and 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis equals fraction numerator k left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis over denominator 3 end fraction 1 cross times 2 plus 2 cross times left parenthesis 2 plus 1 right parenthesis space equals space fraction numerator 2 left parenthesis 2 plus 1 right parenthesis left parenthesis 2 plus 2 right parenthesis over denominator 3 end fraction 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis plus left parenthesis k plus 1 right parenthesis cross times left parenthesis k plus 2 right parenthesis space equals space fraction numerator left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis left parenthesis k plus 3 right parenthesis over denominator 3 end fraction 1 cross times left parenthesis 1 plus 1 right parenthesis equals fraction numerator 1 left parenthesis 1 plus 1 right parenthesis left parenthesis 1 plus 2 right parenthesis over denominator 3 end fraction Response Feedback: Student shall know how to proof by mathematical induction and use mathematical induction to prove recurrence relation.

1 cross times left parenthesis 1 plus 1 right parenthesis equals fraction numerator 1 left parenthesis 1 plus 1 right parenthesis left parenthesis 1 plus 2 right parenthesis over denominator 3 end fraction

Consider the following brute force factoring algorithm. How many numbers the algorithm will check if N = 23457 which happen to be a prime number? Input: Integer N greater than 1. Output: "Prime" if N is prime. If N is composite, return two integers greater than 1 whose product is N. For x = 2 to N-1 If x evenly divides N, Return( x, N/x ) End-for Return( "Prime" ) Answers: 123457 123455 351 1 Response Feedback: Student shall know the concept about prime factorization, greatest common divisor and least common multiple. Also know that factoring is a hard problem

123455

Assume that x has prime factorization: 3 squared cross times 5 cross times 7 cubed, and y has prime factorization: 2 cubed cross times 5 squared cross times 7 squared, what is the least common multiple of x and y? Answers: 5 cross times 7 squared 2 cubed cross times 3 squared cross times 5 squared cross times 7 cubed 2 cubed cross times 3 squared cross times 5 to the power of 7 x 7 to the power of 5 2 cubed cross times 3 squared cross times 5 cubed cross times 7 to the power of 5 Response Feedback: Student shall know the concept about prime factorization, greatest common divisor and least common multiple. Also know that factoring is a hard problem

2 cubed cross times 3 squared cross times 5 squared cross times 7 cubed

Solve each of the following recurrence equation with the given initial values. bn = bn−1 + 12bn−2. Initial values: b0 = −2, b1 = 20. Answers: a subscript 1 4 to the power of n plus a subscript 2 left parenthesis minus 3 right parenthesis to the power of n a subscript 1 left parenthesis minus 4 right parenthesis to the power of n plus a subscript 2 3 to the power of n 2 left parenthesis 4 right parenthesis to the power of n minus 4 left parenthesis minus 3 right parenthesis to the power of n 2 left parenthesis minus 4 right parenthesis to the power of n minus 4 left parenthesis 3 right parenthesis to the power of n Response Feedback: Student needs to know how to solve linear homogeneous recurrence relation

2 left parenthesis 4 right parenthesis to the power of n minus 4 left parenthesis minus 3 right parenthesis to the power of n

Count the number of binary strings of length 8 subject to each of the following restrictions: There is at least one 0 and one 1. Answers: 2 to the power of 8 minus 1 2 to the power of 7 2 to the power of 8 2 to the power of 8 minus 2 Response Feedback: Student shall know sum and product rules, permutation and combination, and the inclusive and exclusive rule

2 to the power of 8 minus 2

Assume that x has prime factorization 5 to the power of 4 cross times 11 squared cross times 13 cubed and y has prime factorization 3 cross times 7 cross times 11 cross times 13 cubed, what is the prime factorization of the product of x and y? Answers: 3 cross times 5 cross times 7 cross times 11 cross times 13 11 cross times 13 cubed 3 cross times 5 to the power of 4 cross times 7 cross times 11 squared cross times 13 cubed 3 cross times 5 to the power of 4 cross times 7 cross times 11 cubed cross times 13 to the power of 6 Response Feedback: Student shall know the concept about prime factorization, greatest common divisor and least common multiple. Also know that factoring is a hard problem

3 cross times 5 to the power of 4 cross times 7 cross times 11 cubed cross times 13 to the power of 6

Solve each of the following recurrence equation with the given initial values. bn = 4bn−1 − 4bn−2. Initial values: b0 = 3, b1 = 10. Answers: 3 left parenthesis 2 right parenthesis to the power of n plus n left parenthesis 2 right parenthesis to the power of n plus 1 end exponent 5 left parenthesis 2 right parenthesis to the power of n minus 3 n left parenthesis 2 right parenthesis to the power of n 3 left parenthesis 2 right parenthesis to the power of n minus n left parenthesis 2 right parenthesis to the power of n plus 1 end exponent a subscript 1 2 to the power of n plus a subscript 2 n left parenthesis 2 right parenthesis to the power of n Response Feedback: Student needs to know how to solve linear homogeneous recurrence relation

3 left parenthesis 2 right parenthesis to the power of n plus n left parenthesis 2 right parenthesis to the power of n plus 1 end exponent

A bit string consists of 0s and 1s. For example, 0101 is a bit string with four bits. How many bits strings with length 6 or 5 that begins with 0? Answers: 48 24 32 64 Response Feedback: Student shall know sum and product rules, permutation and combination, and the inclusive and exclusive rule

48

What is the multiplicative inverse of 6 Mod 7? Answers: 1 5 3 6 Response Feedback: Student needs to know Euclidean Algorithm, Extended Euclidean Algorithm, and how to calculate the multiplicative inverse

6

6 people line up for a wedding picture, how many different ways to do this? Answers: 6! / 2 6 6! 5! Response Feedback: Student shall know sum and product rules, permutation and combination, and the inclusive and exclusive rule

6!

To proof that 7 to the power of n space end exponent minus space 1 space i s space d i v i s i b l e space b y space 6 space f o r space a l l space p o s i t i v e space i n t e g e r space n. We want to prove by mathematical induction. Which of the following is in induction step? Answers: When n = 1, the statement is true 7 to the power of n plus 1 end exponent minus 1 equals 7 left parenthesis 7 to the power of n minus 1 right parenthesis space space plus space 6 7 to the power of n minus 1 space equals space 7 left parenthesis 7 to the power of n minus 1 end exponent minus 1 right parenthesis plus 6 W h e n space n space equals space 2 comma space 7 squared minus 1 space equals space 48 space i s space d i v i s i b l e space b y space 6 Response Feedback: Student shall know five proof skills. Direct proof, proof by contradiction, proof by cases, proof by contrapositive, and proof by mathematical indcution

7 to the power of n plus 1 end exponent minus 1 equals 7 left parenthesis 7 to the power of n minus 1 right parenthesis space space plus space 6

Use Euclid's Algorithm to calculate gcd (72, 27). The result is: Answers: 3 1 9 27 Response Feedback: Student needs to know Euclidean Algorithm and Extended Euclidean Algorithm

9

A large intersection left parenthesis A large union B right parenthesis equals Answers: A large intersection B B A large union B A Response Feedback: Student shall know set operations and set identities

A

A Boolean expression that is a sum of products of literals is said to be in disjunctive normal form (DNF) . A Boolean expression that is a product of sums of literals is said to be in conjunctive normal form (CNF). Indicate whether the following Boolean expressions are in conjunctive normal form or disjunctive normal form or both or neither. yxzw Answers: CNF Both Neither DNF Response Feedback: Student shall know basic Boolean operations, Boolean functions, and from Boolean function to gates

Both

What is the Big O notation for following run time function? T left parenthesis n right parenthesis space equals space 1000 n log n space plus space 2 to the power of n space plus space 20000 Answers: O left parenthesis n squared right parenthesis O(n log n) O(1) O left parenthesis 2 to the power of n right parenthesis Response Feedback: Student shall know big O notation. Also Big capital omega space a n d space B i g space capital theta

O left parenthesis 2 to the power of n right parenthesis

What is the worse case run time for following algorithm? CountDuplicatePairs This algorithm counts the number of duplicate pairs in a sequence. Input: a1, a2,...,an, where n is the length of the sequence. Output: count = the number of duplicate pairs. count := 0 For i = 1 to n For j = i+1 to n If ( ai = aj ), count := count +1 End-for End-for Return( count ) Answers: O left parenthesis n squared right parenthesis O left parenthesis n cubed right parenthesis O left parenthesis 1 right parenthesis O left parenthesis n right parenthesis Response Feedback: Student shall know big O notation. Also Big capital omega space a n d space B i g space capital theta. Be able to analyze the run time of a given algorithm.

O left parenthesis n squared right parenthesis

What is the worse case run time for following algorithm? MaximumSubsequenceSum Input: a1, a2,...,an n, the length of the sequence. Output: The value of the maximum subsequence sum. maxSum := 0 For i = 1 to n thisSum := 0 For j = i to n thisSum := thisSum + aj If ( thisSum > maxSum ), maxSum := thisSum End-for End-for Return( maxSum ) Answers: O left parenthesis n right parenthesis O left parenthesis 1 right parenthesis O left parenthesis n squared right parenthesis O left parenthesis n space log n right parenthesis Response Feedback: Student shall know big O notation. Also Big capital omega space a n d space B i g space capital theta. Be able to analyze the run time of a given algorithm.

O left parenthesis n squared right parenthesis

In a room there are only two types of people, namely Type 1 and Type 2. Type 1 people always tell the truth and Type 2 people always lie. You give a fair coin to a person in that room, without knowing which type he is from and tell him to toss it and hide the result from you till you ask for it. Upon asking, the person replies the following: "The result of the toss is head if and only if I am telling the truth.‍ Which of the following options is correct? Answers: If the person is of Type 1, then the result is tail The result is head If the person is of Type 2, then the result is tail The result is tail Response Feedback: Study the Quiz questions and understand the answers http://www.geeksforgeeks.org/propositional-and-first-order-logic-gq/

The result is head

Which of the following is the negation of [∀ x, α → (∃y, β → (∀ u, ∃v, y))]? Answers: [∃ x, α → (∀y, β → (∃u, ∀ v, y))] [∀ x, ¬α → (∃y, ¬β → (∀u, ∃ v, ¬y))] [∃ x, α → (∀y, β → (∃u, ∀ v, ¬y))] [∃ x, α ʌ (∀y, β ʌ (∃u, ∀ v, ¬y))] Response Feedback: Study the Quiz questions and understand the answers http://www.geeksforgeeks.org/propositional-and-first-order-logic-gq/

[∃ x, α ʌ (∀y, β ʌ (∃u, ∀ v, ¬y))]

Given characteristic equation for a recurrence relation. Express the solution to recurrence relation as a linear combination of terms. (x-1)(x+2) = 0 Answers: left parenthesis minus 1 right parenthesis to the power of n plus 2 to the power of n 1 plus left parenthesis minus 2 right parenthesis to the power of n a subscript 1 left parenthesis minus 1 right parenthesis to the power of n plus a subscript 2 2 to the power of n a subscript 1 plus a subscript 2 left parenthesis minus 2 right parenthesis to the power of n Response Feedback: Student needs to know how to solve linear homogeneous recurrence relation

a subscript 1 plus a subscript 2 left parenthesis minus 2 right parenthesis to the power of n

If x and y are both even, then x + y is even. Proof: Assume that x = 2m, y = 2n, then x + y = 2 (m + n) which is even. The above proof method is: Answers: proof by contrapositive proof by mathematical induction direct proof proof by contradiction Response Feedback: Student shall know five proof skills. Direct proof, proof by contradiction, proof by cases, proof by contrapositive, and proof by mathematical indcution

direct proof

Which of the following Boolean function represents the following circuit? Answers: f left parenthesis x comma space y comma space z right parenthesis space equals space left parenthesis top enclose x plus y right parenthesis top enclose x z f left parenthesis x comma space y comma space z right parenthesis space equals space left parenthesis top enclose x z space plus top enclose y right parenthesis z f left parenthesis x comma space y comma space z right parenthesis equals top enclose x space plus space y space plus top enclose y z f left parenthesis x comma space y comma space z right parenthesis space equals space top enclose left parenthesis top enclose x plus y right parenthesis end enclose space plus space y z (There is a short bar on top of x) Response Feedback: Students need to know the relationship between Boolean function and circuit

f left parenthesis x comma space y comma space z right parenthesis space equals space left parenthesis top enclose x plus y right parenthesis top enclose x z

Design a circuit from a description of the circuit in English. The output is 1 if all three inputs are 1 Answers: f left parenthesis x comma space y comma space z right parenthesis space equals space x y top enclose z space plus space top enclose x y z space plus space x top enclose y z f(x, y, z) = xy + yz + zx f(x, y, z) = x + y + z f(x, y, z) = xyz Response Feedback: Student shall be able to design a circuit

f(x, y, z) = xyz

Prove that 1 cross times 2 plus 2 cross times 3 plus... plus n cross times left parenthesis n plus 1 right parenthesis equals fraction numerator n left parenthesis n plus 1 right parenthesis left parenthesis n plus 2 right parenthesis over denominator 3 end fraction If we proof by mathematical induction, what will be the assumption for the inductive step? Answers: k is positive integer and 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis equals fraction numerator k left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis over denominator 3 end fraction 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis plus left parenthesis k plus 1 right parenthesis cross times left parenthesis k plus 2 right parenthesis space equals space fraction numerator left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis left parenthesis k plus 3 right parenthesis over denominator 3 end fraction 1 cross times left parenthesis 1 plus 1 right parenthesis equals fraction numerator 1 left parenthesis 1 plus 1 right parenthesis left parenthesis 1 plus 2 right parenthesis over denominator 3 end fraction 1 cross times 2 plus 2 cross times left parenthesis 2 plus 1 right parenthesis space equals space fraction numerator 2 left parenthesis 2 plus 1 right parenthesis left parenthesis 2 plus 2 right parenthesis over denominator 3 end fraction Response Feedback: Student shall know how to proof by mathematical induction and use mathematical induction to prove recurrence relation.

k is positive integer and 1 cross times 2 plus 2 cross times 3 plus... plus k cross times left parenthesis k plus 1 right parenthesis equals fraction numerator k left parenthesis k plus 1 right parenthesis left parenthesis k plus 2 right parenthesis over denominator 3 end fraction

A large union left parenthesis B large intersection C right parenthesis space equals Answers: left parenthesis A large intersection B right parenthesis space large union left parenthesis A large intersection C right parenthesis left parenthesis A large union B right parenthesis large intersection left parenthesis A large union C right parenthesis empty set B large union C large union A Response Feedback: Student shall know set operations and set identities

left parenthesis A large union B right parenthesis large intersection left parenthesis A large union C right parenthesis

For every integer n, if n2 is an odd, then n is odd. What is the best way to proof the above statement? Answers: proof by contrapositive proof by cases proof by mathematical induction Direct proof Response Feedback: The student shall know five proof skills: Direct proof, proof by contrapositive, proof by contradiction, proof by cases, and proof by mathematical induction. For this problem, shall proof by contrapositive. That is to prove that if n is even, then n squared is even. Suppose that n = 2m, then n squared equals left parenthesis 2 m right parenthesis squared equals 4 m squared space w h i c h space i s space e v e n

proof by contrapositive

By the law of Boolean Algebra, x top enclose y plus x y space equals Answers: top enclose x y x y xy Response Feedback: Student shall know basic Boolean operations, Boolean functions, and gates

x

Which boolean function derived from following table? x y f(x, y) 0 0 1 0 1 0 1 0 0 1 1 1 Answers: x y space plus space top enclose x space top enclose y y top enclose x y space plus space top enclose y x x y space plus space top enclose x y Response Feedback: Student shall know basic Boolean operations, Boolean functions, and gates

x y space plus space top enclose x space top enclose y

Simplify the following Boolean Expression: (x+y)xy + xz Answers: x(y+z) y(x+z) z(x+y) xyz Response Feedback: Student shall know Laws of Boolean Algebra and relationship between Boolean function and circuit

x(y+z)

Suppose that A = {1, 2, 3, 4, 5, 6}, B = {3, 4, 5}, C = {1, 2, 4}, what is A minus left parenthesis B minus C right parenthesis ? Answers: {6} {4, 5} {1, 2, 4, 6} empty set Response Feedback: Student shall know set operations and set identities

{1, 2, 4, 6}

Which one of these first-order logic formula is valid? Answers: ∃x(P(x) ∨ Q(x)) => (∃xP(x) => ∃xQ(x)) ∀x(P(x) => Q(x)) => (∀xP(x) => ∀xQ(x)) ∃x(P(x) ∧ Q(x)) <=> (∃xP(x) ∧ ∃xQ(x)) ∀x∃y P(x, y) => ∃y∀x P(x, y) Response Feedback: Study the Quiz questions and understand the answers http://www.geeksforgeeks.org/propositional-and-first-order-logic-gq/

∀x(P(x) => Q(x)) => (∀xP(x) => ∀xQ(x))


Ensembles d'études connexes

Chapter 4: Managing Ethics and Social Responsibility

View Set

Organizational Behavior - Chapter 8

View Set

What type of blade works best on soft wood on the scroll saw?

View Set