Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Sounds similar to the problem below?
Great Kata. Tried 4 different methods befoew hitting on a satisfactory solution.
I could only get this to work for all attempt by assuming the winners gets 50% or more of the votes, not more than 50%
I have a feeling I am missing something in the explantion. All the test cases work fine, but when I run on random inputs I sometimes get failures when replace is False. So let me talk you through my understanding of one test case (w/o showing the code) (... and as you will see I am not a mathematician so I need dummies guide as explantions!)
The input is [['red', 'yellow', 'red', 'yellow', 'yellow', 'blue', 'red', 'yellow', 'green', 'blue', 'blue', 'green', 'red', 'yellow', 'yellow', 'green', 'yellow', 'blue'], ['blue', 'red'], False]
So I have 18 balls, 4 of which are blue, so P(b) = 4/18 = 0.222....
Since I don't replace the blue that I drew on the first round, I now have only 17 balls, 4 of which are red, so P(r) = 4/17 = 0.235...
So P(b,r,False) = 0.222x0.235 = 0.052, but according to the test, the probablity should be 0.037
Now - where is the flaw? I was hoping writing this would lead me to enightenment, but not the case this time...
This comment is hidden because it contains spoiler information about the solution
I think there is a problem with this kata; getting the examples working is fine but when you randomly get pass and fail on the attempts, there is something wrong.
This comment is hidden because it contains spoiler information about the solution