lab 9 numpy arrays
Background
- In a modified game of Yahtzee, five eight-sided dice are rolled once.
- For this assignment, you will simulate this modified game of Yahtzee to determine how likely certain outcomes are.
- In this modified version of Yahtzee, a Low Roll occurs when each of the five dice is either a 1 or an 2. For example, 1-1-1-1-1 or 2-2-1-2-1.
- In this modified version of Yahtzee, a Three of a Kind occurs when three of the dice show the same number. The other two dice must not show this number and must also be different from one another. For example, 4-7-4-4-2 but not 4-7-4-4-7.
- In this modified version of Yahtzee, a large straight occurs when the five numbers can be arranged consecutively (for example, 1-3-4-2-5 or 5-7-4-6-3). Hint: the numpy library contains a sort function.
Assignment
- Download lab9.py (below) rename it according to the instructions above, and make sure you understand it.
- Take the program above and modify it by adding the missing methods such that when the program is run, it might produce the output below. Do not change any of the existing Python code (except to learn it — if you do, change it back).
Grading – 10 points
- 3 points – Low Rolls are identified correctly.
- 3 points – Three of a Kinds are identified correctly.
- 4 points – Large straights are identified correctly.
Sample Transcripts
Below are a few runs of the program. Notice it can vary a bit from run to run, but with a sample size as large as 20,000, it tends to be fairly close…
>>>
= RESTART: /Users/danieldefrance/Google Drive/CSCI/Courses/04_2020S/127/Assignments/lab09/Daniel-DeFrance-Lab09.py
Number of Rolls: 20000
---------------------
Number of Low Rolls: 15
Percent: 0.07%
Number of Three of a Kinds: 2384
Percent: 11.92%
Number of Large Straights: 331
Percent: 1.66%
>>>
= RESTART: /Users/danieldefrance/Google Drive/CSCI/Courses/04_2020S/127/Assignments/lab09/Daniel-DeFrance-Lab09.py
Number of Rolls: 20000
---------------------
Number of Low Rolls: 17
Percent: 0.09%
Number of Three of a Kinds: 2404
Percent: 12.02%
Number of Large Straights: 316
Percent: 1.58%
>>>
= RESTART: /Users/danieldefrance/Google Drive/CSCI/Courses/04_2020S/127/Assignments/lab09/Daniel-DeFrance-Lab09.py
Number of Rolls: 20000
---------------------
Number of Low Rolls: 17
Percent: 0.09%
Number of Three of a Kinds: 2374
Percent: 11.87%
Number of Large Straights: 286_x000D_ _x000D_ Percent: 1.43%
#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper
#Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational
