Cardinality of the set of all functions

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 4K views
ribbon
Messages
38
Reaction score
0

Homework Statement


What is the cardinality of the set of all functions from N to {1,2}?

Homework Equations





The Attempt at a Solution


I know the cardinality of the set of all functions coincides with the respective power set (I think) so 2^n where n is the size of the set. The cardinality of N is aleph-nought, and its power set, 2^aleph nought.

However what limitations does mapping to a finite (2 elements) set here expose us to?
 
Physics news on Phys.org
ribbon said:

Homework Statement


What is the cardinality of the set of all functions from N to {1,2}?

Homework Equations





The Attempt at a Solution


I know the cardinality of the set of all functions coincides with the respective power set (I think) so 2^n where n is the size of the set. The cardinality of N is aleph-nought, and its power set, 2^aleph nought.

However what limitations does mapping to a finite (2 elements) set here expose us to?

This would be one of those circumstances in which it is essential to use the formal definition of a function [itex]F[/itex] from [itex]A[/itex] to [itex]B[/itex] as being a subset of [itex]A \times B[/itex] with the property that for each [itex]a \in A[/itex] there is exactly one [itex]b \in B[/itex] such that [itex](a,b) \in F[/itex].

Thus there are at most as many functions from [itex]\mathbb{N}[/itex] to [itex]\{1,2\}[/itex] as there are subsets of [itex]\mathbb{N} \times \{1,2\}[/itex].
 
Last edited:
  • Like
Likes   Reactions: 1 person
pasmith said:
This would be one of those circumstances in which it is essential to use the formal definition of a function [itex]F[/itex] from [itex]A[/itex] to [itex]B[/itex] as being a subset of [itex]A \times B[/itex] with the property that for each [itex]a \in A[/itex] there is exactly one [itex]b \in B[/itex] such that [itex](a,b) \in F[/itex].

Thus there are at most as many functions from [itex]\mathbb{N}[/itex] to [itex]\{1,2\}[/itex] as there are subsets of [itex]\mathbb{N} \times \{1,2\}[/itex].

Interesting well I know the set N has 2^(aleph nought) subsets and the set S = {1, 2} has 2^2 subsets, so am I correct when I say:

2^(aleph nought) x 2^2 = 2^(aleph nought + 2)?

Also I am trying to more so understand your explanation of the equivalence of a function from A to B to a subset AxB? Is there anyway you could dumb that down a little more for me? Much appreciated!
 
ribbon said:
Also I am trying to more so understand your explanation of the equivalence of a function from A to B to a subset AxB? Is there anyway you could dumb that down a little more for me? Much appreciated!
Any function f:A→B defines a subset S of AxB consisting of the pairs {(a, f(a)):a in A}. S has the property that given a in A there exists a unique (a, b) in S.
Conversely, any subset of AxB with this property defines a function A→B, and two different such sets will define two different functions.
 
  • Like
Likes   Reactions: 1 person
ribbon said:
Interesting well I know the set N has 2^(aleph nought) subsets and the set S = {1, 2} has 2^2 subsets, so am I correct when I say:

2^(aleph nought) x 2^2 = 2^(aleph nought + 2)?

All one can say is that the number of such functions is at most the cardinality of [itex]2^{\mathbb{N} \times \{1,2\}}[/itex], which is uncountable by the diagonalization argument. But that is consistent with the possibility that the collection of those subsets of [itex]\mathbb{N} \times \{1,2\}[/itex] which satisfy the condition to be a function is countable.

But there exists a bijection [itex]2^\mathbb{N} \to \{f : \mathbb{N} \to \{1,2\}\}[/itex], so the number of such functions is exactly the cardinality of [itex]2^{\mathbb{N}}[/itex]. (To find the bijection, consider the subset of [itex]\mathbb{N}[/itex] on which a function takes the value 1.)