How to identify the type of function?

  • Thread starter tellmesomething
  • Start date
  • Tags
    Functions
  • #1
tellmesomething
406
44
Homework Statement
I came across this question:

> If two functions ##f,g :\mathbb{R} \to \mathbb{R}## are such that
$$
f(x) = \begin{cases}
x+3&, \ x\in \mathbb{Q}\\
4x&, \ x\in \mathbb{R}\setminus \mathbb{Q}
\end{cases}
$$
$$
g(x) = \begin{cases}
-x&,\ x\in \mathbb{Q}\\
x + \sqrt{5}&, x\in \mathbb{R} \setminus \mathbb{Q}
\end{cases}
$$
then ##(f-g)(x)## is one-one, onto, both or none.
Relevant Equations
None
*My attempt:***

We know that
$$
(f-g)(x) =\begin{cases}
2x+3&, \ x\in \mathbb{Q}\\
3x - \sqrt{5} &, \ x\in \mathbb{R} \setminus \mathbb{Q}
\end{cases}
$$
Now the problem is I don't understand how to navigate it further..
The two equations we obtain would have been straight line equations if the domain of each straight line equations was ##\mathbb{R}##.
But since it's not, wouldn't it be discontinuous at places?
Normally if it were not a two fold function we could have easily found out if it is a one one function or not by the numerous approaches like horizontal line test, derivative approach,simply looking at the function etc.

Now I am confused, please consider helping or leaving a hint.

Thank you
 
Last edited by a moderator:
  • Like
Likes dipcario34
Physics news on Phys.org
  • #2
Hints that I already received:

1) Function gives rational outputs for rational inputs but does it really give irrational outputs for irrational inputs

I could only find one counter argument here when x for the irrational function would have been √5/3

And since 2x+3 also gives us 0 for a different x value i.e an image has two pre images,we can say that its a many one function

Problem:
I want a more generalised approach, if it were a more complex function it would have taken some brute force to find this.

2) We know that both of these functions individually are one-one functions so all we have to do is find that the set containing the outputs of the rational values and the set containing outputs of irrational values' intersection is null set.

I understand that but how do I prove this?

3) I didnt get any hint to prove whether its an onto function or not, I am not sure if all the Real numbers have been achieved. Please help here as well.
 
  • #3
Look at the images under the functions.

E.g., as you have mentioned, the functions in ##f(x)## both define a straight, which is one-on-one on ##\mathbb{Q}##, ##\mathbb{R}\backslash \mathbb{Q},## resp. Now look at the codomains.

##g(x)## leads to a different result.
 
  • Like
Likes tellmesomething
  • #4
It is easy to find values for which ##f-g## doesn't have a solution.
 
  • Like
Likes tellmesomething
  • #5
fresh_42 said:
Look at the images under the functions.

E.g., as you have mentioned, the functions in ##f(x)## both define a straight, which is one-on-one on ##\mathbb{Q}##, ##\mathbb{R}\backslash \mathbb{Q},## resp. Now look at the codomains.

##g(x)## leads to a different result.
But aren't the g(x) functions also straight line equations? The co domain of both being R..?
 
  • #6
Hill said:
It is easy to find values for which ##f-g## doesn't have a solution.
Hill said:
It is easy to find values for which ##f-g## doesn't have a solution.
Well if that is proved then I guess we can say it isnt an onto function..?
 
  • #7
tellmesomething said:
But aren't the g(x) functions also straight line equations? The co domain of both being R..?
I missed the part that you were looking for ##f-g##. I thought you were asking for ##f## and ##g##. The proof for ##f## is as follows:
\begin{align*}
f_1\, &: \,\mathbb{Q} \longrightarrow \mathbb{Q}\\
f_1(x)&=x+3
\end{align*}
which is bijective, one-onto-one because ##x\in \mathbb{Q}## if and only if ##x+3\in \mathbb{Q}.##
\begin{align*}
f_2\, &: \,\mathbb{R}\backslash\mathbb{Q} \longrightarrow \mathbb{R}\backslash\mathbb{Q}\\
f_2(x)&=4x
\end{align*}
which is bijective, one-onto-one because ##x\in \mathbb{R}\backslash\mathbb{Q}## if and only if ##4x\in \mathbb{R}\backslash\mathbb{Q}.##

##\mathbb{Q} \cap\mathbb{R}\backslash\mathbb{Q}=\emptyset ## and ##\mathbb{Q} \cup\mathbb{R}\backslash\mathbb{Q}=\mathbb{R}, ## so ##f_1## and ##f_2## are defined on distinct sets, having distinct codomains, and they can be combined and they carry both of its properties (one-onto-one) with them. That makes ##f## one-onto-one on the union of both sets, ##\mathbb{R}.##

The argument for ##g## and ##f-g## is similar. However,
$$
x+\sqrt{5} \in \mathbb{R}\backslash\mathbb{Q} \not\Longleftrightarrow x\in \mathbb{R}\backslash\mathbb{Q}
$$
isn't equivalent anymore so it needs a modification. It cannot be one-onto-one anymore.

Look at the codomaines! Which points can you get with ##g(x)##?
 
Last edited:
  • Like
Likes tellmesomething and docnet
  • #8
tellmesomething said:
Well if that is proved then I guess we can say it isnt an onto function..?
Yes.
 
  • Like
Likes tellmesomething
  • #9
I have a question. Can you assume that the following is true without proving it? It doesn't seem elementary to me.

Let ##a## be rational and let ##b## be irrational. Then, ##a+b## is irrational. Furthermore, there do not exist irrational numbers ##c## and ##d## such that ##a+b=c+d##.

Thanks

Edit: I think the statement must be false, and so it seems like there must be a different way to show ##f-g## isn't surjective. I'm probably over-complicating things.
 
Last edited:
  • Like
Likes tellmesomething
  • #10
docnet said:
I have a question. Can you assume that the following is true without proving it? It doesn't seem elementary to me.

Let ##a## be rational and let ##b## be irrational. Then, ##a+b## is irrational.
If ##a+b## would be rational, then ##b=(a+b)-a## would be rational, too, since ##a## is. Contradiction.
docnet said:
Furthermore, there do not exist irrational numbers ##c## and ##d## such that ##a+b=c+d##.

Thanks
Are you still assuming ##a\in \mathbb{Q} ## and ##b\in \mathbb{R}\backslash \mathbb{Q}##? If so, then the answer is no. ##0 + \sqrt{2} = 3\sqrt{2} -2 \sqrt{2}.##
 
  • Like
Likes tellmesomething and docnet
  • #11
fresh_42 said:
If ##a+b## would be rational, then ##b=(a+b)-a## would be rational, too, since ##a## is. Contradiction.

Are you still assuming ##a\in \mathbb{Q} ## and ##b\in \mathbb{R}\backslash \mathbb{Q}##? If so, then the answer is no. ##0 + \sqrt{2} = 3\sqrt{2} -2 \sqrt{2}.##
I got it! So for ##f_2-g_2## one of the irrational numbers is fixed at##\sqrt{5}##, so it's easy come up with a number, say ##2+\sqrt{5}##, which isn't in the codomain of ##f-g##.
 
  • Like
Likes tellmesomething
  • #12
docnet said:
I got it! So for ##f_2-g_2## one of the irrational numbers is fixed at##\sqrt{5}##, so it's easy come up with a number, say ##2+\sqrt{5}##, which isn't in the codomain of ##f-g##.

Those problems are meant to practice
  • the concept of functions
  • distinguishing domain and codomain
  • ##\mathbb{Q}## is a field, it is closed under addition and multiplication
  • ##\mathbb{R}\backslash \mathbb{Q}## has no algebraic structures, so being closed under arithmetic operations has to be investigated case by case: ##\sqrt{2}+\sqrt{2}\in \mathbb{R}\backslash \mathbb{Q}\, , \,\sqrt{2}-\sqrt{2}\in \mathbb{Q}.##
  • no fear of equations: start with what you have and go. Nike! Just do it.

I haven't done the math, but let's see.

$$
(f-g)(x)=\begin{cases} 2x+3 &\text{ if } x\in \mathbb{Q}\\ 3x-\sqrt{5}&\text{ if }x\in \mathbb{R}\backslash \mathbb{Q}\end{cases}
$$
The first part is a line that maps ##\mathbb{Q} \stackrel{1:1}{\longrightarrow }\mathbb{Q}.## The second part maps some irrational to rational numbers:
$$
3x-\sqrt{5} = \dfrac{n}{m} \in \mathbb{Q} \Longleftrightarrow x = \dfrac{n+m\sqrt{5}}{3m}
$$
The right-hand side is irrational for all integers ##n,m## with ##m\neq 0## and thus in the domain of the second part of ##f-g.## This makes a lot of rational points in the codomain, the range of ##f-g##, and every one of them is hit by the first part, too, namely by ##\dfrac{n}{m}=2x+3 \Longleftrightarrow x=\dfrac{n-3m}{2m}\in \mathbb{Q}.##

My initial hint: look at the codomain (range) was the key.
 
  • Like
Likes tellmesomething and docnet
  • #13
There is another interesting question. We have a well-defined function ##f-g## (means, no value ##x## maps on two different targets) and we go from ##\mathbb{R}=\mathbb{Q}\cup \mathbb{R}\backslash \mathbb{Q}## to ##\mathbb{R}##. Both, domain and codomain are the real numbers, i.e. the same set. We have seen that we can hit some rational numbers twice, by the first part with a rational number and by the second part of ##f-g## with an irrational number.

The first part hits all rational numbers.

Now my question: Do we hit all irrational numbers? Some of them hit a rational number, so shouldn't there be some numbers left that don't get hit since some are hit twice on the rational side and both sets are the real numbers?
 
Last edited:
  • Like
Likes tellmesomething and docnet
  • #14
fresh_42 said:
Now my question: Do we hit all irrational numbers? Some of them hit a rational number, so shouldn't there be some numbers left that don't get hit since some are hit twice on the rational side and both sets are the real numbers?
I think the answer is no. Irrational numbers of the form ##x-\sqrt{5}## where ##x\in \mathbb{Q}## are not covered. This is because ##x\in\{\mathbb{R}-\mathbb{Q}\}##. And since ##f-g## covers ##0## twice:

$$(f_1-g_1)\left(-\frac{3}{2}\right)=2\left(-\frac{3}{2}\right)+3=0=3\left(\frac{\sqrt{5}}{3}\right)-\sqrt{5}=(f_2-g_2)\left(\frac{\sqrt{5}}{3}\right),$$

we can conclude that ##f-g## is neither one-to-one nor onto.

I don't know if there's another rational number in the image of ##f_2-g_2##.

But, this is not because every non-injective function from ##\mathbb{R}## to itself must be non-surjective. One can find a counterexample by defining ##f_2-g_2## as a bijection from ##\mathbb{R}-\mathbb{Q}## to ##\mathbb{R}##. If we keep ##f_1-g_1## the same, then ##f-g## covers every rational number twice and every irrational number once.
 
Last edited:
  • Like
Likes tellmesomething and fresh_42
  • #15
docnet said:
I think the answer is no.

If ##r\in \mathbb{R}\backslash \mathbb{Q}## then it is not in the range of ##f_1-g_1.## If it is in the range of ##f_2-g_2## then
\begin{align*}
r&=(f_2-g_2)(x)=3x-\sqrt{5}\\
x&=\dfrac{r+\sqrt{5}}{3}=\begin{cases} \in \mathbb{R}\backslash \mathbb{Q}& \checkmark \\
=\dfrac{n}{m}\in \mathbb{Q} &\Rightarrow r=\dfrac{3n-m\sqrt{5}}{m}
\end{cases}
\end{align*}
None of the irrational numbers ##\dfrac{3n-m\sqrt{5}}{m}## are in the range of ##f-g.##

I think, you are right and ...

docnet said:
... we can conclude that ##f-g## is neither one-to-one nor onto.
and also with:
docnet said:
But, this is not because every non-injective function from ##\mathbb{R}## to itself must be non-surjective.
 
  • Like
Likes tellmesomething and docnet
  • #16
fresh_42 said:
I missed the part that you were looking for ##f-g##. I thought you were asking for ##f## and ##g##. The proof for ##f## is as follows:
\begin{align*}
f_1\, &: \,\mathbb{Q} \longrightarrow \mathbb{Q}\\
f_1(x)&=x+3
\end{align*}
which is bijective, one-onto-one because ##x\in \mathbb{Q}## if and only if ##x+3\in \mathbb{Q}.##
\begin{align*}
f_2\, &: \,\mathbb{R}\backslash\mathbb{Q} \longrightarrow \mathbb{R}\backslash\mathbb{Q}\\
f_2(x)&=4x
\end{align*}
which is bijective, one-onto-one because ##x\in \mathbb{R}\backslash\mathbb{Q}## if and only if ##4x\in \mathbb{R}\backslash\mathbb{Q}.##

##\mathbb{Q} \cup\mathbb{R}\backslash\mathbb{Q}=\emptyset ## and ##\mathbb{Q} \cap\mathbb{R}\backslash\mathbb{Q}=\mathbb{R}, ##***** so ##f_1## and ##f_2## are defined on distinct sets, having distinct codomains, and they can be combined and they carry both of its properties (one-onto-one) with them. That makes ##f## one-onto-one on the union of both sets, ##\mathbb{R}.##

The argument for ##g## and ##f-g## is similar. However,
$$
x+\sqrt{5} \in \mathbb{R}\backslash\mathbb{Q} \not\Longleftrightarrow x\in \mathbb{R}\backslash\mathbb{Q}
$$
isn't equivalent anymore so it needs a modification. It cannot be one-onto-one anymore.

Look at the codomaines! Which points can you get with ##g(x)##?
##\mathbb Q \cap( \mathbb R-\mathbb Q)=\mathbb R ##?(****) above.
 
  • Like
Likes tellmesomething
  • #17
Re being non-injective and non-surjective, this seems to be addressed by Rank-Nullity. Non-injective implies a non-trivial kernel, at least within each of ##\mathbb Q## and ##\mathbb R-\mathbb Q## Issue is when we put them together in the final function. It seems to come down to whether ## \frac {x+ \sqrt 5}{3} \in \mathbb R -\mathbb Q## when ##x## does.
 
  • Like
Likes tellmesomething
  • #18
WWGD said:
Re being non-injective and non-surjective, this seems to be addressed by Rank-Nullity. Non-injective implies a non-trivial kernel, at least within each of ##\mathbb Q## and ##\mathbb R-\mathbb Q## Issue is when we put them together in the final function. It seems to come down to whether ## \frac {x+ \sqrt 5}{3} \in \mathbb R -\mathbb Q## when ##x## does.
Could you please explain what you mean and be more concrete in your justifications? Your reply made me confused because I thought the terms kernel and Rank-Nullity do not apply to ##\mathbb{R}-\mathbb{Q}##, which isn't a vector space, a group, a ring or an algebraic structure. And can you say with confidence that ##f_2-g_2## and ##f-g## are homomorphisms? Thanks again.
 
  • Like
Likes tellmesomething
  • #19
docnet said:
Could you please explain what you mean and be more concrete in your justifications? Your reply made me confused because I thought the terms kernel and Rank-Nullity do not apply to ##\mathbb{R}-\mathbb{Q}##, which isn't a vector space, a group, a ring or an algebraic structure. And can you say with confidence that ##f_2-g_2## and ##f-g## are homomorphisms? Thanks again.
Sure, I was writing very imprecisely, condidering whether we could have written. It was a hypothetical. Please ignore, apologies for not being precise. Strictly soeaking, though, ##\mathbb Q## is a field, and, as such, it's a vector space over itself. But you're right that the Irrationals aren't one, which I didn't state clearly enough. Ill try to be more precise from now on.
 
  • Like
Likes tellmesomething and docnet
  • #20
fresh_42 said:
##\mathbb{Q} \cup\mathbb{R}\backslash\mathbb{Q}=\emptyset ## and ##\mathbb{Q} \cap\mathbb{R}\backslash\mathbb{Q}=\mathbb{R}, ## so ##f_1## and ##f_2## are
Is there a typo? Shouldnt the union sign be replaced with the intersection sign and vice versa?
Thats really helpful and clear. G(x) then can be something like 3 if say x is 3-√5. That would make the intersection of the codomains of the functions -x & x+√5 not equal to a null set, which would mean its not one to one. But it could be onto I believe..
fresh_42 said:
Those problems are meant to practice
  • the concept of functions
  • distinguishing domain and codomain
  • ##\mathbb{Q}## is a field, it is closed under addition and multiplication
  • ##\mathbb{R}\backslash \mathbb{Q}## has no algebraic structures, so being closed under arithmetic operations has to be investigated case by case: ##\sqrt{2}+\sqrt{2}\in \mathbb{R}\backslash \mathbb{Q}\, , \,\sqrt{2}-\sqrt{2}\in \mathbb{Q}.##
  • no fear of equations: start with what you have and go. Nike! Just do it.

I haven't done the math, but let's see.

$$
(f-g)(x)=\begin{cases} 2x+3 &\text{ if } x\in \mathbb{Q}\\ 3x-\sqrt{5}&\text{ if }x\in \mathbb{R}\backslash \mathbb{Q}\end{cases}
$$
The first part is a line that maps ##\mathbb{Q} \stackrel{1:1}{\longrightarrow }\mathbb{Q}.## The second part maps some irrational to rational numbers:
$$
3x-\sqrt{5} = \dfrac{n}{m} \in \mathbb{Q} \Longleftrightarrow x = \dfrac{n+m\sqrt{5}}{3m}
$$
The right-hand side is irrational for all integers ##n,m## with ##m\neq 0## and thus in the domain of the second part of ##f-g.## This makes a lot of rational points in the codomain, the range of ##f-g##, and every one of them is hit by the first part, too, namely by ##\dfrac{n}{m}=2x+3 \Longleftrightarrow x=\dfrac{n-3m}{2m}\in \mathbb{Q}.##

My initial hint: look at the codomain (range) was the key.

But how do we be sure that all the irrational numbers aren't achieved by x+√5?

I understand its not a one to one function since it also achieved rational numbers, but can it not achieve all irrational numbers as well?

As I think this is what would help us define the codomain of f-g
 
  • #21
WWGD said:
##\mathbb Q \cap( \mathbb R-\mathbb Q)=\mathbb R ##?(****) above.
Thank you. Cap/cup error corrected.
 
  • Like
Likes tellmesomething
  • #22
tellmesomething said:
Is there a typo? Shouldnt the union sign be replaced with the intersection sign and vice versa?
Yes. Cap and cup confused. I corrected it.
tellmesomething said:
Thats really helpful and clear. G(x) then can be something like 3 if say x is 3-√5. That would make the intersection of the codomains of the functions -x & x+√5 not equal to a null set, which would mean its not one to one. But it could be onto I believe..

But how do we be sure that all the irrational numbers aren't achieved by x+√5?
@docnet gave an example in post #14, which is in detail:

Let's take ##x\in \mathbb{Q}## and ##y=x-\sqrt{5} \in \mathbb{R}\backslash \mathbb{Q}.## Then ##y## cannot be in the codomain of ##(f-g)|_\mathbb{Q}\subseteq \mathbb{Q}.## If ##y## was in the codomain of ##(f-g)|_{\mathbb{R}\backslash \mathbb{Q}}## then ##y=(f-g)(z)## for some ##z\in \mathbb{R}\backslash \mathbb{Q}.## Thus
$$
y=x-\sqrt{5}=(f-g)(z)=3z-\sqrt{5} \Rightarrow \mathbb{Q}\ni x= 3z \in \mathbb{R}\backslash \mathbb{Q}
$$
which cannot be. Hence, ##x-\sqrt{5}## isn't an image of any point in ##\mathbb{Q} \cup \mathbb{R}\backslash \mathbb{Q}=\mathbb{R},## and ##f-g## isn't onto.

Whether ##y=x+\sqrt{5} \in \operatorname{im}(f-g)## or not depends on ##x##. If ##x=\sqrt{5}##
then ##y=\sqrt{5}+\sqrt{5}=2\sqrt{5}= 3\sqrt{5}-\sqrt{5}=(f-g)(\sqrt{5)}.##

tellmesomething said:
I understand its not a one to one function since it also achieved rational numbers, but can it not achieve all irrational numbers as well?
Basically, yes, but it doesn't, see above.
tellmesomething said:
As I think this is what would help us define the codomain of f-g

The codomain is described in post #12.

Don't be afraid of playing with those equations. This exercise should practice a standard argument, too: What if not? It is typical and necessary in order to read mathematical conclusions, and it is almost every single thought in abstract algebra: What of not?

Practice it!

##(f-g)## is not injective (into). What if not, i.e. what if it was injective? If ##(f-g)## was injective, then ##(f-g)(x)=(f-g)(y) ## implies ##x=y##. Now you have to find ##x\neq y\in \mathbb{R}## with ##(f-g)(x)=(f-g)(y).## Now do so!

##(f-g)## is not subjective (onto). What if not, i.e. what if it was surjective? If ##(f-g)## was surjective, then ##(f-g)(\mathbb{R})=\mathbb{R}.## How can you find the numbers ##r\in \mathbb{R}## that are not covered, i.e. determine the set ##\mathbb{R}\backslash (f-g)(\mathbb{R}).##
Now do so!

Practice it, and show us your conclusions. "Otherwise ... contradiction" are the most important words in abstract algebra to rule out the otherwise!
 
Last edited:
  • Like
Likes tellmesomething, docnet and SammyS
  • #23
I corrected a confusion in my post #14 too. It now reads ##(f_2-g_2)\left(\frac{\sqrt{5}}{3}\right)=3\left(\frac{\sqrt{5}}{3}\right)-\sqrt{5}=0## as it should have. Sorry about that.
 
  • Like
Likes tellmesomething and fresh_42
  • #24
Thankyou for the wonderful replies. Im sorry for my inactiveness in this thread, feels very ignorant, im just a little busy at the moment. I'll go through all of this as soon as I can and hopefully be crystal clear about this concept. :)
 
  • Like
Likes WWGD, docnet and fresh_42

Similar threads

Back
Top