Number of functions from one set to another

  • Thread starter Thread starter nicnicman
  • Start date Start date
  • Tags Tags
    Functions Set
Click For Summary

Homework Help Overview

The discussion revolves around determining the number of functions from the set {1, 2, ..., n} to the set {0, 1}, where n is a positive integer. The specific questions include finding functions that are one-to-one, functions that assign 0 to both 1 and n, and functions that assign 1 to exactly one of the positive integers less than n.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants explore the total number of functions based on the size of the domain and the constraints of the codomain. There is an attempt to analyze specific cases for n = 1, 2, and 3 regarding one-to-one functions. Questions arise about the interpretation of part b) and how to approach it, with hints provided for part c).

Discussion Status

Some participants have provided insights into the number of functions for specific values of n and discussed the implications of constraints on the function mappings. There is ongoing exploration of the requirements for parts b) and c), with hints and suggestions being shared to guide understanding.

Contextual Notes

Participants note that for part b), the requirement to assign 0 to both 1 and n reduces the number of elements available for mapping, leading to a different calculation than the total number of functions. There is also a recognition that the nature of one-to-one functions changes with increasing n.

nicnicman
Messages
132
Reaction score
0

Homework Statement



How many functions are there from the set {1, 2, . . . , n}, where n is a positive integer, to the set {0, 1}
a) that are one-to-one?
b) that assign 0 to both 1 and n?
c) that assign 1 to exactly one of the positive integers less than n?


Homework Equations





The Attempt at a Solution


Since every element in the domain {1, 2, . . . , n} has two options in the codomain {0, 1} there a total of 2^n functions from the domain to the codomain.
Also, I understand that to be a one-to-one relationship no element of the codomain is the image of more than one element in the domain.
However, I'm unsure how to solve the problems. Any suggestions would be appreciated.
 
Physics news on Phys.org
nicnicman said:

Homework Statement



How many functions are there from the set {1, 2, . . . , n}, where n is a positive integer, to the set {0, 1}
a) that are one-to-one?
b) that assign 0 to both 1 and n?
c) that assign 1 to exactly one of the positive integers less than n?


Homework Equations




The Attempt at a Solution


Since every element in the domain {1, 2, . . . , n} has two options in the codomain {0, 1} there a total of 2^n functions from the domain to the codomain.
Also, I understand that to be a one-to-one relationship no element of the codomain is the image of more than one element in the domain.
However, I'm unsure how to solve the problems. Any suggestions would be appreciated.

Start with a). The answer will depend on n. Suppose n=1, n=2 and n=3. What do you get in those cases?
 
Sorry for the delay.

a) If n = 1 then there are two choices for the first and only element in the domain.
So, we have 2 functions if n = 1

If n = 2 then there are two choices for the first element in the domain. Then, since one choice is taken there is one choice for the second element in the domain.
So, we have 2 * 1 = 2 functions if n = 2.

If n >= 3 then there will always be elements in the domain with no images to map to.
So, we have 0 functions if n >= 3.
 
I guess you know how to do part b.

Hint for part c: there are n - 1 ways to choose an element less than n, and once you assign that element to 1, all the other elements except n must go to 0. Then you can assign either 0 or 1 to n.
 
Actually I do need help with b). I don't understand what the problem is asking for.
 
You said that the number of functions from {1, ..., n} to {0, 1} is 2n.

Part (b) is the same, except there are only n - 2 elements instead of n, since two of the elements must always go to 0.

If the function must assign 0 to both 1 and n then there are n - 2 numbers left which can be either 0 or 1.

Given n - 2 elements, how many ways are there to map them to {0, 1}?
 
2n-2
 
Yep, that's the answer.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
2K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
12
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
Replies
5
Views
2K
Replies
8
Views
2K