2
$\begingroup$

I have a continuous variable whose range is within $[-1, 1]$. I want to map the values of this variable to the range $[0, 1]$ instead. What I do is I add the value of $1$ to the the variable and divide the result by $2$`.

To me, this looks like a linear, valid and invertible operation meaning that the mapping is one-to-one between the domain and the co-domain of this operation/function.

I wonder, is my intuition correct? I would appreciate if someone can clarify this.

$\endgroup$
  • $\begingroup$ See the MathJax reference for tips on editing mathematical formulae/content. $\endgroup$ – Devashsih Kaushik Oct 31 '18 at 14:45
  • 2
    $\begingroup$ Technically the function is affine rather than linear. $\endgroup$ – Matt Oct 31 '18 at 14:46
  • 1
    $\begingroup$ @Matt To be fair, the term "linear", in the context of continuous functions of a single variable, can instead refer to those functions of the form $f\left(x\right) = ax + b$. However, since the OP called it a "linear operation", I agree that this frames it in such a way that it should indeed be called affine. $\endgroup$ – Sam Streeter Oct 31 '18 at 15:13
2
$\begingroup$

Yes your intuition is correct, in more detail what you've done is defined a one-to-one and onto function $f: [-1,1] \to [0,1] $ where $f(x) =\frac{x+1}{2}$.

If you want to check that is in Infact invertible you can try solving the equation $ x=\frac{y+1}{2} $ where $x$ is the original input, and y is the output of the function $f(x)$

$\endgroup$
4
$\begingroup$

Yes, your intuition is correct. To be precise, you are describing the function $$f: [-1,1] \rightarrow [0,1],$$ $$f\left(x\right) = \frac{x+1}{2},$$ which is bijective and has inverse $$g: [0,1] \rightarrow [-1,1],$$ $$g\left(y\right) = 2y-1.$$

$\endgroup$
  • $\begingroup$ Both your answer and C. Grant's answer are satisfactory for me. However, I want the other person to gain the privilege of commenting so I marked his answer as the final answer :) I Hope you don't mind $\endgroup$ – Amir Oct 31 '18 at 14:51
  • $\begingroup$ Ah, that's nice of you! Yes, I'm happy for you to spread the reps. I was initially a bit suspicious of their answer being so similar to mine, even in the wording, but I think that's just because there's a pretty canonical response here that we've both used, and their reasoning for the inverse is different, so fair enough. $\endgroup$ – Sam Streeter Oct 31 '18 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.