Problem Set 5
Problem Set 5
Problem Set #5
This Problem Set is due at 11:59 pm Pacific time on 2024-10-17, and will be submitted on Canvas.
This Problem Set is worth 6% of the final course grade. There are five problems.
Problems #1 and #2 and #3 are to be completed individually, while Problems #4 and #5 are to
be completed in your assigned small groups.
Please type (or neatly handwrite) your solutions on standard 8.5 × 11 (or A4) paper, with your name(s)
at the top of each solution. Ensure that you submit five separate PDF files on Canvas, one for each
problem. Make sure you label your Problem Set #1 submissions appropriately - e.g. timothy-1-1.pdf,
timothy-1-2.pdf, timothy-1-3.pdf, timothy-1-4.pdf, timothy-1-5.pdf.
Given that the last two problems are done in a group, your final two PDF files will be identical to
some of your classmates. (For example, timothy-4.pdf might be identical to yvonne1-4.pdf and bethany1-
4.pdf). This is completely fine, and enables you to have a record of all of your submitted work in this
course.
While a solution must be absolutely perfect to receive full marks, I will be generous in awarding partial
marks for incomplete solutions that demonstrate progress.
So that there is no ambiguity, there are two non-negotiable rules. A violation of either rule constitutes
plagiarism and will result in you receiving an F for this course.
(a) If you meet with a classmate to discuss one of the Problems, the articulation of your thought process
(i.e., what you submit to me), must be an individual activity, done in your own words, away from
others. Please remember that the solution-writing process is where so much of your learning will
occur in this course - even more than the time you spend on solving the problems. Do not be
surprised if it takes you 3 to 5 times as long to write up a solution as it takes you to actually solve
the problem.
(b) This Problem Set has been designed to be challenging, because struggling through problems is how
we learn best. When stuck on a problem, it can be helpful to get a small hint that will allow you to
make some progress without robbing you of the opportunity to solve the problem. Online searches,
and even well-intentioned classmates, may be unable to provide you with just a small insight. If
you need support/a small hint, the best plan is to post your query on the Canvas discussion forum.
I will be readily available during office hours, or by appointment.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #5 2
Problem #1 – INDIVIDUAL
I own a lock for my bicycle.
To open the lock, I need to know a 3-digit code between 000 and 999.
(a) There are many codes for which the three digits are all odd numbers, including 173, 911, and 555.
Determine the total number of codes for which the three digits are all odd numbers.
(b) There are many codes for which the three digits are all different, including 801, 097, and 123. De-
termine the total number of codes for which the three digits are all different.
(c) There are many codes for which the three digits are all different and in increasing order, including
123, 059, and 479. Determine the total number of codes for which the three digits are all different
and in increasing order.
Problem #2 – INDIVIDUAL
There are 6 ways we can rearrange the letters of the EAT, namely {AET, ATE, EAT, ETA, TAE, TEA}.
There are 120 ways we can rearrange the letters of the word ALIGN. This is because there are 5! =
5 × 4 × 3 × 2 × 1 = 120 different permutations of the five letters A, L, I, G, N.
(a) Suppose we were to list out all 120 permutations of ALIGN, and write them in alphabetical order,
starting with the 1st word (AGILN) and ending with the 120th word (NLIGA).
It turns out that this word appears in the English dictionary, meaning “goods (or wreckage) on
the sea bed that is attached to a buoy so that it can be recovered.”
(c) Pick one of these 120 words at random. Determine the probability that this chosen word begins
with a vowel and ends with a consonant.
A and I are vowels, while L, G, N are consonants. For example, the word ALIGN begins with
a vowel and ends with a consonant.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #5 4
Problem #3 – INDIVIDUAL
The game of SET was invented by a population geneticist named Marsha Falco, who was studying epilepsy
in German Shepherds by representing genetic data on the dogs by drawing symbols on cards.
This is how the game of SET was originally conceived. Since then, SET has become one of the most
popular games in the world. There is a free online version available at https://www.setgame.com/set/
puzzle.
Each card varies in four features, with three possibilities for each feature: number (1/2/3), shape
(diamond/squiggle/oval), shading (solid/open/striped), and colour (red/green/purple). Each of the
3 × 3 × 3 × 3 = 81 possible cards appears exactly once in the deck.
Three different cards form a SET if for each of the four features, the three cards are ALL the same
or the three cards are ALL different.
(a) In the diagram above, there are 12 cards. I have provided 5 different SETS, seen above the black
arrow on the right. There is one SET that is missing. Determine this set.
You will get full marks for the correct answer in (a); no justification is required.
(b) Lay out all 81 cards face up. Determine the total number of SETs that appear. (For example, in
the 12-card example above, there are a total of six SETs, with certain cards belonging to multiple
SETs.)
(c) Lay out all 81 cards face up. Every time Yiwei finds a SET (of her choice), she removes those three
cards. Suppose she is able to do this a total of 26 times, so that there are only 3 cards left. Must
these three remaining cards form a SET? If so, explain why. If not, explain why not.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #5 5
Problem #4 – GROUP
In this question, assume that every square is a rectangle (though obviously, not vice-versa!).
n
In this question we use the notation k to denote C(n, k), or n Ck , the number of ways we can se-
lect k objects from a set of n.
Let f (m, n) be the number of rectangles, of all sizes, that appear on an m by n board.
! !
m+1 n+1
(a) Clearly explain why f (m, n) = × .
2 2
(b) Suppose we remove a corner square from an 8 by 8 board. Determine how many rectangles, of all
sizes, appear on this modified board.
(c) Suppose we now remove all four corner squares from an 8 by 8 board. Determine how many
rectangles, of all sizes, appear on this modified board.
NOTE: for parts (b) and (c), there are several nice mathematical solutions to this problem, using the
combinatorial techniques we have seen in this course. However, if you wish, you may submit a Python
program for part (b) and/or part (c) instead of a written mathematical solution. If you do submit a
Python program, make sure you clearly document your code so that the TAs can follow what you did
and understand why your program outputs the correct answer.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #5 6
Problem #5 – GROUP
n
In this question we use the notation k to denote C(n, k), or n Ck , the number of ways we can select k
objects from a set of n.
!
n n!
We know that = . In the bonus combinatorial proof example video we proved that
k k!(n − k)!
! ! !
n n−1 n−1
= + , and developed
k k k−1
a combinatorial proof for this formula. You will develop the same kind of proofs in this question.
(a) Consider n lightbulbs in a room, numbered 1 to n. Determine the number of ways these lightbulbs
can be turned on or turned off. By solving this problem in two different ways, explain why
! ! ! !
n n n n
+ + + ... + = 2n .
0 1 2 n
(b) Consider the number of routes there are from (0, 0) to (6, 6), where each route consists of NORTH
moves and EAST moves.
Argue that each route must go through exactly one of the seven “checkpoints” indicated above.
Using this diagram, explain why
! ! ! ! ! ! ! ! ! ! ! ! ! ! !
6 6 6 6 6 6 6 6 6 6 6 6 6 6 12
+ + + + + + = .
0 6 1 5 2 4 3 3 4 2 5 1 6 0 6
(c) In part (a), you determined a formula for the sum of the nth row of Pascal’s Triangle1 .
Now determine a formula for the sum of the squares of the nth row of Pascal’s Triangle, clearly
justifying your answer:
!2 !2 !2 !2
n n n n
+ + + ... + = ??
0 1 2 n
1
Reading about Pascal’s triangle in Section 8.6.1 of the text book was not assigned, and you don’t need to be familiar
with the meaning of Pascal’s triangle for this problem — just take it as given that the nth row of Pascal’s triangle is the
sequence:
n n n n
, , ,...,
0 1 2 n