Injectivity and Surjectivity of Functions with Lists and Sets

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
arnold28
Messages
14
Reaction score
0

Homework Statement


Are the given functions injective? Surjective?

a) seq: N -> Lists[N]

b) f: Lists[A] -> P(A), f(x)=(<x1,x2,...,xn>)={x1,x2,...,xn}

Homework Equations


The Attempt at a Solution



a) Ok so the domain contains a sequence of natural numbers.
and the range contains a list? What is that list? Is it all lists possible? If it means all lists possible, then a) is injective and surjective?
 
Physics news on Phys.org
I think the range is supposed to be the powerset of A, f will map a list to a set with the same values in it. (you might have told as a bit more about the notation used here)

Can you think of two lists that produce the same set? if so, it's not an injection

Are all the sets produced by letting f act on some list? If so, it's a surjection.