Created
July 1, 2013 22:29
-
-
Save devth/5905199 to your computer and use it in GitHub Desktop.
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
-- find the elements of two 3-element sets whose cartesian products, when multiplied | |
-- form a 5-element set | |
setMembers = head [[a, b, c, d, e, f] | a <- [1..10], b <- [2..14], c <- [4..20], d <- [6..24], | |
e <- [7..25], f <- [6..30], | |
length [a, b, c, d, e, f] == length (nub [a, b, c, d, e, f]), | |
length (nub [x*y | x <- [a, b, c], y <- [d, e, f]]) == 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment