Time dilation

Written on 7 August 2015, 02:47pm

Tagged with: , ,

The passing of time can be altered by 2 factors, gravity and velocity.
Increase in both gravity or velocity will slow down time.
1. Gravity: Everything likes to live where it will age the most slowly, and gravity pulls it there (Kip Thorne – the Science of Interstellar)
2. Velocity: A space traveler approaching the speed of light will age slower than another one staying on the earth (Twin paradox).
What does this mean?

On the ISS, time runs slower because of the high speed

Altitude: about 400km
Orbital speed: 8km/s
Time dilation: 0.01 seconds slower every year
The smaller gravity pull from the Earth accelerates the time, but not enough to compensate for the velocity of 8km/s which slows down time. So in the end, an astronaut spending 6 months on the ISS will be about 0.005 seconds younger.

[On the ISS] Velocity has increased for the astronauts, slowing down their time, whereas gravity has decreased, speeding up time (the astronauts are experiencing less gravity than on Earth). Nevertheless, the ISS astronaut crew ultimately end up with “slower” time because the two opposing effects are not equally strong. The velocity time dilation is making a bigger difference, and slowing down time. The (time-speeding up) effects of low-gravity would not cancel out these (time-slowing down) effects of velocity unless the ISS orbited much farther from Earth.

On the GPS satellites, time runs faster because of the decrease of gravity

Altitude: 20.000km
Orbital speed: 4km/s
Time dilation due to velocity: 7 microseconds per day
Time dilation due to less gravity: 45 microseconds per day

The combination of these two relativistic effects means that the clocks on-board each satellite should tick faster than identical clocks on the ground by about 38 microseconds per day (45-7=38)! This sounds small, but the high-precision required of the GPS system requires nanosecond accuracy, and 38 microseconds is 38,000 nanoseconds. If these effects were not properly taken into account, a navigational fix based on the GPS constellation would be false after only 2 minutes.
The engineers who designed the GPS system included these relativistic effects when they designed and deployed the system.
GPS and relativity
[Contrary to popular belief, GPS satellites are not in geosynchronous or geostationary orbits). The satellite orbits are distributed so that at least 4 satellites are always visible from any point on the Earth at any given instant (with up to 12 visible at one time)]

Inspired by: The Science of ‘Interstellar’ Explained (Infographic)

Computer entropy

Written on 6 May 2015, 08:55am

Tagged with: , ,

I recently had an issue with a Tomcat server taking very long to restart. It was bizarre because when the system was starting, the Tomcat server was taking about 20-30 seconds to start, but a subsequent Tomcat restart was taking 20-30 minutes.
The logs indicated that the following step was taking a lot of time:
INFO: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [135172] milliseconds.

This lead to the Tomcat page with advice on faster startup. The problem was – Tomcat was using /dev/random as source of randomness, and when the entropy pool was exhausted, this device was blocking.
This explained why the problem was not manifesting right after system restart: because of the associated ‘noise’, there was a lot of entropy. But after the system was stable, the entropy pool was depleted.

The solution to this is to tell Tomcat to use the non-blocking /dev/urandom device instead of /dev/random:

When read, the /dev/random device will only return random bytes within the estimated number of bits of noise in the entropy pool.

A counterpart is /dev/urandom (“unlimited”) which reuses the internal pool to produce more pseudo-random bits. This means that the call will not block, but the output may contain less entropy than the corresponding read from /dev/random.

So, to make Tomcat use /dev/urandom you have 2 options:
1. As indicated in the Tomcat slow startup troubleshooting guide: Configure JRE to use a non-blocking entropy source by setting the following system property: Djava.security.egd=file:/dev/./urandom

2. Change the $JAVA_HOME/jre/lib/security/java.security settings file:
instead of

More about entropy


Some questions

Written on 9 April 2015, 07:48pm

Tagged with: ,

The 3 questions interviewers ask

Can you do the job?
Will you do the job?
Can you work with the others?

Apparently all the interview questions gravitate around these 3 questions.

The five WHYs

Two stories about how many times you must ask ‘why’ before you find the root cause of a problem:

Q: “Why did you submit a purchase requisition for $750?”
A: “Because we need to purchase 150 staplers!”
Q: “Why do you need to purchase 150 staplers?”
A: “Because our agents need to staple the pages of the driver’s license application together.”
Q: “Why do they need to staple those pages together?”
A: Because […]

In the late 1980s, the parks service in the United States were concerned about the deterioration of the stonework on the Lincoln Memorial. So they asked the maintenance staff why the stone was decaying.

The crew needed to spray to get rid of the large volume of bird droppings. So they erected bird nets. These scarcely worked, and were unpopular with tourists, so the parks service called in the maintenance workers again and asked, ‘Why are there so many birds?’

‘The birds come to feed on the spiders,’ they said. ‘And the spiders are there to eat the midges.’ After dark, midges covered the memorial. The spiders came to eat the midges, and the birds came to eat the spiders. So the executives tried insecticides. But this also proved ineffective: the bugs came back. So the committee finally asked one more question. Why are there so many midges in the first place?
It is a wonderful story, and has entered folklore in a philosophy called ‘the five whys’. The idea is that you should always go on asking ‘why’ in order to get to the root cause of a problem rather than the proximate cause. If you do this, what at first appears to be a masonry problem may turn out to be a problem about lighting design and insect behaviour.
Why plane crashes are getting weirder