This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simulation to estimate emperical odds to win the Haba game "Boomgaard". | |
# Set number of games to play | |
NUM.SIM = 10000 | |
# Simulate one turn. Roll die and pick fruit or move bird. | |
# Input: game state. | |
# Output: game state after this turn. | |
turn <- function(state) { | |
roll <- sample(1:6,1) |
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
's anderendaags | |
's avonds | |
's middags | |
's nachts | |
's ochtends | |
's-Gravenhage | |
's-Hertogenbosch | |
06-nummer | |
1 aprilgek | |
1 aprilgrap |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simulation to solve puzzle posed in https://www.twitter.com/jben0/status/1088146700735139840 | |
k = 10 | |
# enumerate all potential combinations of flips | |
# (also copies first two students to end of the string to fake a circle) | |
f = map(x->(x^2)[1:k+2],[ bitstring(n)[65-k:64] for n in 0:2^k-1 ]) | |
# condition on at least one student with heads on either side | |
c = filter(l->size(collect(eachmatch(r"1.1",l)),1)>0,f) |
OlderNewer