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

Discrete Math Assignment1

Uploaded by

Mapalo Muonga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

Discrete Math Assignment1

Uploaded by

Mapalo Muonga
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

CAVENDISH UNIVERSITY ZAMBIA

BACHELOR OF COMPUTER SCIENCE Y2S1


DISCRETE MATHEMATICS (Assignment)
Group one

Student numbers
• 107-970
• 108-848
• 107-074
• 109-177
• 106-243
• 106-122
• 103-325
• 108-518
• 108-912
• 108-286
Question 1:
Exactly four 1sLet's break down each question:

1. How many bit strings of length 10 contain:


a) Exactly four 1s?

To solve this, we can use combinations. There are 10 positions and we need to
choose 4 of them to place the 1s, and the remaining positions will be filled up with
0s. So, the number of such strings is:

10C4 = 210

b) At most four 1s?


This includes strings with 0, 1, 2, 3, or 4 1s. We can calculate this by summing up
the results of choosing 0, 1, 2, 3, or 4 1s using combinations:

10C0 = 1 10C1 = 10 10C2 = 45 10C3 = 120 10C4 = 210

Answer: 1+10+45+120+210 = 386


c) At least four 1s

This includes strings with 4, 5, 6, 7, 8, 9, or 10 1s. We can calculate this by


summing up the results of choosing 4, 5, 6, 7, 8, 9, or 10 1s using combinations:
10C4 = 210 10C5 = 252 10C6 = 210 10C7 = 120 10C8 = 45
10C9 = 10 10C10 = 1
Answer: 210+252+120+210+45 = 848

d) An equal number of 0s and 1s?


To have an equal number of 0s and 1s, we need exactly 5 of each. So, the number
of such strings is:
10C5 = 252
Question 2
For this case, we need to understand the concept of combinations and apply the
appropriate formulas.

a) To find the number of bit strings of length 12 containing exactly three 1s, we
need to choose 3 positions out of 12 for the 1s, and the remaining 9 positions will
be filled with 0s.

12C3 = 220

b) To find the number of bit strings of length 12 containing at most three 1s, we
need to consider the cases where there are 0, 1, 2, or 3 occurrences of 1s. The
formula for the sum of these cases is:
Number of bit strings with at most three 1s = 12C0 + 12C1 + 12C2 + 12C3
= 1 + 12 + 66 + 220
= 299
c) To find the number of bit strings of length 12 containing at least three 1s, we
need to consider the cases where there are 3, 4, 5... 12 occurrences of 1s. The
formula for the sum of these cases is:
Number of bit strings with at least three 1s = 12C3 + 12C4 + 12C5 + ... + 12C12
: 220 + 495 + 792 + 924 + 792 + 495 + 220 + 66 + 12 + 1 = 4,017

d) To find the number of bit strings of length 12 containing an equal number of 0s


and 1s, we need to consider the cases where there are 6 occurrences of 1s (and
consequently, 6 occurrences of 0s). The formula for this case is:
Number of bit strings with equal 0s and 1s: 12C6 = 924
Question 3
To solve these permutation problems, we can treat the given strings as single
entities and calculate the permutations accordingly:
a) For the string "ED", we have 2 letters already fixed. So, we need to arrange
the remaining 6 letters (ABC, FGH) along with "ED", which gives us:
7! = 5,040

b. For the string "CDE", we have 3 letters already fixed. So, we need to arrange the
remaining 5 letters (AB, FG, and H) along with "CDE", which gives us:
6! = 720

c. For the strings "BA" and "FGH", we can treat them as single entities. So, we
have 6 entities to arrange: "BA", C, D, E, "FGH". This gives us:
5! = 120

d. For the strings "AB", "DE", and "GH", we can treat them as single entities. So,
we have 5 entities to arrange: "AB", C, F, "DE", "GH". This gives us:
5! = 120

e. For the strings "CAB" and "BED", we have 3 letters already fixed. So, we need
to arrange the remaining 5 letters (FGH) along with "CAB" and "BED", which
gives us:
7! = 5,040

f. For the strings "BCA" and "ABF", we have 3 letters already fixed. So, we need to
arrange the remaining 5 letters (DEG, H) along with "BCA" and "ABF", which
gives us:
7! = 5,040

Question 4
To solve these problems, we can use combinations:

a. To find the total possible outcomes, each flip can result in two possibilities
(heads or tails), and there are 8 flips. So, the total possible outcomes are: 2^8 = 256
b. To find the number of outcomes with exactly three heads, we need to choose 3
out of the 8 flips to be heads, and the rest will be tails. So, the number of such
outcomes is: 8C3=56

c. To find the number of outcomes with at least three heads, we can sum the
number of outcomes with exactly 3, 4, 5, 6, 7, or 8 heads.
8C3 + 8C4 + 8C5 + 8C6 + 8C7 + 8C8
56 + 70 + 56 + 28 + 8 + 1 = 219
d. To find the number of outcomes with the same number of heads and tails, there
must be 4 heads and 4 tails. So, the number of such outcomes is the same as the
number of outcomes with exactly 4 heads, which is:
8C4 = 70

Question 5
a) If there are no restrictions, each prize can be awarded to any of the 100 people.
So, for each prize, there are 100 choices. Therefore, the total number of ways to
award the prizes is 100^4 = 100,000,000

b) If the person holding ticket 47 wins the grand prize, then there are 99 choices
for the grand prize winner (since ticket 47 cannot win again) and 99 choices for
each of the other three prizes. Therefore, the total number of ways is
99^3=970,299

c) If the person holding ticket 47 wins one of the prizes, we can count the total
number of ways to award the prizes and then subtract the number of ways where
ticket 47 does not win any prize. This is equivalent to the total number of ways
minus the number of ways where ticket 47 does not win any prize. From part b,
we know that the number of ways ticket 47 wins a prize is 99^3=970,299.
Therefore, the number of ways ticket 47 does not win any prize is
100^3=1,000,000. So, the number of ways ticket 47 wins at least one prize is
100,000,000−1,000,000=99,000,000

d) If the person holding ticket 47 does not win a prize, then there are 99 choices for
each of the four prizes (since ticket 47 cannot win any prize). Therefore, the
number of ways is
99^4 = 96,059,601

e) If both tickets 19 and 47 win prizes, then we need to choose 2 out of the 4 prizes
to award to these two tickets. Once we've done that, each of the other two prizes
can be awarded to any of the 98 remaining people. So, the number of ways is
4C2 × 98^2 = 23,852,004

f) If tickets 19, 47, and 73 all win prizes, then each of the remaining prize can be
awarded to any of the 97 remaining people. So, the number of ways is 97^1 = 97

g) If the people holding tickets 19, 47, 73, and 97 all win prizes, there's only one
way to distribute the prizes among them since each of them will receive a prize.
Therefore, the number of ways to award the prizes in this scenario is 1.

h) If none of the tickets 19, 47, 73, and 97 wins a prize, then each of the four prizes
can be awarded to any of the 96 remaining people. So, the number of ways is:
96^4=88,179,456
i) If the grand prize winner is one of the tickets 19, 47, 73, or 97, then we have
four choices for the grand prize winner, and each of the remaining three prizes
can be awarded to any of the 99 remaining people. So, the number of ways is
4×99^3 = 389,986,704
j) If tickets 19 and 47 win prizes, but tickets 73 and 97 do not win prizes, then
there are (42)=6(24)=6 ways to choose which two prizes go to tickets 19 and 47,
and each of the remaining two prizes can be awarded to any of the 98 remaining
people. So, the number of ways is 6×98^2 = 576,576.

You might also like