12585 — Poker End Games

Revision en1, by rasen__shuriken, 2019-09-21 16:58:17

Problem : Uva 12585

Lets say Alice has $a and Bob has $b, let c = min(a,b). In every round they will bet $c, whoever wins the round get $c . The game stops when Alice or Bob has no money to play. we have to find the expected number of rounds will be played for given a and b.

My Idea was to find answer for DP[a][b]=0.5*(DP[a+c][b-c] + 1)+ 0.5*(DP[a-c][b+c] +1 ).But as we see if a!=b , there always will be cycle. I need help to eliminate this cycle.

TIA

Tags #probabilities, expectation value, #dynamic programing

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English rasen__shuriken 2019-09-21 16:58:17 583 Initial revision (published)