There is a frog jumping on lily pads labeled with natural numbers. It’s on the 2015th lily pad and can either go one step forward or backwards, except if it at any time is on a lily pad divisible by 6 it has to go forward. How many 15-steps paths are possible? The problem is […]
Category: PyChallenges
A Very Notorious Problem, But In 3D
I’ve already made an article on the 2D version of this problem, if you want to check it out before this one, you can visit https://www.mattiagiuri.com/2020/04/21/a-very-notorious-problem/. Now, the 3D version says: if you have 3 reals x, y, z chosen randomly between 0 and 1, what’s the probability that It’s important to notice that any […]
A Very Notorious Problem
One very famous programming challenge is: given a function which generates a random real number in the interval [0,1], calculate the value of pi. At first glance, it could seem that it could seem that the data and the request are completely different, but with a little math trick we can actually compute the value […]