Given $a$ apples and $b$ mangoes, where $a$ and $b$ can be non negative numbers, we can convert one apple to mango or vice versa in one move. What is the expected number of moves after which only one kind of fruit will be left, i.e, one of the following condition satisfies:
- #apples = $a$+$b$ and #mangoes = 0
- #apples = 0 and #mangoes = $a$+$b$
My attempt: I thought of recurrence relation $E(a,b) = 1 + \tfrac12 E(a-1,b+1) + \tfrac12 E(a+1,b-1)$ (thanks @henry for correcting it) but could not moved further from this. Also, I thought that expected number of moves will only depend on max($a$,$b$). I am not sure but I have strong intuition that this is correct.
Question Link: https://my.newtonschool.co/playground/code/crm33y2jcf/