Skip to content

Instantly share code, notes, and snippets.

View paulhankin's full-sized avatar

Paul Hankin paulhankin

View GitHub Profile
@paulhankin
paulhankin / gist:2a05abd22be59bfb8268
Last active August 29, 2015 14:21
Full closed-hand Chinese poker data
front
0.11 : 4-3-2
0.19 : 5-3-2
0.24 : 5-4-2
0.30 : 5-4-3
0.41 : 6-3-2
0.48 : 6-4-2
0.56 : 6-4-3
0.61 : 6-5-2
0.69 : 6-5-3
@paulhankin
paulhankin / gist:2d4d39428214ed36b478
Created May 18, 2015 08:02
Closed-hand Chinese poker probabilities
front
1.01 : 7-5-3
2.01 : 9-5-4
3.05 : T-6-4
4.01 : J-3-2
5.02 : J-8-5
6.12 : J-T-8
7.02 : Q-7-3
8.07 : Q-9-5
9.04 : Q-T-8
@paulhankin
paulhankin / change.py
Created April 26, 2015 05:14
Making change
def change(coins, N):
x = 1
for c in coins:
x *= ((1<<N*c*(N//c+2))-1)//((1<<N*c)-1)
return (x>>N*N)&((1<<N)-1)
print change([1, 5, 10, 25, 50, 100], 100)