Archive for December, 2007
sin() and Google Images
Thursday, December 6th, 2007Go to Google Images and search for any picture. In the browser’s address bar copy and paste this:
javascript:R=0; x1=.1; y1=.05; x2=.25; y2=.24; x3=1.6; y3=.24; x4=300; y4=200; x5=300; y5=200; DI= document.images; DIL=DI.length; function A(){for(i=0; i<DIL; i++){DIS=DI[ i ].style; DIS.position='absolute'; DIS.left=Math.sin(R*x1+i*x2+x3)*x4+x5; DIS.top=Math.cos(R*y1+i*y2+y3)*y4+y5}R++}setInterval('A()',5 ); void(0)
Press Enter.
Explain what happens. In other words, explain the code above.
When you have to explain the sin() function to the guy sitting next to you on the bus or in the dentist’s waiting room, try this as your starting point and tell me how it went.
Problem source: Crazy Cool Internet Trick! by Justin Benton.
Quote
Thursday, December 6th, 2007Seeing is not seeing
Wednesday, December 5th, 2007Quote
Wednesday, December 5th, 2007Images in comments
Tuesday, December 4th, 2007At the moment it is not possible to display externally stored images in comments without me going in an editing the comment. You may, of course, give the url of the image for people to click.
When pMachine was used [img] url of the image [/img] was allowed. To allow it with WordPress I need to edit the program. Can anyone tell me how? I have searched the Internet, but with no success.
I guess all that is needed is to replace every occurrence of [img] url of the image [/img] with <img src=”url of the image” alt=”image” />.
Red points
Tuesday, December 4th, 2007Erich Friedman is a math professor and puzzle enthusiast. Red points is his own creation. Colour five of the points in the image above red in such a way that the distance between any two of them them are all different. That is ten distances, by the way.
Here, is an example:
Quote
Tuesday, December 4th, 2007Another way to multiply
Monday, December 3rd, 2007Richard Sabey has kindly submitted this dialogue as a reaction to the post A way to multiply.
A: What did you think of my way to multiply?
B: It works, I’ll give you that, but I find it more awkward to use than the usual way. I prefer to use a table.
A: Multiplication tables are OK as far as they go, but they’re rather bulky.
B: The usual sort are, yes. With 1<=a, b<=1000 there are 1,000,000 products, and the usual sort of multiplication table would need 500,500 entries, because you might as well take a<=b. The sort of table I use can handle a+b<=2000, which is 1,999,000 products, with just 2000 entries.
A: That sounds neat. How does it work?
B: The table is a table of quarter squares. It starts like this:
n q(n)
1 0
2 1
3 2
4 4
5 6
6 9
7 12
8 16
9 20
A: I hate to disappoint you, but a quarter of 3 squared is not 2.
B: I know, it’s 2 and a quarter. It doesn’t matter, though; the odd quarters cancel anyway. So, given a and b, with a<=b, you first find their sum s = a+b and difference d = b-a. Then ab = q(s) – q(d).
Note that, if a and b have the same parity, then s and d are both even, and there are no odd quarters; if one is odd and the other is even, then s and d are both odd, so both their TRUE quarter-squares are an integer and a quarter, so the quarters cancel when you do the final subtraction.
Your way [in A way to multiply] is in effect a(b²-a²)/(b+a) + a² = ab as Michael Maguire proved. So that needs two squarings (which you could look up in a table), a subtraction, two additions, and, worst of all, a multiplication and a division. Since all you wanted to do was a multiplication, it seems more trouble than it’s worth. My method involves an addition, two subtractions, two lookups, NO multiplications and NO divisions! Simple, don’t you think?
—
Let’s test the method. 2 x 3 = q(2+3) – q(3-2) = q(5) – q(1) = 6 – 0 = 6. Another example, 19 x 52 = q(19+52) – q(52-19) = q(71) – q(33) = 1260 – 272 = 988. It works! So, today’s question: “Simple, don’t you think?”
If I want to learn how to multiply any integers up to 10 I could learn 45 elements in the multiplication table or the 21 elements in q(0) to q(20) . The multiplication table has many patterns. What about patterns in the list q(0) to q(20)? For example, let’s say I remember that q(16) = 64, but need q(15), what do I do?
“Table of Quarter-squares of All Integer Numbers Up to 100,000, …” by Samuel Linn Laundy was published in 1856. You can read and download it here .










