Wikipedia:Reference desk/Archives/Mathematics/2010 September 1

= September 1 =

Rotation matrix: counterclockwise vs. clockwise
Hello, I am trying to teach myself algebraic matrices. I seem to understand them, and am getting right answers, except in one particular case. For the life of me, I can't understand why the matrix for a 90-degree counterclockwise rotation is what it is.

We are told (for example at Rotation matrix) that the 90-degree counterclockwise rotation matrix is

R(90^\circ) = \begin{bmatrix} 0 & -1 \\[3pt] 1 & 0 \\ \end{bmatrix}$$ but to me that looks like a clockwise rotation. Consider the illustration at Matrix_(mathematics), which represents the transform of the unit square by the matrix



A = \begin{bmatrix} a & b\\c & d \end{bmatrix}\, $$

If we plug in the numbers from the above counterclockwise rotation matrix, then the (a,b) vertex — originating at (1,0) as a corner of the unit square — is transformed to (0, –1). No? Meanwhile the (c,d) vertex, originating at (0,1), is transformed to (1,0). To me that produces a clockwise rotation: The unit square has been rotated such that it is now below the x-axis but still to the right of the y-axis. What gives?

I get the same result when I multiply the row vectors of the unit square [0 0], [1 0], [1 1], [0 1] (also from Matrix_(mathematics)) by the 90-degree counterclockwise rotation matrix above. This seems to produce the vertices [0 0], [0 –1], [1 –1], [1 0] — which again describes a clockwise rotation below the x-axis.

What am I misunderstanding about this interpretation of the rotation matrix? It is particularly vexing since I've had success with every basic type of transform, except for rotations greater or less than 180 degrees. Help is greatly appreciated. -Jordgette (talk) 00:16, 1 September 2010 (UTC)


 * My guess is that the mistake is in your matrix multiplication. Using your matrix A, $$A\begin{bmatrix}1\\0\end{bmatrix}=\begin{bmatrix}a\\c\end{bmatrix}$$.  Perhaps you were calculating $$\begin{bmatrix}1&0\end{bmatrix}A=\begin{bmatrix}a&b\end{bmatrix}$$?  The convention is to use column vectors and (therefore) multiply with the matrix on the left and the vector on the right.  Given A and v, $$\mathbf{v}^{\mathrm{T}}A=(A^{\mathrm{T}}\mathbf{v})^{\mathrm{T}}$$, so reversing the multiplication (and transposing v to make the multiplication work then) is equivalent to transposing A, which in your case makes it equal to -A, so of course it generates the negative of the vector that you want (which is equivalent to a further rotation by 180° and changes 90° to -90°).  --Tardis (talk) 02:13, 1 September 2010 (UTC)


 * I was multiplying a row vector on the left and the matrix on the right. That would be my mistake. Thank you for taking the time. -Jordgette (talk) 07:04, 1 September 2010 (UTC)

Convert procedure to formula?
How do I convert something like: if(x>50) y=(30+x), else y=(x/2), to an equation of the form y = f(x)?

Is this a standard 'area' of mathematics, if so what is it called, and where can I go online to learn it?

I have also seen precedures that involve for/while loops that I know should be representable as a single mathemtical function and shouldn't need interation. But I have no clue how to build a function from the procedure. Can anyone point me in the right direction? Thanks.--Dacium (talk) 03:27, 1 September 2010 (UTC) x/2, & \mbox{if } x \leq 50 \\ 30+x, & \mbox{if } x > 50 \end{cases} $$. Essentially it's saying the same thing that you've expressed as an "if-else" or another programming function that involves selecting cases based on the input. -- Kinu t /c  03:50, 1 September 2010 (UTC)
 * To answer the first part of your question, it looks like what you want is a Piecewise function... the value of x (i.e., where it is in the domain) determines which piece of the function you're using to evaluate the dependent variable: $$f(x) = \begin{cases}

Selecting cases is avoided by using Iverson brackets: y=[x>50]&middot;(30+x)+[x≤50]&middot;(x/2). For-loops are avoided by using J. Bo Jacoby (talk) 05:58, 1 September 2010 (UTC).
 * You could also use Recursion to avoid for loops.
 * For some for loops it may be posible to replace the loop by a simple formula without recursion. For instance  is an arithmetic progression and could be replace by the simple function $$\frac{n (n-1)}{2}$$. Similar results could be obtained for other loops but I'm not aware of a general procedure, the article Series (mathematics) might be of help.--Salix (talk): 08:45, 1 September 2010 (UTC)

Corresponding J expressions may be written n=.10 +/1+i.n NB. brute force summation without for loop 55   n*(n+1)%2 NB. computing the sum 55 Salix alba ment to write $$\scriptstyle \frac{n(n+1)}2$$. Bo Jacoby (talk) 10:08, 1 September 2010 (UTC)

Another number theory problem
I have two problems:
 * If p is an odd prime, show that every prime divisor of $$2^p-1$$ must be of the form 2pk+1 for some natural number k.
 * If $$f_n$$ are the Fibonacci numbers then show that Euclid's algorithm takes n steps to determine gcd$$(f_{n+2},f_{n+1})$$. I have been racking my brain on this one (the first one I have no idea about), using induction etc but to no avail. -Shahab (talk) 13:05, 1 September 2010 (UTC)
 * The second one's pretty trivial: the Euclidean algorithm constructs a sequence of numbers, whose first two elements are fn+2 and fn+1. What is the third element?—Emil J. 13:11, 1 September 2010 (UTC)
 * As for the first one: you want to show that $$2^p-1\equiv1\pmod{2p}$$, or in other words, $$2^p\equiv2\pmod{2p}$$. You can work mod 2 and mod p separately, as p is odd. The rest is Fermat's little theorem.—Emil J. 13:19, 1 September 2010 (UTC)
 * Thanks Emil for part 2. But for the 1st part I dont understand as to how you concluded that I wished to show $$2^p-1\equiv1\pmod{2p}$$ or equivalently $$2^p-1=2kp+1$$ for some k. Could you be a little more explicit. Thanks-Shahab (talk) 14:05, 1 September 2010 (UTC)
 * Sorry, I misread the question. So, we have a prime divisor q | 2p − 1, and we want to show that $$q\equiv1\pmod{2p}$$. It's clear mod 2, so we only need it mod p. Now, consider the multiplicative order k of 2 modulo q. The assumption gives k | p, and Fermat's little theorem gives k | q − 1. Conclude p | q − 1.—Emil J. 14:16, 1 September 2010 (UTC)
 * Thanks. I have another problem, (sorry for posting so many, I am appearing for an exam after a long long time). If gcd(a,b,c)lcm[a,b,c]=abc then show that (a,b)=(b,c)=(c,a)=1.-Shahab (talk) 21:33, 1 September 2010 (UTC)
 * Hi Shahab. For any prime $$p,$$ let the nonnegative integers $$\alpha$$ $$\beta$$ $$\gamma$$ be the exponents of the greatest powers of $$p$$ that divide $$a,$$ $$b,$$ respectively $$c$$. Then $$\min(\alpha, \beta,\gamma)+\max (\alpha, \beta,\gamma)=\alpha+ \beta+\gamma$$, and from this you have to deduce that at most one out of $$\alpha, \beta,\gamma$$ is positive (meaning that $$p$$ divides at most one out of $$a, b, c$$). You may think w.l.o.g. that $$\scriptstyle 0\le\alpha\le\beta\le\gamma,$$ of course.--pm a 00:38, 2 September 2010 (UTC)
 * Thanks pma. I hope you are doing well.

Name of a curve
Say A is an arbitrary smooth curve, and P is some point on that curve. I draw a line normal to A through P, and I mark off point Q on the line such that PQ is some constant distance. I then trace the locus of Q as P moves along A, thus forming a new curve B. Is there a name for the relationship between curves A and B? I vaguely had in mind "evolute", but looking that up I see it means something completely different. —Preceding unsigned comment added by 86.135.28.150 (talk) 13:59, 1 September 2010 (UTC)
 * B is more or less a parallel curve of A.—Emil J. 14:07, 1 September 2010 (UTC)
 * Yes, it is indeed a parallel curve. I have added this ref (the first) to Parallel curve. DVdm (talk) 14:21, 1 September 2010 (UTC)
 * Thanks (duh). 86.184.27.6 (talk) 17:14, 1 September 2010 (UTC)