Google Doc Access Directions:
● Please click on File in the upper left corner.
● If you are working on a Chromebook or Google Docs, choose the Make a copy option and save
a copy of the document to your Google Drive.
● If not, choose the Download as option and then the Microsoft Word (.docx) option to download
an editable copy of the document to your computer.
Module Six Lesson Three Activity Guide
Directions:
1) Open up the ticket generator widget on Code Studio.
2) Generate a raffle ticket number for yourself. Record it here:
3) Generate ten more raffle ticket numbers. Record each number below:
Raffle Ticket Raffle Ticket
Number: Number:
#1 354 #6 125
#2 15 #7 751
#3 123 #8 288
#4 988 #9 174
#5 594 #10 996
Challenge 1: The Pair Raffle (5 points)
You win if your raffle ticket number, combined with one of the other ten raffle ticket
numbers add up to the winning number.
The winning number is 1000.
See if you’re a part of a winning pair!
Record your results here: N/A
Challenge 2: The Group Raffle (15 points)
You win if your raffle ticket number, combined with any of the other ten raffle ticket
numbers (from one ticket up to all of them) add up to the winning number.
The winning number is 2500.
See if you’re a part of a winning group!
Record your results here: N/A
Which raffle felt like it was more difficult to check? Why? (5 points)
The winning number being 2500 was much more difficult because I had to cycle
through all the numbers and see which one added to 2500, as well as the 2nd
factor that it can be up to all of them, made it really difficult
We could write an algorithm that goes through every possible “check” for the pair raffle
or the group raffle.
Let’s see how many checks there are! Fill in the two tables below.
Pair Raffle
Problem: For the pair raffle every participant gets a random ticket. A winning number is
chosen, also at random. The problem is to determine if any pair of tickets add up to the
winning number.
Example Instances:
● The tickets [108, 442, 913, 5] and a target number
of 500. This instance does not have a winning pair.
● The tickets [250, 20, 4] and the target number 254.
This instance does have a winning pair, 250 and 4.
How Many Checks: Fill in the table below with how many checks are necessary with
different numbers of tickets. It may help to draw pictures and see if you start noticing
any patterns emerge. (20 points - 5 points each)
Tickets Total Checks
How many possible pairs are there?
2 1
3 3
4 6
5 10
8 28
Group Raffle Checks
Problem: For the pair raffle every participant gets a random ticket. A winning number is
chosen, also at random. The problem is to determine if any pair of tickets add up to the
winning number.
Example Instances:
● The tickets [411, 220, 710, 41] and a winning number
of 1000.
This instance does not have a winning group.
● The tickets [110, 923, 475, 301, 102] and the winning
number 1500. This instance does have a winning group, 923, 475, and 101.
How Many Checks: Fill in the table below with how many checks are necessary with
different numbers of tickets. It may help to draw pictures and see if you start noticing
any patterns emerge. (45 points - 15 points each)
Tickets Total Checks
How many possible groups are there?
2 3
3 3
4 6
5 10
Challenge: 8 - 28
10 points extra credit
Now imagine that your school is considering running the group raffle at an upcoming
assembly to give away a prize. Write a brief explanation of what advice you would give
them.(10 points)
First of I would ensure that the process for pairing tickets and checking for winners is quick and
organized. Since testing all the pairs for a large amount of tickets would take an extensive
amount of time, I would make a program that would simply go through the list adding up all the
numbers to the given matched number. My advice would also limit the number of tickets
distributed to avoid any altercations in the program and move fast.