You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Permutations have the property that if x is a permutation of y and
-- y is a permutation of z, then x is a permutation of z.
prop4d :: [Int] -> [Int] -> [Int] -> Bool
prop4d x y z
| isPermutation x y && isPermutation y z && not (isPermutation x z) = False
| otherwise = True
better
prop4d x y z = isPermutation x y && isPermutation y z && isPermutation x z
-- Derangements have the property that if x is a derangement of y and y is
-- a derangement of z and x not equal to z, then x is a derangement of z.
prop5d :: [Int] -> [Int] -> [Int] -> Bool
prop5d x y z
| isDerangement x y && isDerangement y z && not (isDerangement x z) && x /= z = False
| otherwise = True
Counter example x=[1,2,3,4] y=[4,3,1,2] y=[3,1,2,4] z= [1,2,4,3] x=[1,2,3,4] z=[1,2,4,3]
The text was updated successfully, but these errors were encountered:
better
Counter example
x=[1,2,3,4] y=[4,3,1,2] y=[3,1,2,4] z= [1,2,4,3] x=[1,2,3,4] z=[1,2,4,3]
The text was updated successfully, but these errors were encountered: