Why does -1 * -1 = +1 ?

I have been asked this by perplexed teachers, parents and kids:

Why did them silly mathematicians decide that the multiplication of two negative numbers is positive? What’s the logic?

The first thing is to acknowledge that this is a convention. We could define -1*-1 to be whatever we want. But there is good reason to decide it should be +1.

Let’s try to calculate:

-1 * ( 1 + -1)

Well, -1 is the negative of +1, which mean, by definition:

-1 + 1 = 0

So, -1 * (1+ -1) = -1 * 0

and multiplication by zero must be zero, so we have:

-1 * (1+ -1) = -1 * 0 = 0

But, if we open the parenthesis, we have:

-1 * (1 + -1) = -1*1 + -1*-1

now, multiplication by 1 is doing nothing, so -1*1 = -1, so we get:

-1 + -1*-1 = -1*1 + -1*-1 = -1*(1+ -1) = -1*0 = 0

hence, -1 is the negative of -1*-1, so the latter has to be +1.

What have we used? We used the definition of zero and 1, we used the definition of the negative of a number, and we used the law of distributivity (by which we can open the parenthesis).

We could decide, say, that -1*-1 = -1, but then we’d have to abandon one of the principles mentioned above, and that would make arithmetic rather unpleasant.

The hardships of equality

This post is an attempt to clarify and generalize the main points of:

and explain why equality is an excruciatingly hard goal. Note that equality is meant, first and foremost, to be formal equality in front of the law. I am not interested here in questions of economical equality, although extreme economic inequality often has legal and social repercussions.

What does it take to create equality?
Continue reading

On double and or

A small remark on programming conditionals. This is true for C and C++, but it might be true also for Java and other languages. I haven’t checked all of them.

It is about conditionals.

I’m seeing lots and lots of double OR and double AND in conditionals. In fact, I find it rare to see a single single operator these days. (Sorry, I couldn’t resist the pun). Almost without exception, every multiple conditional I see has the form:

if ((x>0) && (x<MAX_VAL))
   do something....

Which is kind of silly, really. What one should do is use the simple single-operator

if ((x>0) & (x<MAX_VAL))
   do something....

Continue reading

Don’t compress it with that!

We had an issue at work. Our dev. team is managing a php server, which sends and receives binary KET files of constant size (say, 5kb) to production servers. I was rewriting some of the production servers and I notices that sometimes I’m getting TLE files in instead of KET files, and that they are 11 byte too big.

I checked it out. Apparently the dev. team was sending the KET files for compression (via php gzcompress). They were very much surprised to learn that the output files were larger than the original KETs. “Apparently”, they sighed, “gzip is not a very good compression. Let’s find another one”.

Which is the wrong conclusion. They have a meagre chance of finding a compression engine which wouldn’t expand the files. And this is a good excuse to explain this to the rest of the world.

An introduction to data compression

Mathematician’s digest:

Pigeon hole principle → no general compression scheme possible.

Range limitation → Data redundancy → range-specific compression possible.

Prima facie, compression is an impossible task.

Continue reading

What did go wrong?

A few years back, a friend bought me Bernard Lewis’ “What went wrong” and asked me for a review. This is somewhat late – but you might find it interesting.

Lewis’ starting points seem obvious: is the 13th century, Islam was the future. The Islamic centers in Mesopotamia were the peak of civilization. 700 years later, Islamic Mesopotamia is poor and sordid.
He is searching for an answer in culture. That seemed weird to me. Culturally, the east – and especially the Islamic east – was not a lethargic culture.
And I think I have a better explanation now.
Reading material:
Weatherford, Jack (2004). Genghis Khan and the Making of the Modern World (review). New York: Crown. ISBN 0-609-61062-7.


As people are the same, so are socioogical truths. It’s the same story in Israel, today, as well.

Originally posted on Pandaemonium:


At the heart of the current debate about immigration are two issues: the first is about the facts of immigration, the second about public perception of immigration.

The facts are relatively straightforward. Immigration is a good and the idea that immigrants come to Britain to live off benefits laughable. Immigrants put more money into the economy than they take out and have negligible impact on jobs or wages. An independent report on the impact of immigration commissioned by the Home Office in 2003, looked at numerous international surveys and conducted its own study in Britain. ‘The perception that immigrants take away jobs from the existing population, or that immigrants depress the wages of existing workers’, it concluded, ‘do not find confirmation in the analysis of the data laid out in this report.’ More recent studies have suggested that immigration helps raise wages except at the bottom of the jobs ladder where…

View original 1,879 more words

Microsoft: Some serious design mistakes

Beautiful, elegant

A nice keyboard

Ever so often I stumble across another annoying feature Microsoft is putting into their products. It never ceases to amaze me how creative the folks at Microsoft are at mis-designing products. Their products are always sleek, elegant, easy to use, and contain some hidden monstrosity under the folds.

At work, we have Microsoft Keyboards – just the most unbelievably hideous trap ever to be inflicted upon the unsuspecting world. The keyboard look nice enough, and is OK to use. Look at the picture. Notice those three little flat keys just between the ENTER and the numpad? Above the upper-arrow and below the “delete” key lurks a monster. Yes, it is a SHUTDOWN KEY! In the middle of the keyboard!

Need I tell you the details? You type a document, send out your little finger to press “up” or “del”, and all of a sudden the computer is shutting itself off.

And today I encountered another trap, at home. Here I am working at my computer (sometimes I still use MS windows, you see). And out of the blue pops a message. “Do you want to save?”. Well, why would I, in the middle of a messy revision? I press ESC, and the computer shuts down. Got me: It had an automatic update that was so much more important than my work…

So, shut down your automatic updates on Windows, double check MS products before you buy them, etc. All these advice work, but in my experience, they don’t work very well. remember: MS will always  have the upper hand. There’s always another snark hidden beneath the table, ready to jump at you when you least expect it.

Use Linux.