Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

python help please Coin Toss Program Write a well-documented Python program, hmwk5Q3.py, to simulate playing a game where a US penny (radius of 3/8 inches)

python help please
image text in transcribed
Coin Toss Program Write a well-documented Python program, hmwk5Q3.py, to simulate playing a game where a US penny (radius of 3/8 inches) is tossed into a board with a 1-inch by 1-inch square. The player wins only if the penny lands entirely within the square. Estimate the probability of winning by repeating the game 10,000 times. Record the estimate of the winning chance as a comment. Your program calculates the winning probability by taking the number of wins in the simulation and dividing it by the number of trials. Hints: Import the random module and use the function random() twice to simulate where the center of the coin lands in the x and y dimensions. Grading: Correct main (+4 points). Correct if statement construction (one) (4 points). Correct estimate for the winning probability (+2 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

Discuss the Hawthorne experiments in detail

Answered: 1 week ago

Question

Explain the characteristics of a good system of control

Answered: 1 week ago

Question

State the importance of control

Answered: 1 week ago

Question

What are the functions of top management?

Answered: 1 week ago

Question

13-4 What are alternative methods for building information systems?

Answered: 1 week ago