Defining a function (Discrete Math)

In summary: You can complete this sentence yourself.)In summary, when a book asks you to define a function, they are usually asking for an expression that specifies a function. However, sometimes it's not clear if a statement actually specifies a function, and then you have to argue that it does.
  • #1
transmini
81
1
I have multiple problems in the current homework set that say something along the lines of "try to define a function f: S -> S by the rule f(n) = n^2 for each n in S. Then it asks a couple questions such as "is the function well defined" or "is it one-to-one/onto"

I'm just confused on what its actually wanting me to do. Could someone give like an example of what they mean? Because I would've though the rule that gave WAS the function.
 
Mathematics news on Phys.org
  • #2
Well, its basically saying:
Define a function (mappping) f where [itex]f:S\rightarrow S[/itex] where [itex]n\rightarrow n^2[/itex] for all n in S. Then show that a function defined in this way is either injective(one-to-one) or surjective(onto).
A function is well defined if [itex]f:A\rightarrow B[/itex], for each [itex]a \in A[/itex] there exists a unique [itex]b \in B[/itex] such that [itex]f(a)=b[/itex]
 
  • #3
An example, let S=[itex]\mathbb{R}[/itex].
Ask yourself: Is [itex]f:\mathbb{R}\rightarrow \mathbb{R}[/itex],[itex]n\rightarrow n^2[/itex] one-to-one? (Is there a unique b in B such that f(a)=b, for a unique a in A)?

Well, [itex] -2 \in \mathbb{R}[/itex] and we see that f(-2)=4
at the same time, [itex] 2 \in \mathbb{R}[/itex] and we see that f(2)=4

Thus, f(2)=f(-2) so in this case, f is not one-to-one on this domain [itex]\mathbb{R}[/itex]

You could easily show that f defined in this way is also not onto. So you could say f is not bijective (one-to-one and onto) and f is well defined.
 
  • #4
Okay so I'm still a little lost as to what to write for this. Here's another problem out of the book, not the actual problem, but it's similar.

Define ƒ : ℤ → ℤ by the rule ƒ(n) = 4n - 5 for all integers n.
(i) Is ƒ one-to-one? Prove or give a counterexample.
(ii) Is ƒ onto? Prove or give a counterexample

I'm not sure how to even get started unless it literally wants me to just answer i and ii.
 
  • #5
transmini said:
Okay so I'm still a little lost as to what to write for this. Here's another problem out of the book, not the actual problem, but it's similar.

Define ƒ : ℤ → ℤ by the rule ƒ(n) = 4n - 5 for all integers n.
(i) Is ƒ one-to-one? Prove or give a counterexample.
(ii) Is ƒ onto? Prove or give a counterexample

I'm not sure how to even get started unless it literally wants me to just answer i and ii.
Well, think about it graphically: 4n-5 is a line. Does a line in the ([itex]\mathbb{Z},\mathbb{Z}[/itex]) plane have only one "x" value per "y" value? (i.e injective)
Does every "y" value have an "x" value? (i.e onto)? (I say x,y analogous to the cartesian plane to draw you a mental picture)
 
  • #6
I meant as far as the "Define a function" part goes. I should be able to show the others, I think...
 
  • #7
By saying "define a function" your book is saying "consider a function" -its just wording.
Basically if a say define a function: f(x)=x^2, I am saying look at this function and answer the following questions about it.
 
  • #8
Oh...well that's pretty bad wording then haha. But I was confused about that since they already gave a function. Thanks for the help!
 
  • #9
Thread moved, as it is more of a generic question than an actual homework question.
@transmini, when you post in the Homework section, you must use the homework template.
 
  • #10
transmini said:
I have multiple problems in the current homework set that say something along the lines of "try to define a function f: S -> S by the rule f(n) = n^2 for each n in S. Then it asks a couple questions such as "is the function well defined" or "is it one-to-one/onto"

I'm just confused on what its actually wanting me to do. Could someone give like an example of what they mean? Because I would've though the rule that gave WAS the function.
When a book asks "is the function well-defined?", what they usually mean is "Does the above actually define a function?" In the case of the original question, the answer depends on whether it's clear from the context what multiplication operation is involved in the definition of the notation n^2.

It's usually obvious if a statement defines a function or not. When it's not, there's often an equivalence relation involved. Suppose that ~ is an equivalence relation on some set X. Then each element of X belongs to exactly one equivalence class. The equivalence class that contains x is denoted by [x]. The set of all equivalence classes is denoted by X/~. We can try to define a function f with domain X/~ by specifying what we want f([x]) to be for each equivalence class [x], but if that specification is an expression that involves x rather than [x], then it might be hard to tell if the statement defines a function or not. You would have to try replacing the x in that expression with a variable that represents an arbitrary element of [x], and see if you can prove that the new expression represents the same thing as the old one.

In set theory, a function isn't a rule. It's useful to think of it as a rule, but it's really a set, like everything else. There are several slightly different ways to define the term "function" in set theory. This one is appropriate for the problems you're working with:

Definition 1: A triple ##(X,Y,G)## such that ##G\subseteq X\times Y## is said to be a function from X into Y if

(a) For all x in X, there's a y in Y such that (x,y) is in G.
(b) For all y,z in Y, if (x,y)=(x,z) then y=z.

If f=(X,Y,G) is a function in the sense of definition 1, then X is called the domain of f, Y is called the codomain of f, and G is called the graph of f.

This one is also nice:

Definition 2: A set f of ordered pairs is said to be a function the following statement holds for all (x,y), (w,z) in f: If x=w then y=z.

The domain of f is then defined as the set of all x such that there's a y such that (x,y) is in f. (A more complicated statement is needed to make it clear that the definition of "domain" doesn't violate any set theory axioms, but this definition is accurate enough for our purposes).

What definition 2 calls a function is what definition 1 calls the graph of a function. The terms "codomain" and "surjective" are kind of pointless if you're using definition 2. That's why I think definition 1 is more appropriate for you.
 
Last edited:
  • Like
Likes gracy

FAQ: Defining a function (Discrete Math)

1. What is a function?

A function is a mathematical relationship between two sets of values, known as the input and output. It assigns each input value to exactly one output value, and the output value is determined by a specific rule or formula.

2. What is the difference between a function and a relation?

A relation is a set of ordered pairs that relate input values to output values, while a function is a type of relation where each input value is mapped to exactly one output value. This means that in a function, each element in the domain has a unique element in the codomain.

3. What is the domain and codomain of a function?

The domain of a function is the set of all possible input values, while the codomain is the set of all possible output values. In other words, the domain is the set of independent variables and the codomain is the set of dependent variables.

4. How do you represent a function?

A function can be represented in several ways, including using a table of values, a mapping diagram, an algebraic equation, or a graph. Each representation provides a visual representation of the relationship between the input and output values.

5. What is a one-to-one function?

A one-to-one function is a type of function where each element in the domain is mapped to a unique element in the codomain, and each element in the codomain is mapped to by at most one element in the domain. This means that no two different inputs can produce the same output.

Similar threads

Replies
2
Views
1K
Replies
6
Views
1K
Replies
13
Views
2K
Replies
23
Views
6K
Replies
61
Views
10K
Replies
10
Views
441
Replies
2
Views
2K
Back
Top