Skip to main content

Probability Riddle Using Python: Converting Temperature From Celsius to Fahrenheit

 Riddle:

A 2-digit street temperature display flashes back and forth between temperature in degrees Fahrenheit and degrees Centigrade (Celsius). Suppose that over a course of a week in summer, the temperature was uniformly distributed between 15°C and 25°C. What is the probability that, at any given time, the rounded value in degrees F of the converted temperature (from degrees C) is not the same as the value obtained by first rounding the temprature in degrees C, then converting to degrees F, then rounding once more.


Python Solution:



Riddle source:

https://www.cut-the-knot.org/Probability/ConvertingTemperature.shtml