User:Melab-1/This Function

On Reference Desk/Math

This function
How would I represent this function as an equation: -- --Melab±1 19:11, 9 November 2008 (UTC)


 * It can't be done as a single equation. The best you can do is something like:
 * $$f(x)=\begin{cases}(x-n)-1, & n\le x<n+2, \,n\equiv3 \,(\mathrm{mod}\,4) \\

1-(x-n), & n\le x<n+2, \,n\equiv1 \,(\mathrm{mod}\,4) \end{cases}$$
 * --Tango (talk) 19:23, 9 November 2008 (UTC)
 * I'm pretty sure it can be using things like mod and the floor function. --Melab±1 19:30, 9 November 2008 (UTC)
 * I don't see how, those functions aren't periodic. If there is some way of doing it, it will be very convoluted, I think my way is better. Is there some reason you absolutely need it as a single equation? --Tango (talk) 19:36, 9 November 2008 (UTC)
 * $$f(x) = ({1 \over 2}-\lfloor x \rfloor \text{ (mod 2)})*(x-\lfloor x \rfloor - {1 \over 2})$$
 * You need to take x -> x + 0.5 if you really care about starting at f(x) = 0. Dragons flight (talk) 19:45, 9 November 2008 (UTC)
 * Ah, that mod, I thought the OP was talking about absolute value. Yes, using that kind of mod it might work. I'm not sure that formula works, though, I get f(1)=1/4 when I think it should be 1/2 (assuming the scale on the graph is one character equalling 1). --Tango (talk) 19:54, 9 November 2008 (UTC)
 * Also:
 * $$f(x) = ({1 \over 2} + 2 \lfloor {x \over 2} \rfloor - \lfloor x \rfloor)*(x-\lfloor x \rfloor - {1 \over 2})$$
 * It oscillates between -1/4 and +1/4, and starts at -1/4 for x = 0. Scale and stretch to taste.  Dragons flight (talk) 20:04, 9 November 2008 (UTC)


 * How about arcsin(sin(x)) ? Dmcq (talk) 21:10, 9 November 2008 (UTC)
 * bravo! How did you come up with that?  (I tried it here http://www.walterzorn.com/grapher/grapher_e.htm - though firefox crashed the first time)  —Preceding unsigned comment added by 82.124.214.224 (talk) 21:29, 9 November 2008 (UTC)
 * I just stuck that formula into google and it comes up with loads of entries so there's lots of people just as twisted or more than me.Dmcq (talk) 23:39, 9 November 2008 (UTC)
 * I mean, how did you come up with the formula -- how did you think it through from first principles or reduce it from a similar equation above or try a lot of things like that (trial and error) or.... —Preceding unsigned comment added by 82.124.214.224 (talk) 01:37, 10 November 2008 (UTC)
 * Also consider the possibility of representing your function by its Fourier series; a series of sines indeed:
 * $$\arcsin(\sin(x))=\frac{4}{\pi}\Big\{\sin(x)-\frac{\sin(3x)}{9}+\frac{\sin(5x)}{25}-\frac{\sin(7x)}{49}+\frac{\sin(9x)}{81}-\frac{\sin(11x)}{121}...\Big\}$$

--PMajer (talk) 13:26, 10 November 2008 (UTC)
 * I see if I'd actually looked up wikipedia I'd have got both the formula I gave and the Fourier series in Triangle wave. Dmcq (talk) 14:27, 10 November 2008 (UTC).
 * Amazing, wikipedia contains everything...--PMajer (talk) 14:37, 10 November 2008 (UTC)
 * At this rate, we might as well just replace the Ref Desks with a link to Special:Search... --Tango (talk) 14:58, 10 November 2008 (UTC)
 * I tend towards Inclusionism but I guess there's a point of deleting things otherwise it'll become like Jorge Luis Borges's The Library of Babel Dmcq (talk) 16:13, 10 November 2008 (UTC)
 * Deleting things just to keep ref deskers in business would be a questionable policy, though! My comment was in jest. --Tango (talk) 16:38, 10 November 2008 (UTC)