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
-- Check the length of the intersection of 2 unique lists
-- with both individual lists.
-- If they are equal we have a permutation because we may assume that there are no duplicates in the list
-- and thus have a 1:1 image domain.
propIsPermutation :: [Integer] -> [Integer] -> Bool
propIsPermutation xs ys = isPermutation (nub xs) (nub ys) == bijective
where bijective = length (nub xs) == length (intersect (nub xs) (nub ys)) && length (nub ys) == length (intersect (nub xs) (nub ys))
For example bijective [1] [2] returns True must be False
The text was updated successfully, but these errors were encountered:
For example
bijective [1] [2]
returnsTrue
must beFalse
The text was updated successfully, but these errors were encountered: