Summing the log of the count is equivalent to multiplying them, I was using 
Long and not BigInt, It is conceivable there was a simple numeric overflow.
  
On Monday, April 29, 2013 4:37:09 AM UTC+3, Nate Bauernfeind wrote:
> A correct answer I read through was very similar and I tried rewriting it in 
> a way that was more intuitive to me.
> 
> I tried to build a probability of the choices by multiplying the probability 
> of the chance you saw k for each k and the probability it was that 
> combination of numbers (taking into account duplicate arrangements basically 
> n! / n2! / n3! / n4! ... etc
> 
> That doesn't pass for some reason, but intuitively I would expect more 
> probable choices to have higher probability of happening.
> 
> Then I tried simply summing them thinking maybe the value is too small to 
> compare. But still wrong answer.
> 
> The solution I looked at summed the log of the count. It works but I can't 
> explain why. Because I would expect this just to be another way to do the 
> same thing we both tried.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-code/-/_9E8S-XFlnQJ.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to