24
Juge Ti
Last seen 7 years ago
Member for 10 years, 8 months, 10 days
Difficulty Normal
You can get the general formula by using your transition matrix :
Let m be the total number of pearls.
Let U(n) be the vector whose kth coordinate is the probability of having k white pearls in the nth step. We have U(n+1) = T * U(n) where T is your transition matrix.
Then the probability p
More
I didn't even know function annotations existed in Python. Actually I didn't know about endswith or float.__mul__ either - seems there's always something to learn in your solutions (I know you like flattery ;)).
More
Hello !
You're no longer alone here ! ;)
Yrf cebtenzzrhef Senapnvf fbag yrf zrvyyrhef !
More
Well, I have to admit that yours is bigger than mine...
And nice score with pep8.py : 2609 errors !
More
I was not satisfied with my very slow first solution, so I wrote a recursive one too.
I tested to see which one is faster, yours or mine : I win 3 to 1 ;)
By the way, thanks for all the cool tasks you propose ! I am having much fun with them !
More
Good evening, my young padawan.
Congratulations for solving this task which is not easy for a beginner. You can give a look at my own solution here : http://www.checkio.org/mission/golden-pyramid/publications/Juge_Ti/python-27/first/
Some comments :
1) There are coding conventions for the Python
More