How do I convert an int to an array?

Hi!

Thank you for the neat code! Yup I think the value slightly changes because of the very good random-number generator in Julia.

But to get the ‘classical’ probability value I think a slightly longer code, like counting all the proportions would always give the same value…but I think it does not justify writing triple the amount of code just to get the same value each time.

Even Project Euler got it wrong in that true probabilistic outcomes solved by programming languages are always empirical and subject to some variation in the decimals.

I ran your code on 1 billion iterations for a time of 105 seconds–not bad–but the value is still:

0.573153872

Still, it makes for an interesting exercise. I spent a better part of the day trying to see if I could use binomial expansion to count all the proportions, but I am newbie to both probability and Julia, so still investigating…(it is surprising how poorly-written most probability texts are).

The solutions posted by all other people on Project Euler–frankly–were not impressive. The code is not readable, and most of the solutions at least double and in most cases triple the amount of code I have. They also use C++/Java which I really dislike, and the Python ones were also quite a mess. (no wonder I am here on Julia discourse).

Best,