Skip to content

Instantly share code, notes, and snippets.

View hazycora's full-sized avatar
💜
h

hazel cora hazycora

💜
h
View GitHub Profile
// A solution to the following problem:
// "I have two children, (at least) one of whom is a boy born on a Tuesday-
// what is the probability that both children are boys?"
// Problem proposed here: https://x.com/pli_cachete/status/1873822656879091908
const sexes = ['male', 'female']
const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
const possibleChildren = sexes.map(sex => days.map(day => [sex, day])).flat()