Wikipedia:Reference desk/Archives/Mathematics/2008 October 30

= October 30 =

Singularity functions in Ti-89/84+
Does anyone know how to plot singularity functions/use macaulay brackets in a Ti-89 or a Ti-84+? I need to be able to plot functions such as y = x^2 - ^3. So I need the ^3 term to only appear when x>5 (it's equal to zero when x<5). Thanks, --Fir0002 09:55, 30 October 2008 (UTC)
 * Do you have an abs function? If so you can simulate branching (abs(x)+x)/(2x) is 1 for x>0, 0 for x<0. I don't know if the if function can be used in a graph. --Salix (talk): 10:39, 30 October 2008 (UTC)
 * Actually the sign function will be easier for branching. y=x^2 - ((sign(x-5)+1)*(x-5)/2)^3. --Salix (talk): 10:48, 30 October 2008 (UTC)
 * ...and (x + abs(x))/2 equals x if x&ge;0 and zero if x&le;0, which gives the function y = x2&minus;(x&minus;5 + abs(x&minus;5))3/8 . --CiaPan (talk) 11:58, 30 October 2008 (UTC)
 * Those solutions are quite clever and thanks for your help, but they don't see very versatile - i.e. every singularity function I need to graph will (presumably) need another work around so it's not really what I was after... I guess there isn't a simple way unfortunately --Fir0002 23:23, 30 October 2008 (UTC)
 * You could try using the programming facilities. Can you make your own function say a function Macaulay(x) which uses the if statement for the branch. You could then use this function in your graphs. Looking at the manual this seems possible, but I don't have one to test. --Salix (talk): 08:14, 31 October 2008 (UTC)
 * For the 89 the when(..) function works to graph piecewise functions. It gets a little cumbersome when trying to do several pieces though I think. But you could use it to construct your function explicitly. GromXXVII (talk) 10:39, 31 October 2008 (UTC)

Complementary integer sequences
Define the following integer sequences:
 * $$a_n = n + \lfloor e^n \rfloor \quad n \ge 1$$
 * $$b_n = n + \lfloor \log(n) \rfloor \quad n \ge 1$$

Thus {an} = {3, 9, 23, 58, 153 ...} (OEIS A045650) and {bn} = {1, 2, 4, 5, 6, 7, 8, 10 ...}. These two sequences are complementary in the sense that every positive integer belongs to either {an} or {bn} but not both (i.e. the gaps in one sequence correspond to the members of the other sequence and vice versa).

If en and log(n) are replaced with certain other pairs of inverse functions, other complementary sequences are generated. For example:
 * $$c_n = n + \left \lfloor \frac {n^2+2n}{\pi} \right \rfloor \quad n \ge 1$$
 * $$d_n = n + \left \lfloor \sqrt {1+n \pi}-1 \right \rfloor \quad n \ge 1$$

yields {cn} = {1, 4, 7, 11, 16,...} and {dn} = {2, 3, 5, 6, 8, 9, 10, 12,...}.

The complementary nature of these sequences can be proved using a simple lattice counting method. Beatty's theorem is a special case. Does anyone know of any papers or previous results on this method of generating complementary sequences ? I found this Journal of Integer Sequences paper on "Complementary Equations" - is there anything else ? Gandalf61 (talk) 11:28, 30 October 2008 (UTC)


 * The generating functions of complementary sequences
 * $$a(x)=\sum_{n=0}^\infin a_n x^n$$
 * $$b(x)=\sum_{n=0}^\infin b_n x^n$$
 * obviously satisfies
 * $$a(x)+b(x)=\sum_{n=0}^\infin x^n=(1-x)^{-1}.$$ Bo Jacoby (talk) 10:44, 31 October 2008 (UTC).


 * Hmmm ? I don't see where that comes from. If {an} = {1} and {bn} = {2,3,4...} then (adjusting for indices starting at 1, not 0) we have
 * $$a(x)=x$$
 * $$b(x)=2x + 3x^2 + 4x^3 ... = \frac{1}{(1-x)^2} - 1 = \frac{2x-x^2}{(1-x)^2}$$
 * $$a(x)+b(x)=3x + 3x^2 + 4x^3 ... = \frac{2x-x^2}{(1-x)^2} + x = \frac{3x-3x^2+x^3}{(1-x)^2} \neq (1-x)^{-1}$$
 * Gandalf61 (talk) 15:13, 31 October 2008 (UTC)

Sorry, I ment to say
 * $$a(x)=\sum_{n=0}^\infin x^{a_n}$$
 * $$b(x)=\sum_{n=0}^\infin x^{b_n}$$

Bo Jacoby (talk) 15:48, 31 October 2008 (UTC).

The function of sines
after some calculation, i found out(in my calculations) that sinx=ABS((a-b)^0.5)(SGN(d-e)) where a=8(xMODc/2)/c b=16(xMODc/2)^2/c^2 d=c/2 e=xMODc x=the angle you want to sine c=number of angles to form a circle

in case you didn't know, ABS(y)= y changed into a positive sign SGN(y)=-1 for negative numbers, 0 for 0, and 1 for positive numbers

I couldn't check it because I don't have sufficient graphing tools on my computer. can you please check it for me?


 * What does "number of angles to form a circle" mean? Do you mean c = 2*pi/x? Does "xMODc/2" mean (x MOD c)/2 or x MOD (c/2)? To avoid misinterpretations it would be helpful if you could give a specific numerical example that you think comes right. 86.152.243.226 (talk) 14:46, 30 October 2008 (UTC)


 * I doubt that works. You can't really simplify sine, since it's a transcendental function. You can write it in terms of exponentials, or infinite series, but that's about it. I'll rewrite your equations in a slightly clearer form so we can work through it better (I'm assuming you mean c=2*pi, the angle subtended by a whole circle):
 * $$\sin(x)=\sqrt{a-\frac{a^2}{4}}\mathrm{sgn}(\pi-(x\,\mathrm{mod}\,2\pi))$$ where $$a=\frac{4}{\pi}(x\,\mathrm{mod}\,\pi)$$
 * Ok, now we have a few less variables floating around. Let's try an example. We'll take $$x=\frac\pi2$$. We get $$a=\frac4\pi\cdot\frac\pi2=2$$, which would give $$\sin(\frac{\pi}{2})=\sqrt{2-\frac{4}{4}}\mathrm{sgn}(\frac{\pi}{2})=1$$, which is correct, so far so good! Let's try $$x=\frac\pi3$$. This time we have $$a=\frac43$$ giving $$\sin(\frac\pi3)=\frac{2\sqrt2}3\mathrm{sgn}(\frac{2\pi}3)=\frac{2\sqrt2}3\neq\frac\sqrt32$$. So it doesn't work. Oh well! For something like this it is far easier to try lots of examples to check it is mostly correct before you try and prove it is always correct. --Tango (talk) 16:51, 30 October 2008 (UTC)


 * Your function is made of half-circles (half-ellipses, actually). A real sine curve isn't nearly so circular looking; it's actually pretty close to a triangle wave in appearance. It's common to see "sine" waves in illustrations that are actually made of half-ellipses (like this one). I think one reason is that many illustration programs support drawing ellipses but not many support drawing a real sine curve. Another reason might be that people expect the sine curve to be more circular than it is, because of its connection with circles. A real sine curve looks like this. -- BenRG (talk) 22:30, 31 October 2008 (UTC)