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

  • Thread starter Thread starter evinda
  • Start date Start date
  • Tags Tags
    Convex Functions
evinda
Gold Member
MHB
Messages
3,741
Reaction score
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
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)
 
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...
 
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)
 
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)
 
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)
 
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}$$
 
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)
 
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)
 
Back
Top