bellsimps7179
23.03.2020 •
Mathematics
A man is standing on an infinite ladder. In one move, he can either go up (with probability 0.5), or stay where he is (with probability 0.5). Please simulate one trip and print out the number of steps the man takes to move 100 steps up from his initial position. Hint: consider using inline if statement
Solved
Show answers
More tips
- L Leisure and Entertainment Unlocking the Secrets of Winning the Lottery...
- S Style and Beauty Ultimate Guide on How to Care for Suede Shoes...
- S Sport Running: How to Do It Right?...
- F Food and Cooking How to Cook Spaghetti Right – Secrets and Tips...
- P Philosophy Personal attitude towards Confession: how to prepare and undergo the procedure correctly?...
- H Health and Medicine Flu: How to Recognize It by the First Symptoms?...
- F Food and Cooking How to Sober Up Quickly? Important Facts and Tips...
- H Health and Medicine How to Properly Take a Blood Sugar Test?...
- H Health and Medicine Simple and Effective: How to Get Rid of Cracked Heels...
- O Other How to Choose the Best Answer to Your Question on The Grand Question ?...
Answers on questions: Mathematics
- M Mathematics What is the answer to: 3.142×4 squared...
- M Mathematics The mass of a small virus is 10-20kg. The mass of an average human cell is 10-kg. Which of the two has a lesser mass? How many times less is it? (SHOW WORK)...
- E English Explain how scout s first day of school develop her character. Use evidence in your answer....
- M Mathematics Amuseum has a famous statue on display. the crater places the statue in the corner of a rectangular room and builds a 15-foot-long railing in front of the statue. using the information...
- M Mathematics About which line should the rectangle A B C D be reflected in order to get to rectangle ABCD?...
- S Social Studies How can discussions, projects, campaigns and events support victims of human right violations.• Express your views on how the law, the citizens and community can...
Ответ:
Pseudo Code:
//Start
//position = 0 #Initial position on the ladder
//steps = 0 #initial moves of the man
//while position <= 100: #the man keeps moving until he moves 100 steps
// if randomint(1, 2) = 1: #this simulates the probability of 0.5
// position = position + 1 #the man only moves up with 0.5 probability
// end if
// steps =steps + 1 #this counts the total moves a man takes
//end while
//output steps #print the number of moves taken
Ответ:
900
Step-by-step explanation:
5 * 180
(5 * 100) + (5 * 80) + (5 * 0)
500 + 400 + 0
900
900