case 1:
state f(x):  x new cards, C-x old cards
//meaning: piles needed to collect another x new cards
f(x) = 1+sum((x,i)*(C-x,N-i)/(C,N))*f(x-i)
=> fetch i from x new; fetch N-i from C-x old

case 2:
state f(x):  x old cards, C-x new cards
//meaning: piles needed to collect x cards, among with i cards are
newly collected (0<=i<=N)
f(x) = 1+sum((C-x+i,i)*(x-i,N-i)/(C,N))*f(x-i)
=> fetch i from C-x+i new; fetch N-i from x-i old
f(C) = 1+sum((C-x+i,i)*(x-i,N-i)/(C,N))*f(x-i)
+(C,N)/(C,N)*f(C)  //i=0, x=C

For case 1, f(0) is simply 0.
But for case 2, f(C) is cancled out. It cannot be calculated.

I doubt if I missed something, but I cannot find out.
If it's correct and only case 1 is valid, how to avoid such kind of
traps?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-codejam" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-code?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to