Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong definition of 'bijective' #1

Open
BertLisser opened this issue Sep 24, 2018 · 0 comments
Open

Wrong definition of 'bijective' #1

BertLisser opened this issue Sep 24, 2018 · 0 comments

Comments

@BertLisser
Copy link

-- 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant