Skip to content

Instantly share code, notes, and snippets.

@realmonster
Created June 18, 2020 13:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save realmonster/44aefe5037ea2b2a27504241118e0f11 to your computer and use it in GitHub Desktop.
Save realmonster/44aefe5037ea2b2a27504241118e0f11 to your computer and use it in GitHub Desktop.
E(0)=1/2(1+E(1))+1/2(1+E(0))
E(1)=1/2(1+E(0))+1/2(1+E(2))
E(2)=1/2(1+E(0))+1/2(1+E(3))
E(3)=1/2(1+E(0))+1/2(1+E(4))
E(4)=1/2(1+E(4))+1/2(1+E(5))
E(5)=1/2(1+E(1))+1/2(1+E(6))
E(6)=1/2(1+E(1))+1/2(1+E(7))
E(7)=1/2(1+E(1))+1/2(1+E(8))
E(8)=0
E(7)=1/2(1+E(1))+1/2(1) = 1+1/2 E(1)
E(6)=1/2(1+E(1))+1/2(1 + 1 + 1/2 E(1))
E(6)=1+1/2+(1/2+1/4)E(1)
E(5)=1/2(1+E(1))+1/2(1+1+1/2+(1/2+1/4)E(1))
E(5)=1+1/2+1/4+(1/2+1/4+1/8)E(1) = 7/4 + 7/8 E(1)
E(4)=1/2+1/2 E(4)+1/2+1/2 E(5) = 1 + 1/2(E(4)+E(5))
E(4)(1-1/2)= = 1 + 1/2 E(5)
E(4) = 2+E(5)
E(3)=1/2(1+E(0))+1/2(1+2+E(5))
E(3)=1/2(1+E(0))+1/2(1+2+E(5)) = 2+1/2 E(0)+1/2E(5)
E(2)=1/2(1+E(0))+1/2(1+2+1/2 E(0)+1/2E(5))
E(2)=2+3/4 E(0)+1/4 E(5)
E(1)=1/2(1+E(0))+1/2(1+2+3/4 E(0)+1/4 E(5))
E(1)=2+7/8 E(0)+1/8 E(5)
E(1)=2+7/8 E(0)+1/8 (7/4 + 7/8 E(1))
E(1)=71/32+7/8 E(0)+7/64 E(1)
E(1)(1-7/64)=71/32+7/8 E(0)+7/64 E(1)
2*(1/2 E(0)-1)(1-7/64)=71/32+7/8 E(0)
(E(0)-2)-(E(0)-2)(7/64)=71/32+7/8 E(0)
E(0)(1-7/64-7/8)=2-7/32+71/32
E(0) =(64-7+71)/(32*(1-7/64-7/8))
E(0) =(128)/(32*(64-7-56)/64)
E(0) =(128)/(32/64) = 256
// five heads and five tails
E'(5)=1/2(1+E'(1))+1/2(1+7/4+7/8 E'(1))
E'(5)=15/8+15/16 E'(1)
E'(1)=1/2(1+E'(0))+1/2(1+2+7/8 E'(0)+1/8 E'(5))
E'(1)=2+15/16 E'(0)+1/16 E'(5)
E'(1)=2+15/16 E'(0)+1/16 (15/8+15/16 E'(1))
E'(1)=2+15/16 E'(0)+15/128+15/256 E'(1)
E'(1)(1-15/256)=2+15/16 E'(0)+15/128
2*(1/2 E'(0)-1)(1-15/256)=2+15/16 E'(0)+15/128
E'(0)(241-15*16)/256=(256+15+241)/128
E'(0)=1024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment