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
// 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() |
OlderNewer