vttoth

I am a software developer and author of computer books. I also work on some problems in theoretical physics. For more information, please visit my personal Web site at http://www.vttoth.com/.

Jan 312018
 

Here is a beautiful picture of the contents of one of our litter boxes:

What makes it beautiful, you ask? Why, it is a thermal infrared image. And it shows some unambiguously fresh poop. Fresh poop produced just a few minutes prior by our kitty Pipacs, whom we were about to write off two weeks ago, as we were certain that his digestive system shut down, him being unable to poop as his bowels are obstructed by an invasive bone growth.

But Pipacs still has a few of his nine little lives left. I don’t know how long he’ll stay with us; we take it one day at a time. But with the medication he receives (a combination of laxatives and stool softeners) he is coping for the time being.

 Posted by at 4:48 pm
Jan 302018
 

I was surprised by the number of people who found my little exercise about kinetic energy interesting.

However, I was disappointed by the fact that only one person (an astrophysicist by trade) got it right.

It really isn’t a very difficult problem! You just have to remember that in addition to energy, momentum is also conserved.

In other words, when a train accelerates, it is pushing against something… the Earth, that is. So ever so slightly, the Earth accelerates backwards. The change in velocity may be tiny, but the change in energy is not necessarily so. It all depends on your reference frame.

So let’s do the math, starting with a train of mass \(m\) that accelerates from \(v_1\) to \(v_2\). (Yes, I am doing the math formally; we can plug in the actual numbers in the end.)

Momentum is of course velocity times mass. Momentum conversation means that the Earth’s speed will change as

\[\Delta v = -\frac{m}{M}(v_2-v_1),\]

where \(M\) is the Earth’s mass. If the initial speed of the earth is \(v_0\), the change in its kinetic energy will be given by

\[\frac{1}{2}M\left[(v_0+\Delta v)^2-v_0^2\right]=\frac{1}{2}M(2v_0\Delta v+\Delta v^2).\]

If \(v_0=0\), this becomes

\[\frac{1}{2}M\Delta v^2=\frac{m^2}{M}(v_2-v_1)^2,\]

which is very tiny if \(m\ll M\). However, if \(|v_0|>0\) and comparable in magnitude to \(v_2-v_1\) (or at least, \(|v_0|\gg|\Delta v|\)), we get

\[\frac{1}{2}M(2v_0\Delta v+\Delta v^2)=-mv_0(v_2-v_1)+\frac{m^2}{2M}(v_2-v_1)^2\simeq -mv_0(v_2-v_1).\]

Note that the actual mass of the Earth doesn’t even matter; we just used the fact that it’s much larger than the mass of the train.

So let’s plug in the numbers from the exercise: \(m=10000~{\rm kg}\), \(v_0=-10~{\rm m}/{\rm s}\) (negative, because relative to the moving train, the Earth is moving backwards), \(v_2-v_1=10~{\rm m}/{\rm s}\), thus \(-mv_0(v_2-v_1)=1000~{\rm kJ}\).

So the missing energy is found as the change in the Earth’s kinetic energy in the reference frame of the second moving train.

Note that in the reference frame of someone standing on the Earth, the change in the Earth’s kinetic energy is imperceptibly tiny; all the \(1500~{\rm kJ}\) go into accelerating the train. But in the reference frame of the observer moving on the second train on the parallel tracks, only \(500~{\rm kJ}\) goes into the kinetic energy of the first train, whereas \(1000~{\rm kJ}\) is added to the Earth’s kinetic energy. But in both cases, the total change in kinetic energy, \(1500~{\rm kJ}\), is the same and consistent with the readings of the electricity power meter.

Then again… maybe the symbolic calculation is too abstract. We could have done it with numbers all along. When a \(10000~{\rm kg}\) train’s speed goes from \(10~{\rm m}/{\rm s}\) to \(20~{\rm m}/{\rm s}\), it means that the \(6\times 10^{24}~{\rm kg}\) Earth’s speed (in the opposite direction) will change by \(10000\times 10/(6\times 10^{24})=1.67\times 10^{-20}~{\rm m}/{\rm s}\).

In the reference frame in which the Earth is at rest, the change in kinetic energy is \(\tfrac{1}{2}\times (6\times 10^{24})\times (1.67\times 10^{-20})^2=8.33\times 10^{-16}~{\rm J}\).

However, in the reference frame in which the Earth is already moving at \(10~{\rm m}/{\rm s}\), the change in kinetic energy is \(\tfrac{1}{2}\times (6\times 10^{24})\times (10+1.67\times 10^{-20})^2-\tfrac{1}{2}\times (6\times 10^{24})\times 10^2\)\({}=\tfrac{1}{2}\times (6\times 10^{24})\times[2\times 10\times 1.67\times 10^{-20}+(1.67\times 10^{-20})^2] \)\({}\simeq 1000~{\rm kJ}\).

 Posted by at 12:29 am
Jan 272018
 

Enough blogging about personal stuff like our cats. Here is a neat little physics puzzle instead.

Solving this question requires nothing more than elementary high school physics (assuming you were taught physics in high school; if not, shame on the educational system where you grew up). No tricks, no gimmicks, no relativity theory, no quantum mechanics, just a straightforward application of what you were taught about Newtonian physics.

We have two parallel rail tracks. There is no friction, no air resistance, no dissipative forces.

On the first track, let’s call it A, there is a train. It weighs 10,000 kilograms. It is accelerated by an electric motor from 0 to 10 meters per second. Its kinetic energy, when it is moving at \(v=10~{\rm m/s}\), is of course \(K=\tfrac{1}{2}mv^2=500~{\rm kJ}\).

Next, we accelerate it from 10 to 20 meters per second. At \(v=20~{\rm m/s}\), its kinetic energy is \(K=2000~{\rm kJ}\), so an additional \(1500~{\rm kJ}\) was required to achieve this change in speed.

All this is dutifully recorded by a power meter that measures the train’s electricity consumption. So far, so good.

But now let’s look at the B track, where there is a train moving at the constant speed of \(10~{\rm m/s}\). When the A train is moving at the same speed, the two trains are motionless relative to each other; from B‘s perspective, the kinetic energy of A is zero. And when A accelerates to \(20~{\rm m/s}\) relative to the ground, its speed relative to B will be \(10~{\rm m/s}\); so from B‘s perspective, the change in kinetic energy is \(500~{\rm kJ}\).

But the power meter is not lying. It shows that the A train used \(1500~{\rm kJ}\) of electrical energy.

Question: Where did the missing \(1000~{\rm kJ}\) go?

First one with the correct answer gets a virtual cookie.

 Posted by at 9:54 am
Jan 272018
 

Concerned as we were (and still are) about the health of our smallest kitty Pipacs, it helps to remember that we have two other felines in the house, both in good health as far as we know (fingers crossed and all that.)

The orange tabby on the left, Kifli, will turn 17 in April. He will be old enough to vote in next year’s federal election! He has not stated his political preference yet.

And despite their similarities, the two cats are not related. The cat on the right, Rufus, was a stray. He was approximately one year old when we adopted him in the fall of 2014.

 Posted by at 9:38 am
Jan 182018
 

Much to our surprise, not to mention relief, our kittycat Pipacs is a lot better today.

We noticed yesterday afternoon: he began eating again. He seemingly felt better. He groomed himself. He even played with us a little.

And then this morning: a nice, big poop in the litter box.

So his digestive system is functioning again. Probably with difficulty, so he is going to be permanently on a diet of laxatives and stool softeners, but so long as he is able to poop, he should be okay as otherwise, other than the bone growth on his pelvis, he is healthy.

This bone growth is not going to go away, so we’re living on borrowed time. But borrowed time is still a lot better than no time at all.

I already called the vet and canceled the scheduled visit for tonight. Thinking of Murphy’s law, however, I asked them not to process a refund yet, just keep the amount we already paid on our account.

 Posted by at 9:08 am
Jan 172018
 

This beautiful creature, who has been our companion for ten and a half years, give or take, is Pipacs (Hungarian for Poppy, pronounced pi-patch or something like, with the ‘i’ as in the word hit, the ‘a’ in the word bark, with emphasis on the first syllable.)

Unfortunately, Pipacs is very ill.

He was diagnosed with a growth on his pelvis three years ago. Even back then, the only treatment option was drastic surgery: Removal of a large part of his pelvis along with the leg on that side.

Pipacs has always been a very skittish cat. He was a stray when we adopted him, probably about a year old in late summer 2007. He is very easily traumatized. This, and the very low risk of such a growth spreading to other organs led us to the decision not to opt for surgery.

One thing we did not anticipate is that the growth, which increased in size rather dramatically in the past few months, would encroach on his digestive system and eventually obstruct his colon.

Which is exactly what happened. Simply put, beyond incidents of explosive diarrhea after receiving enemas, Pipacs cannot poop anymore. And sadly, surgery is no longer a viable option.

Which is why our veterinarian is scheduled to make a home visit tomorrow with her euthanasia kit. And my heart breaks as I am writing these words.

 Posted by at 8:27 pm
Jan 072018
 

Not too long ago (OK, well, 30 years… it doesn’t feel that long anymore) there was another genius on the news: the Genius of the Carpathians, Romanian dictator Nicolae Ceausescu.

Here is a joke from that era that, no doubt, could be adapted to fit the “very stable genius”, too.

The US president, the General Secretary of the Soviet communist party, the Pope and Ceausescu are flying somewhere on a plane. Suddenly, the pilot enters the compartment and says, “Gentleman, I have bad news. This airplane is about to crash and we only have four parachutes.”

Immediately, the US president yells, “I am the leader of the free world, I must survive!”, grabs a parachute and jumps.

He is followed by the Soviet leader, who yells, “I am the leader of the worldwide socialist revolution. I must survive!”, grabs another parachute and jumps.

Next comes Ceausescu: “I am the Genius of the Carpathians! I must survive!”, grabs the next parachute and jumps.

The Pope and the pilot remain. The Pope looks at the pilot and says, “My son, I am old and lived a full life. Your whole life is ahead of you. Please take that parachute. I’ll pray for your survival.” The pilot responds, “No need to worry, Holy Father, we have two parachutes left. The Genius of the Carpathians grabbed the fire extinguisher.”

 Posted by at 11:17 am
Jan 062018
 

 Posted by at 9:08 am
Jan 032018
 

When will news portals finally learn that autoplaying a video at maximum volume in the middle of the night guarantees only one thing: that I close the tab in a mad panic while I curse the news site, its creators, editors, their parents and grandparents and just about everybody they ever did business with for scaring me witless and waking up my household?

 Posted by at 1:52 am
Dec 242017
 

It’s the same, each and every Christmas. As Christmas Eve approaches, I remember that famous moment from 49 years ago. The astronauts of Apollo 8 just orbited the Moon. It was Christmastime. These three men were a thousand times farther from the Earth than any human being in history. It was an awe-inspiring moment. Once radio contact with the distant Earth was re-established, the three astronauts took turns reading the first ten verses of Genesis. Frank Borman then closed the broadcast with words that, in my mind, remain the most appropriate words for this evening: “good night, good luck, a Merry Christmas – and God bless all of you, all of you on the good Earth.

 Posted by at 7:49 pm
Dec 222017
 

So our American friends south of the border have a new tax legislation. I’ve seen many discussions of how it affects people in various income brackets, but all too often, these are more confusing than helpful.

So instead, here is a handy chart that shows how the federal tax rate decreases as a percentage of taxable income for individuals, joint filers and heads of households (based on tables provided by CNN):

While most folks will enjoy a tax break, it is interesting to see that some individuals and heads of households will actually see a tax increase:

Married couples benefit the most (mainly as a result of some arcane tax brackets that were in effect before the new legislation), which is probably a Good Thing; I am not so sure about the 2.6% tax break offered to the wealthiest, however.

Anyhow, I pay my taxes in Ontario, Canada, so it really doesn’t bother me one way or another, I just wanted to understand a little better what actually is going on.

 Posted by at 7:18 pm
Dec 162017
 

Fair warning: This post contains some adult language.

In case there has been any doubt: Republicans have gone completely bonkers, and it is now official.

According to The Washington Post, the Centers for Disease Control and Prevention, America’s leading public health institute, is no longer allowed to use the following terms in its budget documents:

  • vulnerable,
  • entitlement,
  • diversity,
  • transgender,
  • fetus,
  • evidence-based,
  • science-based.

Dear Republicans, dear followers of the orange person in the White House: Are you out of your fucking minds? Have you gone completely bonkers? Truly gone fishing? Are you bat shit crazy? Totally demented?

I mean, what kind of an idiot does this childish shit? You are worse than Soviet political commissars from the Stalin era. OK, you are not sending anyone to the Gulag (yet?) but your retarded drive for ideological purity is like a caricature of itself.

I mean… you are insane. Certifiably. This is not politics anymore. This is not left vs. right, transgender rights vs. traditional families. You are clearly deranged psychopaths.

I am secretly hoping that the news turns out to be false, but despite accusations of “fake news” and the like, I know The Washington Post to be a responsible news organization and I think it is a safe bet that this story was vetted.

 Posted by at 7:57 pm
Dec 152017
 

The Internet (or at least, certain corners of the Internet where conspiracy theories thrive) is abuzz with speculation that the extrasolar asteroid ‘Oumuamua, best known, apart from its hyperbolic trajectory, for its oddly elongated shape, may be of artificial, extraterrestrial origin.

Some mention the similarity between ‘Oumuamua and Arthur C. Clarke’s extraterrestrial generational ship Rama, forgetting that Rama was a ship 50 kilometers in length, an obviously engineered cylinder, not a rock.

But then… I suddenly remembered that there was another artificial object of extrasolar origin in the science-fiction literature. It is Iilah, from A. E. van Vogt’s 1948 short story Dormant. Iilah is not discovered in orbit; rather, it lays dormant on the ocean floor for millions of years until it is awakened by the feeble radioactivity of isotopes that appear in the ocean as a result of the use and testing of nuclear weapons.

Iilah climbs out of the sea and is thus discovered. It becomes an object of study by a paranoid military, which ultimately decides to destroy it using a nuclear weapon.

Unfortunately, the energy of the explosion achieves the exact opposite: instead of destroying Iilah, it fully awakens it, making it finally remember its original purpose. Iilah then sets itself up for a tremendous explosion that knocks the Earth out of orbit, ultimately causing it to fall into the Sun, turning the Sun into a nova. Why? Because Iilah was programmed to do this. Because “robot atom bombs do not make up their own minds.”

Artist’s impression of ‘Oumuamua

So here is the thing… the Iilah of van Vogt’s story had almost the exact same dimensions (it was about 400 feet in length) and appearance (a rock, like rough granite, with streaks of pink) as ‘Oumuamua.

Go figure.

 Posted by at 10:15 pm
Dec 142017
 

And since I seem to be posting cat pictures today, here is an “artistic creation” of Google Photos’ AI bot, depicting our youngest cat, Rufus:

I think this picture clearly explains why we often address this feline as Master Rufus.

 Posted by at 5:10 pm
Dec 142017
 

OK, I published a picture of Pipacs yesterday, so here is our oldest cat, Kifli, who turned 16 earlier this year.

I think he is a very respectable fellow, but he is also very playful, especially considering his age. I hope he remains this way for many more years to come.

 Posted by at 5:07 pm
Dec 122017
 

It may not be obvious, but this amorphous thing in this picture is a cat.

This is Pipacs (Hungarian for Poppy), our smallest cat. He is a little over ten years old (exact age unknown, as he was a stray.) He was diagnosed with a bone tumor a couple of years ago, but after the doctor explained that for cats, bone tumors rarely metastasize, we decided to take a risk and not have the leg in question amputated. The main reason is that Pipacs is a very skittish kitty, and we were deeply concerned that such a drastic operation (not to mention multiple, often painful vet visits) would have traumatized him.

So far, so good. That was two and a half years ago. Fingers crossed, but although the growth is there and quite noticeable, accompanied by a small limp, it does not seem to bother him. He remains active, with no signs of pain or discomfort, and no indication of any trouble. We just hope he will stay this way for many more years to come.

 Posted by at 12:09 am
Dec 062017
 

100 years ago today, as war was raging in Europe, the city of Halifax went up in flames in what remains one of the largest non-nuclear man-made explosions in history.

What began as a series of navigational errors resulted in a collision of two ships in Halifax Harbor, one of which was full of explosives. This ship caught fire and as its crew fled, the burning vessel drifted towards the city. It eventually exploded.

The destroyed Exhibition Building in Halifax, NS, also known as the location where the last body form the explosion was recovered two years later.

By the time it was all over, nearly 2,000 people were dead with many more injured. A large number of people lost their eyesight, as they were watching the harbor from indoors through glass windowpanes. These were shattered by the supersonic shock front of the explosion, the shards turning into shrapnel.

A Mi’kmaq community across the harbor was also destroyed, never to be rebuilt. Many of the residents were killed, while others were housed in segregated shelters, and ultimately dispersed throughout the province.

 Posted by at 10:52 am
Dec 052017
 

Our townhouse was built in 1981 or 1982. It came with a washer and a drier installed. When we moved in, just over 20 years ago, those machines were already nearly 15 years old, but still working flawlessly.

Many years later, the washer developed a problem: A pressure regulator valve in it failed. A technician temporarily fixed it by bypassing the valve and just turning the shutoff valve to reduce the pressure. He didn’t even charge us for this work; he said he’d be back once he had a chance to order the right replacement part. He never did, and as he was one of several technicians I called from the Yellow Pages that evening, I could not even remember who he was. So I never got a chance to thank, not to mention pay, him for his labor.

The temporary solution then became permanent. The washer worked well for many more years. Until Saturday morning. Just as my wife, on her way to a craft show, was trying to wash a few freshly knitted hats, the washer refused to spin and refused to drain the tub.

I was somewhat hopeful that the cause was just a bad interlock switch, which is designed to prevent the washer from operating with the lid open. This switch stopped functioning a while back; the washer ran always, lid or no lid. But who knows, perhaps now the switch failed in the open position? I opened up the old beast, located and removed the switch and bypassed it.

It could have worked. In fact, it almost did. With the switch bypassed, the washer was no longer completely silent when it was in the spin/drain position. The motor buzzed.

But only buzzed. That angry, 60 Hz buzz that you hear when a motor is seized. And sure enough, after about 15 seconds I began to smell, and then see, acrid smoke.

This was the moment when I knew that after a remarkable 35-year run, this old White–Westinghouse washer had its last wash. It was, unfortunately, finished.

So then came the annoying task of having to find a new washer. Fortunately, I was prepared, as I already contemplated the possibility that our old washer might die (35 years!) Lately, I stumbled upon a brand: Speed Queen. It appears that they mostly make commercial washers, for laundromats and other commercial installations. But they do have a few home models.

Oh, they are pricey. More than two and a half times as expensive as the cheapest washer that you can find. Still… based on the reviews I read, I thought that it might be worth the price. When I make a purchase, I either buy cheap (and then I know that I am buying cheap) or buy quality. Now quality is not always available. And often, reputable brand names turn out to be just pretty labels attached to the same cheap, er, excrement that is sold under other names at half the price.

So Sunday, we went to see this washer in person, at a local appliance store that carries the brand. The comparison was convincing. The weight difference alone between the Speed Queen and other washers was revealing. And of course it was a top loader with mechanical controls, a rarity nowadays, but the kind of machine that is precisely my wife’s preference when washing freshly made wool hats, mittens and such in her own special way.

So we opted to buy the Speed Queen, and it was delivered earlier today. Installation was my job. It’s not very hard; you hook up the hot and cold water, install the drain hose, level the machine and power it up. It powered up nicely, and the first test wash went like a charm.

So here we are, with a brand new, yet very conventional, high quality washer installed right next to a 35-year old clothes drier that still works reliably, and now that I cleaned it, looks almost new.

What can I say… apart from the damage to my wallet, it was a fun day. I am glad it happened now, not a few weeks ago when I was struggling to meet some deadlines, having freshly recovered from the flu.

Will this machine last 35 years? Who knows. But I certainly hope that we won’t have to worry about buying another washer for a long time to come.

Oh, and the package contained an interesting surprise: An order sheet for the parts manual and service manual for this model. I think I will buy those. I hope the machine will never need repairs, but if it does and it’s no longer under warranty, maybe I can fix it. Often the hardest bit is knowing what to do, and that’s where a factory service manual can be of immense help.

 Posted by at 10:00 pm