Convex Functions: Find $f,g$ Satisfying f(x)=g(x) iff x is an Integer

In summary: Suppose wlog that $x < y$.Then $g$ is convex because:If $x$ and $y$ are between the same consecutive integers, then the graph between them is a straight line, which counts as convex.Otherwise they are on different line segments and $y$ is on a line segment with a higher slope since the second derivative of $f$ is positive everywhere. Consequently the line that connects them is above all line segments in between.
  • #1
evinda
Gold Member
MHB
3,836
0
Hello! (Wave)

I want to find two convex functions $f,g: \mathbb{R} \to \mathbb{R}$ such that $f(x)=g(x)$ iff $x$ is an integer.I have thought of the following two functions $f(x)=e^x$, $g(x)=1$.

Then at the $\Rightarrow$ direction, we would have $f(x)=g(x) \Rightarrow e^x=1 \Rightarrow x=0 \in \mathbb{Z}$.

Right?

At the other direction, we cannot pick $0$, we have to pick an arbitrary integer. Right? If so, then it does not hold that $f(x)=g(x)$...

So do we have to pick other $f,g$ ? (Thinking)
 
Physics news on Phys.org
  • #2
evinda said:
Hello!

I want to find two convex functions $f,g: \mathbb{R} \to \mathbb{R}$ such that $f(x)=g(x)$ iff $x$ is an integer.I have thought of the following two functions $f(x)=e^x$, $g(x)=1$.

Then at the $\Rightarrow$ direction, we would have $f(x)=g(x) \Rightarrow e^x=1 \Rightarrow x=0 \in \mathbb{Z}$.

Right?

At the other direction, we cannot pick $0$, we have to pick an arbitrary integer. Right? If so, then it does not hold that $f(x)=g(x)$...

So do we have to pick other $f,g$ ?

Hey evinda! (Happy)

Indeed, we will have to pick other $f,g$.
I'm assuming that $f$ and $g$ have to be different functions. Do they?
Either way, it means that $f$ and $g$ have to be the same at every integer $x$.

Can we find a function $g$ that is suitable if for instance $f(x)=e^x$? (Thinking)
 
  • #3
Klaas van Aarsen said:
Hey evinda! (Happy)

Indeed, we will have to pick other $f,g$.
I'm assuming that $f$ and $g$ have to be different functions. Do they?

I assume so, too.

Klaas van Aarsen said:
Either way, it means that $f$ and $g$ have to be the same at every integer $x$.

Can we find a function $g$ that is suitable if for instance $f(x)=e^x$? (Thinking)

(Thinking) Do we have to pick a function containing $\ln{x}$ ? I haven't thought of a suitable function so far...
 
  • #4
evinda said:
I assume so, too.

Do we have to pick a function containing $\ln{x}$ ? I haven't thought of a suitable function so far...

How about a piecewise function that consists of line segments? (Thinking)
 
  • #5
Klaas van Aarsen said:
How about a piecewise function that consists of line segments? (Thinking)

So you mean that we pick a function that equals $e^x$ for $x \geq 0$ and $e^{-x}$ for $x<0$ ? (Thinking)
 
  • #6
evinda said:
So you mean that we pick a function that equals $e^x$ for $x \geq 0$ and $e^{-x}$ for $x<0$ ? (Thinking)

I was thinking of a function that equals $e^x$ if $x$ is an integer, and otherwise linearly interpolates between the nearest integers. (Thinking)
 
  • #7
Klaas van Aarsen said:
I was thinking of a function that equals $e^x$ if $x$ is an integer, and otherwise linearly interpolates between the nearest integers. (Thinking)

You mean that we pick this $g(x)$ ?

$$g(x)=\begin{cases}e^x & \text{ if } x\in \mathbb{Z} \\ e^{\lfloor x\rfloor}+(x-\lfloor x\rfloor)\frac{e^{\lceil x\rceil}-e^{\lfloor x\rfloor}}{\lceil x\rceil-\lfloor x\rfloor} & \text{ if } x\notin \mathbb{Z}\end{cases}$$
 
  • #8
evinda said:
You mean that we pick this $g(x)$ ?

$$g(x)=\begin{cases}e^x & \text{ if } x\in \mathbb{Z} \\ e^{\lfloor x\rfloor}+(x-\lfloor x\rfloor)\frac{e^{\lceil x\rceil}-e^{\lfloor x\rfloor}}{\lceil x\rceil-\lfloor x\rfloor} & \text{ if } x\notin \mathbb{Z}\end{cases}$$

Yep. That would work, wouldn't it? (Thinking)
 
  • #9
Klaas van Aarsen said:
Yep. That would work, wouldn't it? (Thinking)

Why is $g$ convex?

Also both directions are trivial, aren't they?

The $\Leftarrow$ direction is implied by definition and if $f(x)=g(x)$ we have to have that $x \in \mathbb{Z}$ since otherwise the equality wouldn't hold. Right? (Thinking)
 
  • #10
evinda said:
Why is $g$ convex?

Also both directions are trivial, aren't they?

The $\Leftarrow$ direction is implied by definition and if $f(x)=g(x)$ we have to have that $x \in \mathbb{Z}$ since otherwise the equality wouldn't hold. Right? (Thinking)

Right!

Suppose wlog that $x < y$.
$g$ is convex because:
  • If $x$ and $y$ are between the same consecutive integers, then the graph between them is a straight line, which counts as convex.
  • Otherwise they are on different line segments and $y$ is on a line segment with a higher slope since the second derivative of $f$ is positive everywhere. Consequently the line that connects them is above all line segments in between.
(Thinking)
 

FAQ: Convex Functions: Find $f,g$ Satisfying f(x)=g(x) iff x is an Integer

What is a convex function?

A convex function is a function where the line segment connecting any two points on the graph of the function lies above or on the graph. In other words, the function is always "curving up" and does not have any "dips" or "valleys". This can also be described as a function where the second derivative is always positive.

Can you give an example of a convex function?

One example of a convex function is f(x) = x^2. The graph of this function is a parabola, which is always curving upwards and does not have any dips or valleys.

How do you determine if a function is convex?

To determine if a function is convex, you can take the second derivative of the function. If the second derivative is always positive, then the function is convex. Additionally, you can also plot the graph of the function and visually determine if it is convex.

What do you mean by "iff x is an Integer" in the problem statement?

In the context of this problem, "iff" stands for "if and only if". This means that the functions f(x) and g(x) will only be equal when x is an integer. In other words, the functions will only have the same output for integer values of x.

Can you provide an example of two functions that satisfy the given condition?

One example of two functions that satisfy f(x) = g(x) iff x is an Integer is f(x) = x and g(x) = floor(x), where floor(x) is the greatest integer less than or equal to x. This means that for any integer value of x, f(x) and g(x) will have the same output (since x is already an integer), but for non-integer values, the outputs will be different.

Similar threads

Back
Top