How many functions are there from {0,1} to {0,1} without restricted domains?

  • Thread starter Panphobia
  • Start date
  • Tags
    Functions
In summary, there are 9 possible functions from {0,1} to {0,1}. This is because there are 3 choices for the value of f(0) (0, 1, or undefined) and 3 choices for the value of f(1) (0, 1, or undefined), giving a total of 3*3=9 possibilities. However, if the definition of a function requires all elements of the domain to have a defined function value, then there are only 4 possible functions. It is important to note the difference between the domain and codomain of a function and the actual values that the function can take on. Two different formulas can represent the same function as long as they are
  • #1
Panphobia
435
13

Homework Statement



How many functions are there from {0,1} to {0,1}?

The Attempt at a Solution


I know the answer is 9, but how is the answer 9?
 
Physics news on Phys.org
  • #2
Panphobia said:

Homework Statement



How many functions are there from {0,1} to {0,1}?

The Attempt at a Solution


I know the answer is 9, but how is the answer 9?

f(0) could be either 0, 1 or undefined. Same for f(1). Count all of the possibilities.
 
  • #3
ohhhh I thought it was 2^2 possibilities not 3^2, thanks, because {} [itex]\subset[/itex] {0,1} and the value of {} is undefined correct?
 
  • #4
Panphobia said:
ohhhh I thought it was 2^2 possibilities not 3^2, thanks, because {} [itex]\subset[/itex] {0,1} and the value of {} is undefined correct?

No, it's because they only said f:{0,1}->{0,1}. They didn't say the function was defined for all values in the set {0,1}. If they had said the DOMAIN of f was {0,1}, then the answer 4 would be correct. It's more legalese than important.
 
  • #5
Dick said:
f(0) could be either 0, 1 or undefined. Same for f(1). Count all of the possibilities.

By what definition of "function" can it be said that if [itex]f: \{0,1\} \to \{0,1\}[/itex] then [itex]f(0)[/itex] is not either [itex]0[/itex] or [itex]1[/itex]?

Panphobia said:
ohhhh I thought it was 2^2 possibilities not 3^2, thanks, because {} [itex]\subset[/itex] {0,1} and the value of {} is undefined correct?

You were right the first time: there are four functions from [itex]\{0,1\}[/itex] to [itex]\{0,1\}[/itex], because there are exactly two choices for [itex]f(0)[/itex], and independently of that choice there are exactly two choices for [itex]f(1)[/itex].

See further this post by Tim Gowers.
 
  • #6
Dick said:
No, it's because they only said f:{0,1}->{0,1}. They didn't say the function was defined for all values in the set {0,1}. If they had said the DOMAIN of f was {0,1}, then the answer 4 would be correct. It's more legalese than important.

Except that notation [itex]f: A \to B[/itex] means that the domain of [itex]f[/itex] is [itex]A[/itex] and the codomain of [itex]f[/itex] is [itex]B[/itex]!
 
  • #7
On my practise mid term exam, it gives this exact question, the answer was 9, so pasmith, it can't be 4.
 
  • #8
The definition of a function requires every element of the domain to have a defined function value. So, if f(0) or f(1) is not defined, then f is not a function of {0, 1}.

The answer must be there are only 4 functions.
 
  • #9
Panphobia said:
On my practise mid term exam, it gives this exact question, the answer was 9, so pasmith, it can't be 4.

Then your exam is wrong. By convention, [itex]f: \{0,1\} \to \{0,1\}[/itex] means that the domain and codomain of [itex]f[/itex] are both [itex]\{0,1\}[/itex], so that [itex]f(0) \in \{0,1\}[/itex] and [itex]f(1) \in \{0,1\}[/itex].
 
  • #10
Ok thanks, I shouldn't have doubted myself :P
 
  • #11
One more question, if (A,B,C) is a function, and (A',B', C') is equal to that function if A=A' and B=B' and C=C': consider the function
f: R -> R
x|-> 1/x
Which denote the same function as f.
a)
g: R -> R
x|-> 1/x

b)
h: R* -> R
u |-> 1/u

c)
d: R -> R
w |-> w/w^2

d)
k: R->R
z|-> z-1/(z*(z-1))

I know that h cannot be right because R* != R, I know that g is the same as f, but I don't know b or c, according to the answers, d is the same as f, but not k, why is this? Oh wait nevermind, the domain of definition is different for k, sorry.
 
Last edited:
  • #12
None of these are functions of R as they are not defined at 0. These are functions of R\{0} and in the last case R\{0, 1}.

For two functions to be equal, the range, domain and all function values must be equal. It doesn't matter if two different different formulas are given, as long as the formulas are valid and equal on the same domain.

For example:

f: R -> R defined by f(x) = x is the same as:

g: R -> R defined by 2x/2

It's not the same as

h: R\{0} -> R defined by f(x) = x^2/x

And, strictly speaking:

f: R -> R, f(x) = x^2

is not the same as

f: R -> [0, ∞), f(x) = x^2

Another example is:

f: C -> C, f(z) = |z|

is not the same as:

f: C -> R, f(z) = |z|
 

1. What is a function from {0,1} to {0,1}?

A function from {0,1} to {0,1} is a mathematical rule that maps any element from the set {0,1} to another element in the same set. It is also known as a binary function, as it only has two possible inputs and outputs.

2. How is a function from {0,1} to {0,1} represented?

A function from {0,1} to {0,1} can be represented using a truth table, where the input values of 0 and 1 are listed in the left column and the corresponding output values are listed in the right column. The function can also be represented using a graph or a mathematical equation.

3. What is the purpose of a function from {0,1} to {0,1}?

Functions from {0,1} to {0,1} are commonly used in digital logic and computer science to represent and manipulate binary values. They are also used in cryptography and communication systems to encode and decode information.

4. What are some examples of functions from {0,1} to {0,1}?

Examples of functions from {0,1} to {0,1} include logical operations such as AND, OR, and NOT, as well as mathematical functions like addition, subtraction, and multiplication. These functions take in two binary inputs and produce a single binary output.

5. Can a function from {0,1} to {0,1} have more than two inputs or outputs?

No, a function from {0,1} to {0,1} can only have two inputs and two outputs. This is because the set {0,1} only contains two elements, and a function must map each input to a unique output. If there were more inputs or outputs, there would be more possible combinations than elements in the set, making it impossible for the function to be well-defined.

Similar threads

  • Precalculus Mathematics Homework Help
Replies
7
Views
394
  • Precalculus Mathematics Homework Help
Replies
23
Views
601
  • Topology and Analysis
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
13
Views
4K
  • Precalculus Mathematics Homework Help
Replies
10
Views
837
  • Precalculus Mathematics Homework Help
Replies
11
Views
515
  • Precalculus Mathematics Homework Help
Replies
15
Views
635
  • Precalculus Mathematics Homework Help
Replies
4
Views
2K
  • Precalculus Mathematics Homework Help
Replies
2
Views
1K
  • Precalculus Mathematics Homework Help
Replies
3
Views
1K
Back
Top