Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Python-StairDiceProblem.py #27

Merged
merged 1 commit into from
Oct 11, 2020

Conversation

Ishaan0905
Copy link
Contributor

Problem:
A dice with numbers 1 to 6 is rolled 100 times. A person is climbing stairs as per these rules:

  • If number 1 or 2 comes, he steps down by 1 step
  • If number 3, 4 or 5 comes, he steps up by 1 step
  • If 6 comes, he rolls again and steps up by the number shown on the dice
    There is less than 1% chance that he may fall and begins from 0 again.

Find the % of chance of him reaching above step 60 after 100 rolls

Solution:
Ideally, it requires infinite iterations as test data, but we take 50,000 iterations max so that it runs easily. User can decide number of iterations upto 50,000 and run the program to find out the percentage

@Ishaan0905
Copy link
Contributor Author

#1

@Harshita-Kanal Harshita-Kanal merged commit 8363de2 into Harshita-Kanal:master Oct 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants