Compose a Python program to simulate the process and calculate
the probability of the frog survives this challenge. The program
MUST follow the following rules and settings:
There are three lanes, crossing each lane is independent of each
other.
The simulation should prompt users to enter the number of
runs
The survival of the frog depends on the density of the lane, for
example, 0 means there is no vehicle on the lane, 1 means the lane
is 100% occupied. The density of each lane for each run follows the
outcome of random function which is greater than or equal to 0 and
less than 1
The frog will live if the density of the lane is less than
25
The program will first prompt and allow users to enter the
number of runs and then report the probability of survival
Compose a Python program to simulate the process and calculate the probability of the frog survives this challenge. The
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Compose a Python program to simulate the process and calculate the probability of the frog survives this challenge. The
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!