NursingLottery2.docx

advertisement
Nursing Lottery 2
May, 2014
Installation
Copy the files below to some convenient place. No special installation is needed.
This program is provided with these files:
1. NursingLottery2.docx: Documentation (This file)
2. NursingLottery2.pdf: Documentation in PDF format.
3. NursingLottery2.java: Source Code: should be available for inspection so anyone can see that
the program is fair and has no hidden “trapdoors”.
4. NursingLottery2.jar: The executable file. The “jar” format is the java equivalent of “exe” files on
Windows, and can run on Windows, Mac, or Linux systems.
5. Sample Lottery Worksheet.xlsx: This is a sample worksheet that can be used to generate up file
for input to the lottery program.
Preparing the data
Start with the sample worksheet “Sample Lottery Worksheet.xlsx”. Make a copy of it (with a name like
“LotterySummer2014.xls”).
The second sheet in the worksheet contains weights for various factors. You can edit these numbers.
Import your students and their grades in the required classes as shown. Enter their TEAS scores, the
number of times they’ve retaken the courses for which you want to penalize retakes, their Health Care
Experience, Credits taken at TCC, and Military Service information. The system will ensure that only
students eligible by their grades and TEAS scores get in the lottery. You will need to make sure the
formulas in row 4 are replicated down for all students. You need to do this in column B (the overall
weight), and columns Q-AB. The spreadsheet has a second sheet titled “Edit Bonus Points for Factors”,
where you can set the weights for the topics.
February 2014
Nursing Lottery 2
p. 1 of 6
When you have the spreadsheet looking the way you want on the first “Test Weighted Lottery
Worksheet” sheet, make sure you have good Weight values for each student. You can save your
worksheet and then export it as a “.csv” file. The exported file will have the same name with the .csv
extension (“LotterySummer2014.csv”), and it will be ready to input into the lottery program.
Running the program
Double-click on the icon representing the “jar” file.
That should result in a screen like:
February 2014
Nursing Lottery 2
p. 2 of 6
Navigate to the pre-prepared input file with the “…” button and click “Open”. This will result in the file
name (with directory) information to be put in the text box as shown.
Then press the “Read File” button.
The window will now look like:
You can scroll through the text box on the right, on camera, to show that all IDs are available, and what
their weights are.
Roll the dice twice, and record the values on the dice in the six text boxes. The program will not enforce
the allowed values; they are just there to remind you about the kinds of dice you are using.
February 2014
Nursing Lottery 2
p. 3 of 6
The following screen assumes that 12 came up on the first die, 80 on the second, and 1 on the third, but
on the second roll, 17 came up on the first die, 00 on the second, and 7 on the third.
Press “Perform the Lottery” after the numbers have been entered.
The screen will now look like:
You can scroll through the text window to show all the results. All of the text in the window is copied to
the output file, shown on the screen. It will be in the same folder as the input file, with the same name,
February 2014
Nursing Lottery 2
p. 4 of 6
except “-Lottery Results.csv” at the end of the file. This file can be edited and published; it is your
lottery results.
Configuring different dice
If you click the “Configure Dice” button, you will be given the opportunity to enter colors and number
ranges for three dice. Good practice would be to have three dice of different colors, and “gaming” dice
give the system more credibility. I’ve set up the program to default to a green dice with numbers 1..31,
a white die with numbers 00,10,20,…90, and a blue die with numbers 1,2,3,…9. If you enter the word
“reset” in place of the color for die1, the defaults are reset.
Ensuring transparency and fairness
The sample spreadsheet, the program .jar file, and the program source code file should all be published
on a website where prospective students can download and inspect them. They will be able to see how
weights are calculated by entering their own actual and projected numbers into the spreadsheet. They
will be able to see that identical dice rolls give identical lottery results. Having the process video
recorded is a good idea. The program shows the date and time of the dice roll. It is a good idea to time
the recording at a pre-announced time, lest any student charge that we re-rolled the dice until we got
certain students in or out.
How the lottery works
We begin by putting all students in a list of “candidates”, and start with an empty list of “winners”. All
students will eventually be moved from the “candidates” list to the “winners” list, but the order in the
“winners” list will control which students actually get into the program, starting with the first “winner”,
then the second, until all of the available slots are taken up. In the lotteries we’ve done in the past, we
usually ended up taking about the first 30 students in the list. If a student “wins” the lottery and is
chosen, and the student for some reason can’t take the position, we just take the next student in the
sorted list.
If there are, say, 200 students in the lottery, there are actually 199 “drawings”.
For each stage of the drawing:
1. Add up all the weight numbers of the students in the current “candidate” list to get a total
weight.
2. Each student is assigned a probability of being selected at this stage: (the student’s weight)/(the
total of all the weights)
3. The sum total of all the students’ probabilities is 100%.
4. A random number is generated, and used to select one student using the weights.
5. The selected student is moved from the list of “candidates” to the next position in the list of
“winners”
6. The lottery drawing is now repeated with one fewer students.
7. Finally, the very last student goes at the end of the list of “winners”.
February 2014
Nursing Lottery 2
p. 5 of 6
So, at each drawing stage, a student with, say 120 points, has twice as much chance of being selected as
a student with only 60 points. And six times as much chance as a student with only 20 points. If the
total number of points at some late stage is, for example 120, and a student has 60 points, that student
has a 50-50 chance of being selected at this stage. If this student isn’t selected at this stage, this student
will have more than a 50% chance of being selected at the next stage. As long as a student has more
than zero “points”, the student has a chance of being selected. If all students enter the lottery with
exactly the same number of points, the lottery operates just like the previous lottery system: each
student has exactly the same chance as any other student.
Perhaps a picture will help. To keep it simple, let’s say we have 5 students at this stage:
Al with 80 points
Bea with 62 points
Carla with 67 points
Doug with 110 points
Ed with 120 points
The total number of points is 439
Al’s probability of being selected at this stage is 80/439, or about 18.2%.
At this stage, a random number is chosen in the range of 0-439. Assume it comes up as 172. That
number is in “Carla’s box” (which runs from 142 to 209), and Carla is chosen as the next student to be
moved from “candidates” to “winners”. Now there are only four students left, with a total of 372
points. In the next stage, a number between 0 and 372 is generated, the picture is adjusted without
Carla, and the next student is chosen. This repeats until all students have been moved from
“candidates” to “winners”.
February 2014
Nursing Lottery 2
p. 6 of 6
Download