0% found this document useful (0 votes)
50 views

Discrete Structures

This document contains the solutions to a CS211 Discrete Structures midterm exam with 4 questions. Question 1 has 4 parts involving finding relations, representing a digraph in a matrix, evaluating a summation, and finding the sum of numbers between 200-950 divisible by 11. Question 2 has 3 parts involving proving an identity using induction, proving a statement by contraposition, and writing a summation in sigma notation. Question 3 has 4 parts involving decoding an encrypted message, finding the greatest common divisor of two numbers, listing integers congruent to -1 modulo 25, and determining memory locations using hashing. Question 4 has 2 parts determining if two relations are partial orders or equivalence relations. The document provides instructions and maximum points for the exam and wishes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views

Discrete Structures

This document contains the solutions to a CS211 Discrete Structures midterm exam with 4 questions. Question 1 has 4 parts involving finding relations, representing a digraph in a matrix, evaluating a summation, and finding the sum of numbers between 200-950 divisible by 11. Question 2 has 3 parts involving proving an identity using induction, proving a statement by contraposition, and writing a summation in sigma notation. Question 3 has 4 parts involving decoding an encrypted message, finding the greatest common divisor of two numbers, listing integers congruent to -1 modulo 25, and determining memory locations using hashing. Question 4 has 2 parts determining if two relations are partial orders or equivalence relations. The document provides instructions and maximum points for the exam and wishes
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

CS211 DISCRETE STRUCTURES

MID-II SOLUTION
Instructions:
• Return the question paper together with the answer script. Read each question completely before answering
it. There are 4 questions written on 2 pages.
• In case of any ambiguity, you may make assumptions. However, your assumptions should not contradict any
statement in the question paper.
• Attempt all the questions in given sequence of the question paper to get bonus point.
________________________________________________________________________________________

Total Time: 60 Minutes Maximum Points: 26

Question # 1: [CLO-1] [4x2= 08 points]

(a) Find the smallest relation on {cup, glass, soccer}, that is Asymmetric and Transitive, but not Symmetric.
Solution:
R= {(cup, glass)}

(b) Represent the following digraph as shown in figure # 1 in matrix form.

Solution:
0 1 1 0 0
0 0 1 1 0 Figure # 1
.0 1 0 0 1
1 0 0 0 0
[1 0 0 0 0]

(c) Find the value of the sum: ∑𝟒𝒌=𝟏(𝒌𝟐 − 𝟏) ⋅


Solution:
∑𝟒𝒌=𝟏(𝒌𝟐 − 𝟏) = (𝟏𝟐 − 𝟏) + (𝟐𝟐 − 𝟏) + (𝟑𝟐 − 𝟏) + (𝟒𝟐 − 𝟏) = 𝟐𝟔.

(d) Find the sum of number between 200 and 950 which are divisible by 11.
Solution:
a= 209, d= 11, Tn = 946.
𝑇𝑛 = 𝑎 + (𝑛 − 1)𝑑; 946 = 209 + (𝑛 − 1)(11) n =68.
𝑛 68
Now for Sum; 𝑆𝑛 = [2𝑎 + (𝑛 − 1)𝑑]; 𝑆68 = [2(209) + (68 − 1)(11)] = 39,270
2 2

Question # 2: [CLO-2] [3x2=06 points]

1
𝑛(𝑛+1) 2
(a) Prove using mathematical induction that 1 3 + 2 3 + 3 3 + ... + n 3 = ( ) , whenever n is a nonnegative integer.
2
Solution:
1 3 + 2 3 + 3 3 + ... + n 3 = (n (n + 1) / 2)2
STEP 1: We first show that p (1) is true.
Left Side = 1 3 = 1
Right Side = 1 2 (1 + 1) 2 / 4 = 1
hence p (1) is true.
STEP 2: We now assume that p (k) is true
1 3 + 2 3 + 3 3 + ... + k 3 = (k (k + 1) / 2)2 (1)
add (k + 1) 3 to both sides
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = [(k+1) (k+1+ 1) / 2)]2
1 3 + 2 3 + 3 3 + ... + k 3 + (k + 1) 3 = [(k+1) (k+2) / 2)]2 (2)
put eq(1) in eq(2)
=> (k (k + 1) / 2)2 + (k + 1) 3 = [(k+1) (k+2) / 2)]2
=> k2 (k + 1) 2 /4 + (k + 1)3
=> (k + 1) 2 [ k 2 + 4 k + 4 ] / 4
=> (k + 1) 2 [ (k + 2) 2 ] / 4
=> [(k+1) (k+2) / 2)]2 = [(k+1) (k+2) / 2)]2
LHS = RHS, Hence proved!

(b) Let x be an integer and P is the following statement. P: “If x2 − (x − 2)2 is not divisible by 8, then x is even.”
Prove by contraposition.
Solution: Contraposition: If x is odd then x2 − (x − 2)2 is divisible by 8.
Let x =2k + 1 be an odd number.
x2 − (x − 2)2 = x2 − (x2 – 2x + 4) = x2 − x2 + 4x − 4) = 4(x − 1) = 4(2k + 1 −1) = 8k
which is an integer multiple of 8. Therefore x2 − (x − 2)2 is divisible by 8.

(c) Express in sigma notation the sum of the first 50 terms of the series 3 + 6 + 9 + 12 + 15 +. . ..
Solution:

Question # 3: [CLO-3] [4x2=08 points]

(a) A message has been encrypted using the function f(x) = (x + 5) mod 26. If the message in coded form is
VZJXYNTS UFUJW, decode the message.
Solution:
QUESTION PAPER is the encrypted message.

(b) Find the greatest common divisor, d, of 250 and 29 and determine integers x and y such that d = 250x + 29y.
Solution:

2
(c) List all integers between −100 and 100 that are congruent to −1 modulo 25.
Solution:
-76, -51, -26, -1, 24, 49, 74, 99 are the integers.

(d) Suppose that a computer has only the memory locations 0, 1, 2. . . 64. Use the hashing function
h(x) = (x + 9) mod 65 to determine the memory locations at which the following values are stored:
63, 509, 197, 832, and 652.
Solution:
63 will be stored on memory location 7, 509 will be stored on memory location 63,
197 will be stored on memory location 11, 832 will be stored on memory location 61, and
652 will be stored on memory location 11+1=12.

Question # 4: [CLO-4] [2x2=04 points]

(a) Determine whether the relation in Question # 1 part (a) is a partial-order relation? Show all of your steps.
Solution:
It holds antisymmetric and transitive property but it does not hold reflexive property hence not a partial order
relation.

(b) Determine whether the relation in Question # 1 part (b) is an equivalence relation? Show all of your steps.
Solution:
It is not an equivalence relation. Since it does not hold reflective, symmetric and Transitive properties.

_________________________________________________________________________________________________

ALL THE BEST

You might also like