# Problem of the DayA new programming or logic puzzle every Mon-Fri

## 100m Dash

A brother and sister run the 100m dash after school to practice for an upcoming track meet. In the first race the sister beats her brother by 5 yards. They decide to race again but to make things more fair the sister then starts 5 yards behind the original starting line and they race again. Assuming the brother and sister run at the same speed as they did during the first race, who wins the second race?

• - 7 years, 11 months ago

If the sister finished the first race in time T seconds(and brother covered 95 meters in T seconds), then with a 5 yard(4.572 meter) head start, the brother finishes the second race in 1.04791 * T seconds. Sister takes 1.04572 * T seconds. So the sister wins, by a fraction.

• Tim at DataRobot - 7 years, 11 months ago

I think Akshay Bist has it correct, although I conceptualized it differently:

If you say that the duration of the first race was one U (a unit of time), then the sister runs 100 meters per U and the brother runs 95 meters per U. One U, 5 meters apart.

If you start the sister 5 meters behind the brother, then one U later the sister will have run the lagged 5 meters, plus 95 meters (a total of 100 meters in one U), and the brother will have run his usual 95 meters in a single U.

At this point, they're both at the 95 meter mark, running a 5 meter race to the finish. And the sister easily outpaces his brother, because she's running faster. The victory goes to her again.

• - 7 years, 11 months ago

Clojure!

``````(defn- yards->meters
[yards]
(/ yards 1.0936))

(defn solution []
(let [brospeed (- 100 (yards->meters 5))
sisspeed 100
brotime (/ 100 brospeed)
sistime (/ (+ 100 (yards->meters 5)) sisspeed)]
(if (< brotime sistime)
:brother
:sister)))

; user=> (solution)
; :sister
``````
• hugo - 7 years, 8 months ago

The sister will outrun the brother with 8.2296 inches. Doen't matter how fast they will run (if 100m/s or 5m/s), as long as they run at a constant speed.

Content curated by @MaxBurstein