1

I need suggestions on a continuous function with domain $[0,1]$ and range $[0,1]$ which shows large variation in output on minor variation in the input and small variation in output on large variation in the input. I know the function will be some variation of exp or log functions but I need some suggestions.

The definition of small variation: 0.001 and 0.002
The definition of large variation: 0.001 and 0.100

  • I don't know it, just guesswork. Wont $\sin(2n\pi t)$ do the job for very large n? – Swapnil Tripathi Jun 08 '14 at 15:10
  • 1
    So, $|f(0.5) - f(0.51)| > 0.5$ and $|f(0.5) - f(0.9)| < 0.1$? But then, if $f(0.9)$ is far from $f(0.91)$, so will $f(0.5)$. The concepts of "large" and "small" need some formalizing, I suppose. – Karolis Juodelė Jun 08 '14 at 15:10
  • 1
    @KarolisJuodelė Edited a bit. – Abdul Fatir Jun 08 '14 at 15:12
  • I don't think this is possible, since in order for large variations on input lead to small variations of input and the function to be continuous you would need some sort of symmetry or bump but then around the center of the bump you would have small variations lead to small variations... – DanZimm Jun 08 '14 at 15:13
  • @DanZimm Okay, if we forget the second part i.e. large variation leading to small variation thing. – Abdul Fatir Jun 08 '14 at 15:14
  • @AbdulFatir, the problem persists. You want $f(0.1)$ close to $f(0.9)$ as well as to $f(0.91)$. However, $f(0.9)$ is far from $f(0.91)$, so what can $f(0.1)$ be? – Karolis Juodelė Jun 08 '14 at 15:16
  • I tried abs$(\cos(20t^8))$: http://www.wolframalpha.com/input/?i=plot+abs%28cos%2820t%5E8%29%29+%28t+from+0+to+1%29 Give me a feedback...and you can edit coefficient and powers to fix it as you prefer... – MattAllegro Jun 08 '14 at 15:18
  • @KarolisJuodelė Forget the second part of the question. [0,1] -> [0,1] with large variation on small variation in input. – Abdul Fatir Jun 08 '14 at 15:18
  • @KarolisJuodelė if we forget large variation leading to small variation then we don't necessarily want $f(0.1)$ to be close to $f(0.9)$ – DanZimm Jun 08 '14 at 15:19
  • @AbdulFatir, by definition continuous function is one which translates small changes in argument to small changes in value. Of course, the changes of $\sin(1/x)$ may not seem so small, but that is a matter of definition. – Karolis Juodelė Jun 08 '14 at 15:20
  • 1
    @MattAllegro Post it as an answer so that I can atleast upvote it. :P – Abdul Fatir Jun 08 '14 at 15:26
  • @KarolisJuodelė I just realized that I didn't require continuity that much in my application. How stupid of me! sin(1/x) seriously man! Post |sin(1/x)| as an answer so that I can accept it. :| – Abdul Fatir Jun 08 '14 at 15:33
  • @AbdulFatir, what exactly is your application? I wonder if what you really need isn't $sin^2(\frac x {\text{large number}})$ or event a function defined to be $1$ for, say, numbers $p/2q$ where $p, q$ are integers, and $0$ elsewhere. – Karolis Juodelė Jun 08 '14 at 15:40
  • @KarolisJuodelė I needed a function to map colors while rendering Iterated function systems as fractals. I got the answer by the way. :) Thanks for your time. – Abdul Fatir Jun 08 '14 at 15:44

2 Answers2

2

The simplest is $x^n$ for $n$ large. It stays close to zero for a large range of $x$, then jumps up to $1$ at the end. If you want the peak in the middle, you can use $\frac 1{k(x-1/2)^n+1}$ for large $n,k$. It will be very sharply peaked around $1/2$

Ross Millikan
  • 374,822
1

One such function $[0,1]\to[0,1]$ may be $$f(t)=\text{abs}(cos(20 t^8))$$ or $$g(t)=1-\text{abs}(cos(20 t^8)).$$ You could do more test plots (e.g. on WolphramAlpha) to fix it as you like: you can change the coefficient ($20$), the exponent ($8$) or the whole polynomial.

One such function $$f(t)=\text{abs}(cos(p(t)))$$ ($p(t)$ polynomial) has much larger total variation $|\Delta f|$ for $t$ close to $1$ than $t^n$.

MattAllegro
  • 3,316