The Most Frequently Drawn Powerball Numbers Powerball (is a Lottery game) and balls are numbered from 1-26. We just have to use the ones that I highlighted in Yellow. The two other numbers above 26 (27 & 31) will automatically have a probability of Zero. Powerball How often 1 4 2 4 3 3 4 7 5 8 69 4 7 3 8 4 9 6 10 3 11 2 12 3 13 3 14 5 15 16 2 5 17 2 18 4 19 3 20 4 21 8 22 1 23 5 24 1 25 2 26 4 Examples of how outlook should look: Probabilities of Most Common Numbers Winning Powerball: Probability of number 21 being a winning Powerball number: 0.0800 Probability of number 25 being a winning Powerball number: 0.0200 Probability of number 18 being a winning Powerball number: 0.0400 Number 17 s prodautttty of wanting ts 0.02 01 0.3130017 Number 27's probability of winning is Number 31's probability of winning is because it is not a powerball number. because it is not a powerball number. "How Often means the number of times that specific powerball has won" Question - Edit the given Python Code so it can do the Following Task: a. Utilizing the 7 Most Common Numbers the code has already generated. Look at the 'Powerball' chart and find probability of each of the Yellow Highlighted numbers being a winning Powerball Number (Each of the highlighted numbers in the Powerball Column are actually five of the seven "most Common Numbers" the code had previously outputted. The probability of two other numbers not included in the chart (27 and 31) should also be outputted (even though it is 0, due to Powerballs only going from 1-26). Find the probability of the 7 Most Common Numbers Being the Winning Number For the Powerball: 17, 18, 20, 21, 25, 27, 31 Hint: To find the probability of the 7 numbers, (Ex. Powerball 21 has won 8 times. All the how often column numbers add up to 100, so the probability for 21 would be 8/100 which is 0.08

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Edit the given Python Code (about Probability) so it can do the Additional Task. Please see the attached pics to complete it. 
Code that Needs to be Edited:

from collections import Counter
from scipy.stats import binom

# Part A: Find the 7 most common repetitive numbers
number_list = [25, 23, 17, 25, 48, 34, 29, 34, 38, 42, 30, 50, 58, 36, 39, 28, 27, 35, 30, 34, 46, 46, 39, 51, 46, 75, 66, 20, 45, 28, 35, 41, 43, 56, 37, 38, 50, 52, 33, 44, 37, 72, 47, 20, 80, 52, 38, 44, 39, 49, 50, 56, 62, 42, 54, 59, 35, 35, 32, 31, 37, 43, 48, 47, 38, 71, 56, 53, 51, 25, 36, 54, 47, 71, 53, 59, 41, 42, 57, 50, 38, 31, 27, 33, 26, 40, 42, 31, 25, 26, 47, 26, 37, 42, 15, 60, 40, 43, 48, 30, 25, 52, 28, 41, 40, 34, 28, 40, 38, 40, 30, 35, 27, 27, 32, 44, 31, 32, 29, 31, 25, 21, 23, 25, 39, 33, 21, 36, 21, 14, 23, 33, 27, 31, 16, 23, 21, 13, 20, 40, 13, 27, 33, 34, 31, 13, 40, 58, 24, 24, 17, 18, 18, 21, 18, 16, 24, 15, 18, 33, 21, 13, 24, 21, 29, 31, 26, 18, 23, 22, 21, 32, 33, 24, 30, 30, 21, 23, 29, 23, 25, 18, 10, 20, 13, 18, 28, 12, 17, 18, 20, 15, 16, 16, 25, 21, 18, 26, 17, 22, 16, 15, 15, 25, 14, 18, 19, 16, 14, 20, 28, 13, 28, 39, 40, 29, 25, 27, 26, 18, 17, 20, 25, 25, 22, 19, 14, 21, 22, 18, 10, 29, 24, 21, 21, 13, 15, 25, 20, 29, 22, 11, 14, 17, 17, 13, 21, 11, 19, 17, 18, 20, 8, 21, 18, 24, 21, 15, 27, 21]
number_count = Counter(number_list)
most_common = number_count.most_common(7)
print("Most Common Numbers:")
for num, count in most_common:
      print(f"Number {num} appears {count} times")

# Part B: Find the 7 most uncommon numbers
least_common = number_count.most_common()[:-8:-1]
print("\nLeast Common Numbers:")
for num, count in least_common:
      print(f"Number {num} appears {count} times")

# Part C: Use binomial distribution to find the probability of each of the 7 common repetitive numbers print("\nProbabilities of Most Common Numbers (Binomial Distribution):")
for num, count in most_common:
      total_trials = len(number_list)
      successes = count
      probability = binom.pmf(successes, total_trials, successes/total_trials)
      print(f"Probability of observing {num} exatly {count} times: {probability:.4f}")

The Most Frequently Drawn Powerball Numbers
Powerball (is a Lottery
game) and balls are
numbered from 1-26.
We just have to use the
ones that I highlighted
in Yellow. The two
other numbers above
26 (27 & 31) will
automatically have a
probability of Zero.
Powerball
How often
1
4
2
4
3
3
4
7
5
8
69
4
7
3
8
4
9
6
10
3
11
2
12
3
13
3
14
5
15
16
2
5
17
2
18
4
19
3
20
4
21
8
22
1
23
5
24
1
25
2
26
4
Examples of how outlook should look:
Probabilities of Most Common Numbers Winning Powerball:
Probability of number 21 being a winning Powerball number: 0.0800
Probability of number 25 being a winning Powerball number: 0.0200
Probability of number 18 being a winning Powerball number: 0.0400
Number 17 s prodautttty of wanting ts 0.02 01 0.3130017
Number 27's probability of winning is
Number 31's probability of winning is
because it is not a powerball number.
because it is not a powerball number.
"How Often means
the number of
times that specific
powerball has
won"
Transcribed Image Text:The Most Frequently Drawn Powerball Numbers Powerball (is a Lottery game) and balls are numbered from 1-26. We just have to use the ones that I highlighted in Yellow. The two other numbers above 26 (27 & 31) will automatically have a probability of Zero. Powerball How often 1 4 2 4 3 3 4 7 5 8 69 4 7 3 8 4 9 6 10 3 11 2 12 3 13 3 14 5 15 16 2 5 17 2 18 4 19 3 20 4 21 8 22 1 23 5 24 1 25 2 26 4 Examples of how outlook should look: Probabilities of Most Common Numbers Winning Powerball: Probability of number 21 being a winning Powerball number: 0.0800 Probability of number 25 being a winning Powerball number: 0.0200 Probability of number 18 being a winning Powerball number: 0.0400 Number 17 s prodautttty of wanting ts 0.02 01 0.3130017 Number 27's probability of winning is Number 31's probability of winning is because it is not a powerball number. because it is not a powerball number. "How Often means the number of times that specific powerball has won"
Question - Edit the given Python Code so it can do the Following Task:
a. Utilizing the 7 Most Common Numbers the code has already generated.
Look at the 'Powerball' chart and find probability of each of the Yellow
Highlighted numbers being a winning Powerball Number (Each of the
highlighted numbers in the Powerball Column are actually five of the seven
"most Common Numbers" the code had previously outputted. The probability
of two other numbers not included in the chart (27 and 31) should also be
outputted (even though it is 0, due to Powerballs only going from 1-26).
Find the probability of the 7 Most Common Numbers Being the Winning
Number For the Powerball: 17, 18, 20, 21, 25, 27, 31
Hint: To find the probability of the 7 numbers, (Ex. Powerball 21 has won 8
times. All the how often column numbers add up to 100, so the probability for 21
would be 8/100 which is 0.08
Transcribed Image Text:Question - Edit the given Python Code so it can do the Following Task: a. Utilizing the 7 Most Common Numbers the code has already generated. Look at the 'Powerball' chart and find probability of each of the Yellow Highlighted numbers being a winning Powerball Number (Each of the highlighted numbers in the Powerball Column are actually five of the seven "most Common Numbers" the code had previously outputted. The probability of two other numbers not included in the chart (27 and 31) should also be outputted (even though it is 0, due to Powerballs only going from 1-26). Find the probability of the 7 Most Common Numbers Being the Winning Number For the Powerball: 17, 18, 20, 21, 25, 27, 31 Hint: To find the probability of the 7 numbers, (Ex. Powerball 21 has won 8 times. All the how often column numbers add up to 100, so the probability for 21 would be 8/100 which is 0.08
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education