SlideShare uma empresa Scribd logo
1 de 1
Baixar para ler offline
Python: ** Question 1, 2, and 3 please ** Question 1: Define a function called
simulate_one_trial which simulates rolling a die num_rolls times and sum the total numbers she
gets. (2 Points) def simulate_one_trial(num_rolls): total_score = simulate_one_trial (1000)
total_score 1 Question 2: Calling the above function is considered one experiment. Write code to
repeat that experiment 10,000 times and save all outcomes in an array called outcomes. (4
Points) repetitions =10000 num_rolls =1000 outcomes = outcomes grader.check ( "q 42)
Question 3: Draw a histogram for the above outcomes using bins of width 5 in the range 3400
and 3600 . (2 Points)

Mais conteúdo relacionado

Mais de alsofshionchennai

Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdf
Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdfProject ScenarioPecos Company acquired 100 percent of Suaros outs.pdf
Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdfalsofshionchennai
 
Professor Jones is very particular when it comes to his morning coff.pdf
Professor Jones is very particular when it comes to his morning coff.pdfProfessor Jones is very particular when it comes to his morning coff.pdf
Professor Jones is very particular when it comes to his morning coff.pdfalsofshionchennai
 
Program Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdfProgram Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdfalsofshionchennai
 
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdf
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdfProductos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdf
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdfalsofshionchennai
 
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdf
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdfP�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdf
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdfalsofshionchennai
 
Q1.7. What would happen if you could magically turn off decompositio.pdf
Q1.7. What would happen if you could magically turn off decompositio.pdfQ1.7. What would happen if you could magically turn off decompositio.pdf
Q1.7. What would happen if you could magically turn off decompositio.pdfalsofshionchennai
 
Progressive Corporation (a property and casualty insurance company) .pdf
Progressive Corporation (a property and casualty insurance company) .pdfProgressive Corporation (a property and casualty insurance company) .pdf
Progressive Corporation (a property and casualty insurance company) .pdfalsofshionchennai
 
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdf
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdfQ1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdf
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdfalsofshionchennai
 
Q1. part A. can we use if statement and skip else part(ye.pdf
Q1. part A. can we use if statement and skip else part(ye.pdfQ1. part A. can we use if statement and skip else part(ye.pdf
Q1. part A. can we use if statement and skip else part(ye.pdfalsofshionchennai
 
Q1. Fiscal policy is often focused on replacing spending that is no.pdf
Q1.  Fiscal policy is often focused on replacing spending that is no.pdfQ1.  Fiscal policy is often focused on replacing spending that is no.pdf
Q1. Fiscal policy is often focused on replacing spending that is no.pdfalsofshionchennai
 
Q1 Which of the following would be considered a transport epithelium.pdf
Q1 Which of the following would be considered a transport epithelium.pdfQ1 Which of the following would be considered a transport epithelium.pdf
Q1 Which of the following would be considered a transport epithelium.pdfalsofshionchennai
 
Q1 Find two thoracic vertebrae that fit together and identify .pdf
Q1 Find two thoracic vertebrae that fit together and identify .pdfQ1 Find two thoracic vertebrae that fit together and identify .pdf
Q1 Find two thoracic vertebrae that fit together and identify .pdfalsofshionchennai
 
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdf
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdfQ-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdf
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdfalsofshionchennai
 
Q1 Write an MPI program that can measure the time for sending and r.pdf
Q1 Write an MPI program that can measure the time for sending and r.pdfQ1 Write an MPI program that can measure the time for sending and r.pdf
Q1 Write an MPI program that can measure the time for sending and r.pdfalsofshionchennai
 
Q1 Choose only three of the following theories and provide proof..pdf
Q1 Choose only three of the following theories and provide proof..pdfQ1 Choose only three of the following theories and provide proof..pdf
Q1 Choose only three of the following theories and provide proof..pdfalsofshionchennai
 
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdf
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdfP[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdf
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdfalsofshionchennai
 
Q Differentiate between data, information, and knowledge.pdf
Q Differentiate between data, information, and knowledge.pdfQ Differentiate between data, information, and knowledge.pdf
Q Differentiate between data, information, and knowledge.pdfalsofshionchennai
 
Python programUse this list of friends and agesFriends = [ St.pdf
Python programUse this list of friends and agesFriends = [ St.pdfPython programUse this list of friends and agesFriends = [ St.pdf
Python programUse this list of friends and agesFriends = [ St.pdfalsofshionchennai
 
PYTHON ONLY Define a function named swap_values that takes four inte.pdf
PYTHON ONLY Define a function named swap_values that takes four inte.pdfPYTHON ONLY Define a function named swap_values that takes four inte.pdf
PYTHON ONLY Define a function named swap_values that takes four inte.pdfalsofshionchennai
 
Python code for this linear regression. yihat is in a matrix Yhat, a.pdf
Python code for this linear regression. yihat is in a matrix Yhat, a.pdfPython code for this linear regression. yihat is in a matrix Yhat, a.pdf
Python code for this linear regression. yihat is in a matrix Yhat, a.pdfalsofshionchennai
 

Mais de alsofshionchennai (20)

Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdf
Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdfProject ScenarioPecos Company acquired 100 percent of Suaros outs.pdf
Project ScenarioPecos Company acquired 100 percent of Suaros outs.pdf
 
Professor Jones is very particular when it comes to his morning coff.pdf
Professor Jones is very particular when it comes to his morning coff.pdfProfessor Jones is very particular when it comes to his morning coff.pdf
Professor Jones is very particular when it comes to his morning coff.pdf
 
Program Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdfProgram Specifications ( please show full working code that builds s.pdf
Program Specifications ( please show full working code that builds s.pdf
 
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdf
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdfProductos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdf
Productos m�dicos de Penner El lunes 14 de abril, Neil Bennett, Ge.pdf
 
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdf
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdfP�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdf
P�Pa+Ba Hice bit Holndsiteur soors places at Non bed.pdf
 
Q1.7. What would happen if you could magically turn off decompositio.pdf
Q1.7. What would happen if you could magically turn off decompositio.pdfQ1.7. What would happen if you could magically turn off decompositio.pdf
Q1.7. What would happen if you could magically turn off decompositio.pdf
 
Progressive Corporation (a property and casualty insurance company) .pdf
Progressive Corporation (a property and casualty insurance company) .pdfProgressive Corporation (a property and casualty insurance company) .pdf
Progressive Corporation (a property and casualty insurance company) .pdf
 
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdf
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdfQ1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdf
Q1. (a) Briefly introduce how Force-directed algorithms encode netwo.pdf
 
Q1. part A. can we use if statement and skip else part(ye.pdf
Q1. part A. can we use if statement and skip else part(ye.pdfQ1. part A. can we use if statement and skip else part(ye.pdf
Q1. part A. can we use if statement and skip else part(ye.pdf
 
Q1. Fiscal policy is often focused on replacing spending that is no.pdf
Q1.  Fiscal policy is often focused on replacing spending that is no.pdfQ1.  Fiscal policy is often focused on replacing spending that is no.pdf
Q1. Fiscal policy is often focused on replacing spending that is no.pdf
 
Q1 Which of the following would be considered a transport epithelium.pdf
Q1 Which of the following would be considered a transport epithelium.pdfQ1 Which of the following would be considered a transport epithelium.pdf
Q1 Which of the following would be considered a transport epithelium.pdf
 
Q1 Find two thoracic vertebrae that fit together and identify .pdf
Q1 Find two thoracic vertebrae that fit together and identify .pdfQ1 Find two thoracic vertebrae that fit together and identify .pdf
Q1 Find two thoracic vertebrae that fit together and identify .pdf
 
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdf
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdfQ-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdf
Q-1. �El FMI a menudo es visto como el prestamista de �ltimo recurso.pdf
 
Q1 Write an MPI program that can measure the time for sending and r.pdf
Q1 Write an MPI program that can measure the time for sending and r.pdfQ1 Write an MPI program that can measure the time for sending and r.pdf
Q1 Write an MPI program that can measure the time for sending and r.pdf
 
Q1 Choose only three of the following theories and provide proof..pdf
Q1 Choose only three of the following theories and provide proof..pdfQ1 Choose only three of the following theories and provide proof..pdf
Q1 Choose only three of the following theories and provide proof..pdf
 
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdf
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdfP[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdf
P[Y1] (b) P[Y1] (d) P[Y2] (f) P[Y=3].pdf
 
Q Differentiate between data, information, and knowledge.pdf
Q Differentiate between data, information, and knowledge.pdfQ Differentiate between data, information, and knowledge.pdf
Q Differentiate between data, information, and knowledge.pdf
 
Python programUse this list of friends and agesFriends = [ St.pdf
Python programUse this list of friends and agesFriends = [ St.pdfPython programUse this list of friends and agesFriends = [ St.pdf
Python programUse this list of friends and agesFriends = [ St.pdf
 
PYTHON ONLY Define a function named swap_values that takes four inte.pdf
PYTHON ONLY Define a function named swap_values that takes four inte.pdfPYTHON ONLY Define a function named swap_values that takes four inte.pdf
PYTHON ONLY Define a function named swap_values that takes four inte.pdf
 
Python code for this linear regression. yihat is in a matrix Yhat, a.pdf
Python code for this linear regression. yihat is in a matrix Yhat, a.pdfPython code for this linear regression. yihat is in a matrix Yhat, a.pdf
Python code for this linear regression. yihat is in a matrix Yhat, a.pdf
 

Último

Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991RKavithamani
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...RKavithamani
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Último (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
Industrial Policy - 1948, 1956, 1973, 1977, 1980, 1991
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
Privatization and Disinvestment - Meaning, Objectives, Advantages and Disadva...
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Python Question 1, 2, and 3 please Question 1 Define a func.pdf

  • 1. Python: ** Question 1, 2, and 3 please ** Question 1: Define a function called simulate_one_trial which simulates rolling a die num_rolls times and sum the total numbers she gets. (2 Points) def simulate_one_trial(num_rolls): total_score = simulate_one_trial (1000) total_score 1 Question 2: Calling the above function is considered one experiment. Write code to repeat that experiment 10,000 times and save all outcomes in an array called outcomes. (4 Points) repetitions =10000 num_rolls =1000 outcomes = outcomes grader.check ( "q 42) Question 3: Draw a histogram for the above outcomes using bins of width 5 in the range 3400 and 3600 . (2 Points)