You are on page 1of 6

Discrete Mathematics

(ONLY Textbook I allowed. No notes or cheat sheet is allowed.)

Problem 1: (Short Questions – one line answer is required) (2*9 + 3*2 = 24 Points)
Write the mathematical expression in simple English: 𝒑: You have the flu, 𝒒: You miss the final examination.
𝒓: You pass the course.
¬𝒑 → ¬𝒒

¬𝒑 ↔ 𝒓

Write in mathematical notation: “A positive integer is composite if it has at-least two divisors other than 1 and
itself”.

Write negation: “Coffee and tea comes with dinner.”

Write negation: ∀𝒂 ∈ 𝒁 such that ∀𝒃 ∈ 𝒁, 𝒂𝒃 < 𝟏

You reach in Moula Jutt Island, inhabitants of which are three kinds of people: knights who always tell the truth, knaves
who always lie, and spies who can either lie or tell the truth.
You encounter three people, A, B, and C. You know one of these people is a knight, one is a knave, and one is a
spy. Each of the three people knows the type of person each of other two is. For each of these situations, if
possible, determine who the knave, knight, and spy are.

Write the following expression without using quantifiers (use logical operators AND, OR, NOT etc). Domain of
𝑄(𝑥) is {−10, −1, 1, 3}.
∀𝒙 𝑸(𝒙)

∃𝒙 (𝒙 < 𝟏) ∧ 𝑸(𝒙)
What is the time complexity of Function in terms of n: What is the time complexity of the following code in
int Third_sqrt(int N) terms of n:
{
for(int d=0; d*d*d<=N; d++) { }
return d-1; int sum,i,k;
} sum = 0;
bool Function(int n) for (i=1; i<=n*n*n; i=i*2)
{
for (int d=2; d <= Third_sqrt(n); ++d)
{
{ for ( k=1; k <= i ; ++k)
if (n%d==0) {
return false; sum++;
}
}
return true;
} }

What is the time complexity in terms of n: What is the time complexity in terms of n:
int f1(int T) int f1(int T)
{ {
int sum = 0; int sum = 0;
for ( k=1; k <= T ; ++k) for ( k=1; k <= T ; ++k)
{ {
sum++; sum++;
} }
} }
int main() int main()
{ {
int sum,i,k; int sum,i,k;
sum = 0;
for (i=1; i<=n*n*n; i=i*2) for (i=1; i<=n*n*n; i=i+2)
{ {
sum+=f1(i); f1(i);
} }
} }

Proble m 2: (Proof by Mathematical Induction) (6+6+6 = 18 Points)


Prove the following identity involving Fibonacci numbers:
𝑓 <2

Prove by induction that all integers ≥ 𝟐 can be represented as a product of prime numbers (prime factorization).
Prove that 𝟐𝒏 > 𝒏𝟐 if n is an integer greater than 4.

Prove that 3 divides 𝒏𝟑 + 𝟐𝒏 whenever n is a positive integer.

Prove that 6 divides 𝒏𝟑 − 𝒏 whenever n is a nonnegative integer.

Problem 3: (Recursion) (5+5=10 Points)


Write a recursive program to compute combinations 𝑷(𝒏, 𝒌) [Hint: first make recursive definition of P(n,k)] and 𝑪(𝒏, 𝒌)
[Hint: Use Pascal’s identity]

Write a recursive program for Linear-Search algorithm, Binary-Search, Selection-Sort


Problem 4: (Counting) (3*9 = 27 Points)
How many permutations of the letters 𝑨𝑩𝑪𝑫𝑬𝑭𝑮𝑯 contain the strings 𝑨𝑮𝑪 and 𝑩𝑭?

How many possible passwords can be formed from the letters:


GENERALIZEDPERMUTATION

A toy shop has 15 airplanes, 5 buses, 7 trains, and 20 bikes in the stock. How many ways are there for a person to take
30 toys home if all the airplanes are identical, all the buses are identical, all the trains are identical and all the bikes are
identical? See the Video (which I uploaded for help?).

Give a combinatorial proof of the following identity. No algebra at all,


𝐂(𝟐𝐧, 𝟐) = 𝟐 𝐂(𝐧, 𝟐) + 𝐧𝟐

Give a combinatorial proof of the following identity. No algebra at all,


𝐂(𝟑𝐧, 𝟑) = 𝟑 𝐂(𝐧, 𝟑) + 𝟔 𝐂(𝐧, 𝟐) 𝐂(𝐧, 𝟏) + 𝐧𝟑

Give a combinatorial proof of the following identity. No algebra at all,


𝐂(𝐧, 𝐤) = 𝐂(𝐧 − 𝟏, 𝐤) + 𝐂(𝒏 − 𝟏, 𝒌 − 𝟏)
Give a combinatorial proof of the following identity. No algebra at all,
𝐂(𝐧, 𝐤) = 𝐂(𝐧 − 𝟐, 𝐤) + 𝟐 ∗ 𝐂(𝐧 − 𝟐, 𝐤 − 𝟏) + 𝐂(𝒏 − 𝟐, 𝒌 − 𝟐)

List all possible ways in which we can put 5 prisoners (A, B, C, D, E) into 4 identical cells (there could be more than one
prisoners in one cell).

List all possible ways in which we can put 5 identical objects (let’s say 5 empty – files with UCP header) into 4 identical
cells (there could be more than one prisoners in one cell).

Problem 5: (Short Questions – one line answer is required) (3*10 = 30 Points MAX)
In how many different ways can the letters of the word 'Google' be arranged in such a way that the vowels always come
together?

In a group of 16 boys and 14 girls, thirteen children are to be selected. In how many different ways can they be selected such
that at least 10 girl should be there?

In how many ways a committee, consisting of 15 carpenters and 25 painters can be formed from 50 carpenters and 100
painters?

A box contains 2 black balls, 3 white balls and 4 yellow balls. In how many ways can 4 balls be drawn from the box, if at least
one black ball is to be included in the draw?

How many 6-digit numbers can be created such that no digit is repeated? What if the number has to be divisible by 5? By 25?
A typist has 6 letters and 6 addressed envelopes. In how many different ways can the letters be placed in each envelope getting
every letter in the right envelope?

What is the coefficient of 𝑥 in the expansion of (−6 + 7𝑥)

What is the coefficient of the term which is independent of x in the expansion of (−6𝑥 + 7/𝑥)

What is the coefficient of the term which is independent of x in the expansion of (−6𝑥 + 7/𝑥)

How many solutions are there to the equation, u + v + w + x + y + z = 100, where u, v, w, x, y, z are non-negative integers?

How many solutions are there to the equation, u + v + w + x + y + z ≤ 100, where u, v, w, x, y, z are non-negative integers?

How many solutions are there to the equation, u + v + w + x + y + z ≤ 100, where u ≥1, v ≥1, w ≥ 21, x ≥11, y ≥1, z ≥15 are
non-negative integers?

How many bits strings of length 14 has at least 13 ones?

How many bits strings of length 14 has exactly 13 ones?

If Sarim has an infinite number of Galla, Waffer, Coconut, and Bakery biscuits in separate piles, how many biscuits Sarim
must pull out of the piles to guarantee he has one pair of the same biscuits?

If Sarim has an infinite number of Galla, Waffer, Coconut, and Bakery biscuits in separate piles, how many biscuits Sarim
must pull out of the piles to guarantee he has one pair of the biscuits (not necessarily the same type)?

If Sarim has an infinite number of Galla, Waffer, Coconut, and Bakery biscuits in separate piles, how many biscuits Sarim
must pull out of the piles to guarantee he has one pair of Galla biscuits?

You might also like