Professional Documents
Culture Documents
ASSIGNMENT 1
SEMESTER I, 2022/2023
Code and Name of Course: COMP2201 – Discrete Mathematics
AREA DESCRIPTION
Objectives To have a student apply the knowledge garnered during the first few weeks of
the course
Deliverable The answers for the questions which follow the instruction pages
Instructions 1. Review Lectures of the first three weeks of the course, the COMP2201
Text and any other related Discrete Mathematics material
2. Read the Assignment 1 Sheet thoroughly
3. Submit the gradable solution by using the
COMP2201 Assignment 1 - Individual located within the
ASSIGNMENTS Section of the OURVLE COMP2201 Course
Environment. This may also be accessed by choosing the Assignments
section below “Activities”
Format The solution for this assignment must be submitted as a Microsoft Word
document.
Your ID number should form part of the Microsoft Word file name. The file
name should take the format “COMP2201 Assignment 1 Semester 1 2022-
2023 XXXXXXXX” where XXXXXXXX represents the student ID number.
Upload The solution for this assignment should be uploaded in the relevant space
Constraint provided in OURVLE (See “Instructions” section above). A message
indicating “File uploaded successfully” will acknowledge that the file has
been sent successfully.
Do NOT assume your project has been received if you do not get this
acknowledgement.
Late Late assignments are accepted. These are however graded then 25%
Assignments deducted for each day of late submission.
Expectation It is expected that students will discuss means to a solution. The actual work
written is expected to reflect each student’s uniqueness. Where replication of
work is identified, each paper will be graded. The allocated grade to each
student’s piece of work for where this anomaly is identified will be the grade
divided by the number of replications discovered.
(a) Where the number of repetitions of each object is known as in the word
AEQUEOSALINOCALCALINOCERACEOALUMINOSOCUPREOVITRIOLIC
show why the formula for the number of permutations (orderings) of n objects of
t types is n!
n1 !n 2 !. .. nt !
[2]
(b) Hence, determine the number of words using all the letters that may be formed
from the said word
AEQUEOSALINOCALCALINOCERACEOALUMINOSOCUPREOVITRIOLIC
[1]
52 !
8 ! 6 ! 6 ! 6 !5 ! 3! 3!2 ! = 6.203212188 x1050
(c) Using your formula in (b), state a simplified formula for the number of unique
codewords, assuming a codeword such as
zibp082AEQUEOSALINOCALCALINOCERACEOALUMINOSOCUPREOVITRIOLIC(*#*$
is made up of 4 lowercase letters of the English alphabet where order is not
important, 3 distinct digits where order is important, the uppercase letters of the
word in (a), and 5 special characters (allowing repeats with order not being
important), all in the same order. For ease of reference, it is accepted that there are
32 special characters. [3]
(d) Develop a question that the third form of the Pigeonhole Principle may be
used to solve. [2]
Question: Each month one bus travels from UWI Mona to Spanish Town.
In 2020 due to Covid, 6 buses traveled the route. Show that at least one bus
traveled 2 months.
(e) Using the third form of the Pigeonhole Principle, solve the question in (d). [2]
From the Tree Diagram, the number of selections in which either Rhona is Vice Captain or
Trevion is Captain, or Quilston is Operations Officer otherwise he is not an officer is Forty-Two
(42).
Question 3 [2 marks]
By drawing Pascal’s Triangle and applying Pascal’s Theorem, show that both methods
may be used to determine equivalent values for the row of Pascal’s triangle containing
the following binomial coefficients
To determine the row of Pascal’s triangle containing the following binomial coefficients
( )
¿ 12 , 0 ≤ k ≤12
¿k
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
1 7 21 35 35 21 7 1
1 8 28 56 70 56 28 8 1
1 9 36 84 126 126 84 36 9 1
(¿¿12k ), 0 ≤ k ≤12 is
1 12 66 220 495 792 924 792 495 220 66 12 1
Pascal’s Theorem states,
Therefore,
+ 0 1 2 3 4 5 6 7 8 9 10 11 12
0 0 1 2 3 4 5 6 7 8 9 10 11 12
1 1 2 3 4 5 6 7 8 9 10 11 12 0
2 2 3 4 5 6 7 8 9 10 11 12 0 1
3 3 4 5 6 7 8 9 10 11 12 0 1 2
4 4 5 6 7 8 9 10 11 12 0 1 2 3
5 5 6 7 8 9 10 11 12 0 1 2 3 4
6 6 7 8 9 10 11 12 0 1 2 3 4 5
7 7 8 9 10 11 12 0 1 2 3 4 5 6
8 8 9 10 11 12 0 1 2 3 4 5 6 7
9 9 10 11 12 0 1 2 3 4 5 6 7 8
10 10 11 12 0 1 2 3 4 5 6 7 8 9
11 11 12 0 1 2 3 4 5 6 7 8 9 10
12 12 0 1 2 3 4 5 6 7 8 9 10 11
Multiplication Table of Z13
* 0 1 2 3 4 5 6 7 8 9 10 11 12
0 0 0 0 0 0 0 0 0 0 0 0 0 0
1 0 1 2 3 4 5 6 7 8 9 10 11 12
2 0 2 4 6 8 10 12 1 3 5 7 9 11
3 0 3 6 9 12 2 5 8 11 1 4 7 10
4 0 4 8 12 3 7 11 2 6 10 1 5 9
5 0 5 10 2 7 12 4 9 1 6 11 3 8
6 0 6 12 5 11 4 10 3 9 2 8 1 7
7 0 7 1 8 2 9 3 10 4 11 5 12 6
8 0 8 3 11 6 1 9 4 12 7 2 10 5
9 0 9 5 1 10 6 2 11 7 3 12 8 4
10 0 10 7 4 1 11 8 5 2 12 9 6 3
11 0 11 9 7 5 3 1 12 10 8 6 4 2
12 0 12 11 10 9 8 7 6 5 4 3 2 1
Question 5 [5 marks]
(a) A computer access password consists of from four to ten letters chosen from
the 22 in the Hebrew alphabet with repetitions not allowed. How many
different passwords are possible? [2]
nPr = n! / (n-r)!
= 2.5408625 x1012
(b) If any thirteen letters (of the 24-letter Greek alphabet) could be used to form a
password, how many thirteen-letter passwords would have at least one repeated
letter? [3]
k=0
By substitution,
= (3u2)4 (-2v3 + 4w)0 + 4 (3u2)3 (-2v3 + 4w)1 + 6 (3u2)2 (-2v3 + 4w)2 + 4 (3u2)1 (-2v3
+ 4w)3 + (3u2)0 (-2v3 + 4w)4
= 81u8 + 4 (27u6) (-(2v3 + 4w)) + 6 (9u4) (-(4v6 + 16wv3 + 16w2) + 4 (3u2)1 (-(8v9 +
48wv6 + 96v3w2 + 64w3)) + (-(16v12 + 128v9w + 384v6w2 + 512v3w3 + 256w4))
There are 365 days in a year. So, the number of days in 28 years is (365 × 28 =)
10,220 days.
However, every 4 years is a leap year, therefore assuming we are in a leap year,
during the 28 years, there will be (28 ÷ 4 = ) 7 leap years. Being that each leap
year carries an extra day, there will be 7 additional days. Hence the total number
of days is (10,220 + 7 =) 10,227 days.
10,227 mod 7 = 0
Any multiple of 7 days past a given date will be on the same day of the week.
Given that there were no remainders, it is a multiple of 7 and therefore the same
day.
So, if a date falls on Tuesday 28 years ago,, it will fall on the same day, Tuesday,
28 years after.
function getPrimes(n)
return list_of_all_primes_whose_product_is_n
function productOfList(lst)
if lst is empty
product = 0
else
product = 1
for value in lst
product = product * value[0] ^ value[1]
return product
(c) Using the algorithm provided for section (b) of this question, illustrate how
your algorithm would find the Least Common Multiple of 52668 and 227205. [3]
(d) Using the Euclidean Algorithm, illustrate how the Highest Common Factor of
52668 and 227205. [2]
Question 8 [5 marks]
Using any programming language taught in your first year at the university, write a
function No_Fib_Checker that takes two lists of integers lst1 and lst2, and returns
False if the numbers in any of the two lists are not consecutive numbers within the
Fibonacci sequence. True is returned otherwise. [5]