Thursday, July 25, 2013

In case you survive a disaster ...

... prepare a statement, lest you get caught unawares and make some foolish but unfortunately common statement, as in the following case.
At the end of an interview with a survivor of the train wreck in Galicia, after the survivor had described the chaos and panic and described hearing victims and seeing a trapped friend, the interviewer asked her, "How do you feel at having survived?". The survivor would have been justified in decking the journalist, or if she really wanted to respond with banalities, she could have said, "Numb." or "Shocked." or "I don't know what to think." or "It was so recent, there is so much turmoil inside me, I don't know what I feel."

Instead, her response was the all too common, "Thanks be to God! A miracle!"

If you don't have problems with that statement, you have rocks in your head. Now, since she is from a good little culturally Catholic country, we can safely assume she meant "miracle" and not "Miracle". But what was the miracle? That 300+ survived? That 80 people died? That only 80 people died? That 80 people died and she was one of the 300 odd survivors? That her God made the right choice in deciding which people to off and which ones to save? That this was a sign that she is special, and that as a corollary, the victims were not? That the families of the survivors should take consolation that they were simply the necessary collateral damage from the miracle? after all if every one had survived or everyone had died then there would have been no miracle.  

Or perhaps the miracle is that her god tolerates such lack of humility and empathy with the victims.

Tuesday, July 2, 2013

Solutions: Shortest distance between two skew lines in 3D

See the previous post for the question.

U mode: there are only 4 given things, two (n1 and n2) are already vectors, each tangent to its line. From the other two things, construct the difference, d = C1C2, which is a vector joining the two lines. Since the tangent vectors may be parametrization dependent, which we don't want, perhaps they have to be normalized.
Then the shortest distance has to be proportional to |d·n1 X n2|. The simplest way to determine the proportionality constant would be to do it for some test cases: pairing in each case the x-axis (s, 0, 0) with one of: (0, s, 0), (s, 1, 0), (0, s, 1), (s, s, 1) etc. and for different choices of points along the lines.

BTW the conjectured formula fails for one of the above, even though the shortest distance is well-defined. From the computational geometry point of view, the formula is computationally fragile in that is certain special cases it will be very sensitive to machine precision rounding errors.

I mode: The shortest distance between the two lines has to be the length of a segment perpendicular to both. (Why?) Hence that line segment has to be parallel to S = n1 X n2, and the distance between the two given lines is the length of that line segment.
How do we find its length if we don't even know where it lies?
We could, in M-mode, find that line by doing all sorts of stuff requiring that it intersect L1 and L2, then finding its intersection points and finally the distance between them.
Or, in U-mode, we could notice that the projection onto the unit vector s = S/|S| -of a segment joining any two points one each on the two original lines- is exactly the length of the shortest segment. How so? The line joining any two points one each on the original lines is a linear combination of s, n1 and n2. So projecting it onto s, since s n1 and s n2, will yield exactly its component along s, which is d. I know this sounds as if I've been going around in circles, but what all the above means is that we can take any two arbitrary points on L1 and L2, say C1 and C2, and calculate
d = |(C1C2)s|.

This yields the proportionality constant we were looking for in U mode, the reciprocal of the norm of S.

Another way of thinking about the solution in I mode is that the answer we are looking for is the distance between two parallel planes each of which contains one of the given lines.

Friday, June 28, 2013

Shortest distance between two skew lines in 3D

This is one of the problems from the 1980 JEE that I didn't get, and one of two that still bother me. It is easy enough to remember, the entire problem is stated above.

Assume that the two lines are given in parametric form
L1(s1) = n1s1 + C1 and
L2(s2) = n2s2 + C2
where s1, s2 in (-infinity, infinity), C1 and C2 are points on their respective lines and n1 and n2 are tangent vectors.

(If they are not in parametric form, or the parametrization is not linear (w.r.t. the coordinates), a linear parametrization can always be found. E.g, starting from two planes (themselves specified as a linear relation between the three Cartesian coordinates), the two normals to each can be found. The tangent to the intersection line is the cross product or wedge product of these two normals. Then C can be found by requiring that the line belong to the two planes.)

(What is a non-linear parametrization of a line? Consider the line given by:
L(s) = (1/s)i + (0,2,3). The closure of the set of points is the line parallel to the X-axis which intersects the y-z plane at y=2, z= 3, although in terms of the s parameter you never reach that point. This line can be parametrized as L(t) = t i + (0,2,3).)

M mode: Construct |L1L2| or its square and minimize by taking the derivative w.r.t. s1 and s2. What a lot of work!

Pretty answer next week!

Saturday, May 11, 2013

Richard Feynman's 95th Birthday

Thank you Antra for the reminder!

Here are a few picks from the internet:

This video captures beautifully my thoughts on art and the endless arguments I have with artists about nature, science and art.

But Bloomsbury celebrates Feynman

what is science in 63 seconds

Feynman wiki

Gleick's fabulous biography

Feynman's video, and revisiting my own post, brought up some memories:

I'd once asked a fellow-scientist who was also an artist why she painted, and she responded with I believe a quote, that painting is an excuse to gaze upon nature. Not quite as terse as "because I can" nor "because it is there", but in the same space. I knew a painter in Madrid - Javier Fernandez Lizan, and on my first visit to his studio, at some point, after the above conversation, I asked Javier why he painted. Javier responded by taking me to a massive 8'X10' abstract still life with human figures, in oil, and showed me a 2 or 3 square inch area, and said "to capture this blue".

Why did I do science? Why do I analyse data now?
"Because it is there!"
"Because I can!"
"Because it is an excuse to gaze upon nature!"
"Beacuse I want to capture "this blue", which is in my head, and speaks to me, and I want to express it!"
"Because I am an instrument of "this blue"'s meme, and it expresses itself through me!"

So, I have never understood why it is that while most scientists find commonalities with artists ( my thoughts on art notwithstanding!), most artists keep trying to distance themselves from scientists! 

Monday, March 11, 2013

Tennis Ball Cannon

Made as part of a team-building contest at my company.

Some stills:
not bad for accuracy!
 The tennis ball is top center left, its shadow is just left of target! At 25 m distance, the precision was 3m in length and 1m in width. The pieces of bark and stones mark the "hits".

multi-launch
 Immediate post-launch: Elsa wanted to launch as many as possible simultaneously, we got up to 4!
Four in the air

Piston at full post-launch extension.

Looking down the mouth of a loaded cannon - see how much I trust Maya.
A 2 -minute video compilation

Friday, December 21, 2012

Why I am sad it is not a re-collapsing universe

Why I am soooooo sorry that we are apparently (meaning according to the latest astronomical data and relativistic cosmologies) no longer in a closed (re-collapsing) universe. According to the latest, the expansion of the universe is decelerating, but at an ever lower deceleration which will cumulatively not be enough to turn the expansion around. 

How terribly sad! Suppose that there were to have been enough mass density in the universe to cause the universe to stop expanding and then to contract. Then there are theorems in GR which state that within a finite time everything will recollapse to a final singularity. 

Now, listen closely: We would then already be INSIDE the event horizon of the final singularity. Yes, you, me, the earth the sun the solar system the galaxy the local cluster the supercluster etc. You don't notice anything different do you? No "the earth shook" nor nothing, nada? 


Being inside the event horizon of a sufficiently large, isolated Black Hole would feel exactly the same.

"But if I was inside the event horizon of a Black Hole wouldn't I be able to see the Black Hole I was falling towards!?"

Nope! A Black Hole, like any final singularity, is like next Monday. You can't see "next Monday" can you?

End of the World

In case you missed it, the world did end, exactly according to prophecy. The end of the world started at the barycentre of the pyramid of the magician in the Yucatan and radiated out at the speed of light.

But the idiots who translated the prophecy forgot to translate the second page, which also prophesied that a new world would start with exactly the same initial data as was present on the outgoing lightcone of the end-of-the-world event. You didn't notice anything did you?

But what I really don't get is the self-hating "Westernized" Hindoos who fall all over each other to believe in the "new-age misinterpretation of Mayan calendar - the Maya Y2K" end of the world prophecy. Don't we have enough of our own revered and ancient crackpot astroboogers to believe in? Why do you have to outsource your insanity and take away domestic jobs from our own jyotishis and jadi-booti vendors?

Physics Phriday - It is a Time Machine

From Jack van Ryswyck:
You know it's funny you should mention that. The other day I suddenly saw Mike vanish before my very eyes, desk chair and all. Left in his place was a box shaped area of seemingly totally empty space, filled with absolutely nothing but some strange looking radiation.

Two seconds later Mike suddenly reappeared, looking very normal. In fact, looking rather exactly like he had at the moment he vanished. He then looked at me as if I had done something totally strange.

He told me that he had not seen anything vanish at all, but to him it looked like I instantaneously had shifted position and facial expression, as if I were an old time movie that had skipped a few frames. We then noticed that the atomic clocks that we had coincidentally been carrying were inexplicably off by 2 seconds. We had just synchronized them earlier that morning, but now his was 2 seconds behind mine.

Some time later a very similar thing happened, but this time a part of his desk chair stayed behind when Mike and the rest of his chair vanished. The remaining part of his chair just got cut clean off and fell to the floor. Mike and the rest of the chair reappeared two seconds later, though the chair did not reassemble. He said that he saw part of his chair suddenly teleported to the floor instantly.

Then the other day Josh and I were passing juggling balls when the same thing happened again. Suddenly everything in the box shaped area vanished, and many copies of a juggle ball appeared, all moving in a parallel direction. I then found myself tossing a juggle ball into the box. Oddly enough it happened to have the same colour as all the copies, and by some mysterious coincidence it was moving in just the same direction. Two seconds later all but one of the balls disappeared, and everything else reappeared. At the far side of the box, one juggle ball flew off. The net effect was just as if I had thrown the ball across the box incredibly fast. Impossibly fast really.

The next time it happened I saw the empty box appear filled with many copies of about one-third of a juggle ball. All but one of them were moving in a parallel direction away from me, but the nearest copy seemed to be moving towards me. In self defense I grabbed the juggle ball nearest to me, which happened to be the same colour, and as a makeshift missile defense system I threw it against the partial juggle ball that was moving menacingly towards me. They collided. The partial ball got knocked into a trajectory parallel to all the others. My defense missile ball got nudged back towards me. Then all the partial balls disappeared, except one that flew off at the far side. My defense missile ball was suddenly missing about a third of it. The remainder fell to the floor. The part that fell to the floor on the other side of the box seemed to fit it exactly.

Weird.

Friday, December 14, 2012

Physics Phriday

Take your time on this one, as many times as you wish.


The first image is a model of a 1+1 dimensional spacetime, the time axis is vertical, the x axis is horizontal, the speed of light is 1, the orange cone is the light cone and the blue line is the world line of any physical object. At any point on it the world line is confined to the future (+) and past (-) of the light cone at that point, and the point always moves forward in time.
 


In the second image, I've done some "manifold surgery": I've made a cut each at t = -1 and t = +1 each of which extends from x=1 to x=3. Now I restitch them, but stitch the bottom edge of the lower cut to the top edge of the upper cut, and also the top edge of the lower cut is stitched to the bottom edge of the upper cut.

What have I built?

Friday, December 7, 2012

Mirror Mirror

Sex advice to the young (25 year-olds)


Not to the “young at heart”, just “young”.

If you expect to have a long and satisfying sex life, or just a long sex life, you should now start fucking a 30-year old, a 40-year old, a 50-year old, a 60-year old, a 70-year old … because if you expect to have a long sex life and hence a satisfying one, at some point you will be fucking a 30-year old, a 40-year old, a 50-year old, a 60-year old, a 70-year old …

… or you will be fucking somebody who is at that moment fucking a 30-year old, a 40-year old, a 50-year old, a 60-year old or a 70-year old …

… so you might as well start getting accustomed to it now.