Skip to content

Instantly share code, notes, and snippets.

@forki
Created August 17, 2011 08:44
Show Gist options
  • Save forki/1151108 to your computer and use it in GitHub Desktop.
Save forki/1151108 to your computer and use it in GitHub Desktop.
Probabilities for drawing Ace of Clubs and Ace of Spaces
// draw Ace of Clubs and Ace of Spaces in order
completeDeck
|> select 2
|> filter ((=) [A,Clubs; A,Spades])
|> probability
|> printfn "%A" // prints "1/2652"
// draw Ace of Clubs and Ace of Spaces in any order
completeDeck
|> select 2
|> filterInAnyOrder [A,Clubs; A,Spades]
|> probability
|> printfn "A" // prints "1/1326"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment