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

Problem Set 4

This document outlines Problem Set #4 for CS 5002 at Northeastern University, due on October 10, 2024. It consists of five problems, with the first three to be completed individually and the last two in groups, contributing 6% to the final grade. The document emphasizes the importance of individual work, the rules against plagiarism, and provides specific instructions for submission.

Uploaded by

chen.sizhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Problem Set 4

This document outlines Problem Set #4 for CS 5002 at Northeastern University, due on October 10, 2024. It consists of five problems, with the first three to be completed individually and the last two in groups, contributing 6% to the final grade. The document emphasizes the importance of individual work, the rules against plagiarism, and provides specific instructions for submission.

Uploaded by

chen.sizhi
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Northeastern University

CS 5002 – Discrete Structures


Spring 2024 Semester, Timothy Edmunds

Problem Set #4

This Problem Set is due at 11:59 pm Pacific time on 2024-10-10, 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 #4 2

Problem #1 – INDIVIDUAL
(a) There are 6 ways we can rearrange the letters of the EAT, namely {EAT, ETA, TAE, TEA, AET,
ATE}. These are known as permutations.

Determine the total number of ways we can rearrange the letters of the word MATH. Clearly
explain your answer.

(b) Determine the total number of ways we can rearrange the letters of the word HELLO. Clearly
explain your answer.

(c) In the Canadian province of Ontario, every car’s license plate used to be three digits followed by
three letters (505 PZC) or three letters followed by three digits (BTB 743). On any license plate,
the same letter could appear more than once, and the same digit could appear more than once.

Determine how many possible license plates could be issued.


CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #4 3

Problem #2 – INDIVIDUAL
The contrapositive of a conditional statement is formed by negating both terms and reversing the direc-
tion of inference. For example, if S is the statement “if I live in British Columbia then I live in Canada”,
then the contrapositive of S is “if I don’t live in Canada, then I don’t live in British Columbia”.

Any statement and its contrapositive are logically equivalent. Thus, if P → Q is TRUE, then the
contrapositive ¬Q → ¬P is TRUE. And if P → Q is FALSE, then ¬Q → ¬P is FALSE.

To prove the statement “if P, then Q”, sometimes it is easier to prove the contrapositive statement
“if not Q, then not P”. And that is what you will do in this question.

Using Proof by Contrapositive, prove each of the following statements.

(a) Let n be a positive integer. If n2 + 2n + 5 is an even number, then n is odd.

(b) If there are 15 students in Discrete Structures, then at least three students were born on the same
day of the week.

(c) Prove the Generalized Pigeonhole Principle: if nk + 1 pigeons fly into n pigeonholes, then at least
one pigeonhole contains at least k + 1 pigeons.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #4 4

Problem #3 – INDIVIDUAL
Below are two 3 by 4 boards, where each cell is coloured either red or blue. Notice that on the board on
the right you could draw a rectangle/square with its four corners in the middle of cells that are all the
same colour, but on the board on the left, you cannot1 .

(a) Consider a 3 by 9 board, where each cell is coloured red or blue. First explain why there 8 different
options for how the three cells of any column can be coloured (e.g. the first column in the left-most
board is Red/Red/Blue) and use this fact to prove that no matter how the colours are chosen, the
board must contain at least one rectangle or square whose four corner cells are all the same colour.

(b) Consider a 3 by 6 board, where each cell is coloured red or blue. Must the board contain a rectangle
or square whose four corner cells are all the same colour? Show that the answer is no by colouring
the 18 cells so that there is no rectangle or square whose four corner cells are all the same colour.
Briefly explain how you found your solution.

(c) Consider a 3 by 7 board, where each cell is coloured red or blue. Must the board contain a rectangle
or square whose four corner cells are all the same colour? If so, clearly explain why, showing that
such a rectangle/square must exist no matter how the colours are chosen. If not, demonstrate with
a specific counterexample.

1
The rectangle has to be axis-aligned — rotated rectangles are not allowed.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #4 5

Problem #4 – GROUP
Bethany and Yvonne play a game. The board consists of six points, labelled A to F clockwise, with A
at the top. They take turns drawing a line between two points, colouring that line black (Bethany) or
yellow (Yvonne). Bethany goes first.

As soon as Bethany creates an all-black triangle, Bethany loses and Yvonne wins. As soon as Yvonne
creates an all-yellow triangle, Yvonne loses and Bethany wins.

In the game below, 14 out of 15 lines have been drawn (all except the line AC). Notice that the game is
over because triangle BDF is all-yellow. Thus, Bethany (Player 1) wins this game.2

(a) Post a screenshot of you playing this game against the computer robot, set at the difficulty level
of your choice. You are Player 1 (black) and the computer robot is Player 2 (yellow). You will
receive full points if your screenshot shows a WIN and partial points otherwise. The website is
https://joshbraun.umasscreate.net/sim/

(b) Prove that this game cannot end in a tie, i.e., it is impossible for Bethany and Yvonne to draw all
15 edges without creating at least one all-black or all-yellow triangle.

(c) Suppose the game is played on five points instead of six. Then the total number of moves is 10.
Determine whether this game can end in a tie. If so, show how Bethany and Yvonne can play
the game without creating an all-black or all-yellow triangle. If not, clearly explain why this game
cannot end in a tie.

(d) (OPTIONAL BONUS) Consider the six-point game, where Bethany and Yvonne draw all 15 edges.
Is it possible for the 15 edges to be coloured so that Bethany creates just one all-black triangle, and
Yvonne creates zero all-yellow traingles? If so, demonstrate how. If not, clearly explain why not.
2
The triangle must connect 3 of the A-F points — e..g, the black triangle between A, B and the middle doesn’t count.
CS 5002, Spring 2024 Semester, Timothy Edmunds – Problem Set #4 6

Problem #5 – GROUP
The Longest Subsequence Problem is a well-studied problem in Computer Science, where given a sequence
of distinct positive integers, the goal is to output the longest subsequence whose elements are in sorted
order, from highest to lowest, or from lowest to highest.

For example, consider the sequence S = [9, 7, 4, 10, 6, 8, 2, 1, 3, 5]. The longest increasing subsequence
of S has length three ([4, 6, 8] or [2, 3, 5]), and the longest decreasing subsequence of S has length five
([9, 7, 4, 2, 1] or [9, 7, 6, 2, 1]).

And if we have the sequence S = [531, 339, 298, 247, 246, 195, 104, 73, 52, 31], then the length of the longest
increasing subsequence is 1 and the length of the longest decreasing subsequence is 10.

(a) Find a sequence with nine distinct integers for which the length of the longest increasing subse-
quence is 3, and the length of the longest decreasing subsequence is 3. Briefly explain how you
constructed your sequence.

(b) For each integer k in the sequence you found in part (a), define the ordered pair (x(k), y(k)), where
x(k) is the length of the longest increasing subsequence beginning with k, and y(k) is the length
of the longest decreasing subsequence beginning with k. You should notice that each of your nine
ordered pairs is different. Explain why this is not a coincidence, i.e., why it is impossible for two
different numbers in your sequence to be represented by the same ordered pair (x(k), y(k)).

(c) Determine an integer N for which the following statement is true: given any sequence of N distinct
integers, there must exist an increasing subsequence of length 6 or a decreasing subsequence of
length 10. Prove your claim. The lower your value of N , the more points you will receive.

You might also like