Skip to content

9KelvinN/YSP-Probability-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

YSP-Probability-Project

This project solved the Bicycle Leapfrog problem

Problem Description

Two friends want to travel to a place 20 miles away, but they only have one bicycle between them. Either can walk at 2 miles an hour, or ride the bicycle at 10 miles an hour. They decide to proceed as follows: the first will start by walking, while the second rides the bicycle. After a little while, the one riding will stop, leave the bicycle by the side of the road, and continue on by walking. When the original walker reaches the waiting bicycle, they will start riding, and continue until they’ve caught up and gone a little ways past the now-walker. Then, the bicycle again gets left for the one trailing behind. They continue in this leapfrog fashion until they’ve both arrived at their destination. If they want to arrive as quickly as possible, does it matter how frequently they make the bicycle exchange? Simulate this with different possible distributions of how far they go each time they ride past each other. What happens if the two of them have different walking speeds, or different riding speeds?

Inputs

  • The walking and biking speeds of friend 1 and 2
  • The stopping distance

Outputs

  • The optimal switching point
  • Plot of the stopping point vs finishing time using MatPlotLib

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages