Public
Edited
Nov 8, 2024
2 forks
9 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function policy (heads, tails, bank){
let fair = 0
let cheat = 1
let flip = 2
if(bank < rules.priceOfFlip){
if(table[heads][tails].profitFair > table[heads][tails].profitCheat){ return fair }else{ return cheat }
}
return decisionMatrix[heads][tails]
}
Insert cell
decisionMatrix = [ // i=heads, j=tails. Solution by Rimbaud
[2, 2, 0, 0, , , , , , , , , ],
[2, 2, 2, 0, 0, , , , , , , , ],
[2, 2, 2, 0, 0, , , , , , , , ],
[1, 2, 2, 2, 0, 0, , , , , , , ],
[1, 2, 2, 2, 0, 0, , , , , , , ],
[1, 1, 2, 2, 2, 0, 0, , , , , , ],
[ , 1, 2, 2, 2, 2, 0, 0, , , , , ],
[ , 1, 1, 2, 2, 2, 0, 0, , , , , ],
[ , , 1, 1, 2, 2, 2, 0, 0, , , , ],
[ , , , 1, 2, 2, 2, 0, 0, , , , ],
[ , , , 1, 1, 2, 2, 2, 0, 0, , , ],
[ , , , , 1, 2, 2, 2, 2, 0, 0, , ],
[ , , , , 1, 1, 2, 2, 2, 0, 0, , ],
[ , , , , , 1, 1, 2, 2, 2, 0, 0, ],
[ , , , , , , 1, 2, 2, 2, 0, 0, ],
[ , , , , , , 1, 1, 2, 2, 2, 0, 0],
[ , , , , , , , 1, 2, 2, 2, 0, 0],
[ , , , , , , , 1, 1, 2, 2, 2, 0],
[ , , , , , , , , 1, 1, 2, 2, 0],
[ , , , , , , , , , 1, 1, 1, 0]
]
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more