Has anyone seen the movie "The Kingdom of Heaven"? Besides the thing that the movie is very well made, the character of Salahuddin acted very well in that movie. I liked the character so much that I got tempted to keep the name of this blog after it.

Wednesday, August 17, 2011

Sudoku puzzle

Okay, puzzle addition: Sudoku puzzle. Available in lot many variations, in easy and medium difficulty levels. Enjoy!

Tuesday, August 9, 2011

Divisors problem (one more)

Here is a problem w.r.t divisors: For a given positive integers B and X find the number of positive integers N such that number N*X has at least one divisor D such that N < D <= B (Courtesy: www.codechef.com).

The number N, can be represented as a function of B and X, namely f(B, X). Prove the following:

f(B, 1) = 0
f(B, 2) = Floor(B / 2)
f(B, 3) = 2 * Floor(B / 3) - Floor(B / 6)
f(B, 4) = Floor(B / 2) + Floor(B / 4) - Floor(B / 6)
f(B, 5) = 4 * Floor(B / 5) - Floor(B / 10) - Floor((B + Floor(B / 15)) / 8) - Floor((B + Floor(B / 20)) / 7)

Saturday, August 6, 2011

Spanish and French architectures

I was looking at some pictures and magazines, where photos of some spanish villas, and french houses and articles are there. From those, I think spanish and french architecture styles are along these lines.

French use hues of pink, olive green and brown heavily. French windows are long and sleek. Spanish villas typically use terracotta bricks heavily. Windows are characterized by moorish arches, less-height, fat (stubbed) windows called Matador windows. (I will upload photos for all these soon).

Also, one can say that spanish villas have stairs from inside the houses, and a patio set on ground level, slightly elevated, which leads to the staircase. Ceilings are also of varied heights in spanish villas.

Overall, french villas used the purity of colors whereas, spanish villas showed the moslem influences they got over centuries.

Monday, July 25, 2011

About perfect numbers

Prove the following about perfect numbers:

1. Any odd perfect number can't be a square number.
2. The sum of reciprocals of factors of a perfect number is equal to that perfect number.
3. Prove that odd perfect numbers are of the form:

N=p^(4x+1)* Q^2, where p is of the form (4y+1).

4. Also prove that no odd perfect number is a multiple of 105.
5. The smallest factor of an odd perfect number <= (2k + 6)/3, where k is the number of it's prime factors.
6. Prove that, if p is of the form (12k + 1), corresponding odd perfect number will always be of the form (12k + 1).

Tuesday, July 19, 2011

Math problems for High-school kids

Here are some interesting math problems for high-school grade.

1. When written in decimal notation, how many trailing zeroes will be there in 32! In general, what is the number of zeroes for n! (any positive n).
2. How many numbers from 1 to 100 (inclusive) have odd number of factors? What type of numbers are those? Why? (Factors include one and that number as well).
3. Which number(s) from 100 to 200 (inclusive) has the highest number of factors? How many does it have? (It is better not to use brute-force, try to use "some" method).
4. Prove that the number of factors of a number n, is always not greater than 2 * floor(sqrt(n)).
5. What is the biggest number n, which has number of factors equal to 2 * floor(sqrt(n))?
6. Prove that, x^4n + y^4n = z^4n is not possible whenever x mod 6 = 1 or -1 (5), and y mod 6 = 3, and z mod 6 = 2 or -2 (4)?
7. Prove that the only possible cases for x, y and z above are:
x mod 6 = 0, y mod 6 = 1 or -1, z mod 6 = 1 or -1.
x mod 6 = 3, y mod 6 = 2 or -2, z mod 6 = 1 or -1.
This reduces the cases for the theorem (fermat's last theorem's special case), from a possible 36 combinations to a mere 4.
8. Prove that the powers of 4, always end with either 4 or 6 (in decimal notation). With what digit does 3^1000 end? What number do powers of 6, end with? What about powers of 5?
9. Can you extend the above observation to two/three digit numbers and beyond? For example, with what digits do powers of 3456 end?
10. Prove that for any number a (greater than 2), a^n - 1 (n greater than 1), is a composite number always. Also prove that a^(2*n+1) + 1 is always a composite number?

11. Prove that in x^4 + y^4 = z^4, at least one of x or y is divisible by 5. (If you take the irreducible forms of x and y, then it follows that exactly one of them is divisible by 5).

Wednesday, May 25, 2011

Science and Belief/Faith

Scientists do not believe in anything unless it is proved. Even worse (or better), they do not believe in anything unless it is disproved as well. They have this "reason" attached to everything that happens, and is said to have happened.

While this is better, we are somewhat certain that this won't do to know the complete truth. Godel's theorem demonstrates that knowing and understanding all the true stuff, is not possible in an "axiomatic system using numbers". So the logical approach is somewhat not enough to understand the world.

Sometimes it looks like, we have reached a stage where the assumptions used in physics, do not have any evidence possible, which can be detectable by use of machinery. And some of the "assumptions" look much like physical phenomena, actually, in these theories. One such thing is the "Hysenberg's uncertainty principle". It looks like, the light (photon) when it hits the electron, the electron absorbes it's energy, and loses position or momentum, enough to get the uncertainty proposed. (This is one interpretation of the principle, though). So, in some sense, there are un-observable physical phenomena, that science might agree to.

Godel's theorem says that theories (that use numbers) might have contradictions. So, are we sure that the theories that we use today (geomtery/algebra etc...) are devoid of them? How do we find out if that is so? To be more particular, are we even sure that the theories on which Godel theorem is based on, are free of contradictions? That Godel's theorem is based on safe and sound logic?

If logic does not reach till the end, and if the "scientific method" of "observe and explain" does not work everytime, then what do we do? We can after all, embrace a new scientific model (better than the axiomatic systems) and apparatus of applying it (better than "observe and explain", may be).

So, what could be a possible extension? I think one could try "faith based explanation" than "observe and explain", and the strict logical models of theorem proving. This is not so un-scientific, as it seems at first. In this model, one has to prove the following:

1. That a physical phenomenon occurs, when believed to occur.
a. (Even the one who is reading the proof should believe so)
2. It does not occur when not believed (Optional). Ditto.
3. A possible explanation of it, within the current science.

In the realms of the brain, there are many such faith based occurrences and phenomena. These were rejected by science folks, because they lack physical evidence, which is very well justified. However, when science itself talks about "physical phenomena that can't be evidenced", may be, we can see them with some little faith, any believers? :-(

I am arguing this way, might be someone will be unsure with this, however, do not forget that logic is also inside one's brain. Or rather, in the collective reasoning of the thinking humans' brains. How can you prove to someone who is not human (may be an alien) that logical explanation is the right way to explain things? May be it is not? May be it is just an artifact of the way the brain is designed, that we humans believe that it is "the way"? After all, it can't be proved logically by humans, that logic is correct, by design, isn't it? So, what if it is wrong? What is that is not "the way", and something else is?

I would even propose a (hypothetical) way to disprove me! Consider a hypothetical machine that can read human thoughts. Give it, a scientist's brain, when he/she is reasoning logically about something. Later, ask some other scientist, to analyze what he sees through the machine. After all, it might not be logically what is expected? Simply because the first scientist is thinking, that he could not spot the anamoly? Or worse yet, logically it all makes sense, however logic itself is wrong?

Also, we have seen many stories of yogi people and saints doing miracles. If you don't believe in such stuff, I have something else for you. Sometime back a "supernatural phenomenon" was caught on a camera, really. It came in news world-wide. A human form came out of nowhere in a surveillence camera, and jumped into the sky, vanishing. At the place where he vanished, there was a car with a dent at the exact location. May be, he is a time traveller, who knows. And mind you, this is not anyone's thing, no religion group involved, nothing. Just a random surveillence camera picked this video!

All that godmen stuff is rejected by science people, while religion men vainly try to prove existence of God to the un-believers. And some philosophies start with the axiom "Existence of God can't be proved, it can only be believed" stuff. Is that a theory about God or not, I would say it is.

However why don't scientists take a little faith and explore in that territory? Like, have an axiom similar to the above that "Some physical phenomenon need to be believed to occur, in order to be observed", what say? May be they discover that the world is different when they have faith vs when they are purely logical? The faith question, was posed many times by many people in human history. Because of the extensive purported "applications" (I doubt however) of faith, it looks like a natural candidate to extend the scientific models, just for experimenting before reaching a conclusion.

I am not talking about believeing in God or "theory of design" or something like that. I am fine with believing anything, if it helps us humans to achieve something. Let's believe that "all matter behaves like living creatures, with some randomness built-in" and develop models around that, if that helps push the frontiers of scientific application further. Let's believe in "Logic is wrong", if that helps the same again. Like today, we are believeing some of the theoretical assumptions, let's believe something else, if it helps us go forward.

Definitely scientists can try for once, by including the axiom of "belief is necessary to observe" some physical phenomenon. Who knows, it might expand the ability of the theory to discover the truth?

Monday, April 11, 2011

New Japanese puzzles

Folks, new puzzles added to the site. Ponturu and Cidouri. These are japanese puzzles. Currently only the uniqueness of solutions is not guaranteed. However, it is a simple matter to do this for Cidouri, will do it soon. Enjoy!

Tuesday, March 29, 2011

USA and the modern freedom

Some people might be of the opinion that I completely dislike the west and it's role in the world. However, I prove them wrong by this post.

Actually, USA is the country that symbolizes modern freedom. And, it has a lot to do in the coming years. There are two things that it did, which helped the beliefs/hopes of modern freedom throughout the world.

1. Winning against The British, and establishing the "first free country" of the world.
2. Dropping an atomic bomb on Japan.

Yes, that is right. Though I do not say it is good, dropping an atom bomb helped modern freedom. Today, all the countries in the world are enjoying an unprecedented modernity of co-existence and collaboration. Does this mean, everybody likes everyone else, no. Almost everyone in the world dislikes his/her neighboring countries. Many people dislike other persons of different caste/creed/color/race. But still, peace prevails between countries! (Read my other post on history, if you do not agree with this: http://salahuddin-knowledgehobbyist.blogspot.com/2010/04/i-watched-kingdom-of-heaven-recently.html)

How did it happen? Yes, it is due to the fear of the "ultimate weapon", the "atom bomb". The countries/races which warred for centuries, are afraid of the word "war", only because of this ultimate weapon. As a result, whole humanity is focusing on other frontiers, like science, research, global business collaboration etc... And that is how, majority of the people of the world are living without the fear of war, every day.

The 2000-5000 years of human civilization is a testimony to "casulaties of war". Many a times, no arts flourished in a region, only because there was no good king, no stability there. And, places which were full of arts and artists, are those where the empire is stable for decades/centuries. And people had to be good at war to survive the unstable period. It does not matter what arts/sciences you know, you just have to be able to weild the sword. There is a great mathematician called Galois, who died in a battle, and wrote the stuff of his life, the night before it, since he knew what would happen the next day, anyway. So sad, and a great casualty to the human civilization.

There are no such casualties now. In some sense, post 2nd world war, is the modern era, much much better than the period immediately before that. People of the world are more free today, due to the "atomic bomb". (I do not say it is good to drop an atomic bomb, neighter do I approve of that USA act.)

It is not the nature of war, to result in stale-mates. And it is not the nature of war, to fight 10000 people with 10000 people back. The actions and reactions of war, are always dis-proportionate, and they are meant to be so. This incidentally gives the lost side's rulers, a way to play with history, and the mind-sets and sentiments of their citizens. It also helps the winners, twist the history to somehow justify the brutal slaughter they did. However, it is in the nature of war, that's it.

However, it could have been much worse, had it been another country that discovered the atom bomb first. USA dropped it on Japan twice, and stopped. If one of these colonial nations discovered it, that would have been the apocalypse to the rest of the world. In the name of the queen, all of the world would be mopping the floors of the Br....sh parliament or something. Good that it was the USA, the first free country of the truly modern world.

And USA does not believe in colonizing, it is a country built on freedom, compassion and equal opportunity. Great that USA did not capitalize on that particular technology, and colonized the world. Instead, the mayhem was stopped with Japan's surrender, ushering the gates to "modern freedom". So much so that, today, even the USA is afraid of attacking another tiny country with the "ultimate weapon".

The east had/has a notion of freedom, that is not based on material freedom, opposite to the west. However, in the wake of industrialization, and mechanization, the importance of such a notion was reduced, quite frankly. These are the days when technology wins wars, who would worry about a devout/idealistic warrior or clan of warriors, who do not like your opportunism? The idealism of the east flourished arts like Karate etc..., and made our earlier civilizations prosper. All this lasted before indusrial revolution, and western colonization.

However, post colonization, the whole world was literally forced to become western. It was so forced that by the turn of 20th century, everyone knows and is aware of the rest of the world, in some sense. It was all needed because no man, could win against the machines of the west, it had to be learnt and defeated using it's own way. And, I do not fret in telling that out to others.

Indian independence struggle was also unique in this aspect that, Mr. Gandhi tried to retain the Indian notion of freedom, as a prevailing philosohy of the independence protests. His philosophy of "You can take my life but not my obedience", gave moral strength to countless indians fighting british, and many countries in the world followed the method too. In it, lies the notion of "oriental freedom", which he forced the westerners to fathom.

However, the world wars are "quests for global dominance", mostly by the colonizing countries, to finally find out who is the champion. This was the pinnacle of mechanization era, which lasted for 200 years, exploiting the colonies and amassing wealths enough the destroy the world 10 times over. However, the destruction was huge, but, the colonizing countries finally had to pay the price. A new bi-polar world where the poles are two totally new countries emerged from those.

And good that those countries were "modern" in the present sense of the word. They do not want colonies, they just fight for freedom. They helped convince the current colonizing countries to grant freedom to other countries. And idealism changes in those countries, also helped colonies get their freedom back. Thus emerged the "modern world".

In this era, the East's notions of freedom (from oneself, non-egoistic living etc...) are of lesser consequence than the Western notions, unfortunately. However, as a matter of evolution, we need to accept that, and go along, even if those look alien to us. And, actually great thanks to USA that gave the countries their way of understanding that, in some manner. Hope that through "global partnership of people, especially the Indians and Americans", as naturally happening now, a new and better notion of freedom, marrying these two would come into prevalence.

Truly USA and the east have a lot to do together, in the future.

Monday, March 7, 2011

Phake (Hinglish for Fake)

I watched IPL cricket matches this year, and sort of this amazing fact struck me. There are many foreign players playing for us, which means India could pay them so that they prefer IPL to their local county etc... matches. Whatever it is, it is coming from some industrialist in India. Great, India has money in at least some pockets :-)

Also, I was aware of big software companies which are looking for Indian customers. That's another great news. And someone reported that BRIC countries, Brazil/Russia/India/China, will become top of the world economic forces by 2050, India being the first. Whether our politicians allow such an abnormality to happen or not, is to be seen though :-(

After all these I have thought of an easy "crash course" for all those foreigners visiting India. After all, "Know Thy Customer", is one of the most basic business commandments, right? And I am sick of all those NRIs carrying water-bottles, dying their hair, talking with a heavy american accent, regardless of how much time they were in (or not in :-)) USA. Some of the extremes of this "crash course" are reserved for them.

So, the crash course consists of the following:

1) Get familiar with Indian roads, very very important.
2) Know Hinglish and be fluent in it, along with all vernacular-isms here.
3) Expect Desi outings, not american style.
a) Do not expect outings to have beer etc... served, it might be desi bhang or something.
b) No DJ dances, and Briteny songs, just desi tamil/punjabi tunes.
c) No hi-fi games, just the Kabaddi and all local stuff only.
4) Eat Indian food, when in India, and most importantly, stop complaining.
5) Have a little exam on Indian family relations and clear it. I prefer exams on Hinglish as well.

Before people say this is too-much and etc... Come on guys, we are working like them, and why don't we freak-them-out like ourselves? Let's not go ga-ga on becoming american, come on son, give your culture a face-lift! Anyway, we are not colonial India doing export of raw material/only body shopping now, is it? Also, I don't mean people (NRIs) staying there for decades don't have issues with weather here etc..., I am just saying "folks, get used to the folklore here!", remember "Know thy customer".

Okay, the roads part now. Arrgh!!, a manager comes from USA, and you take him to one of those water-parks or amusement parks that gives great thrill!! Are you joking? Come on now, I feel thrill there, but, there are better thrilling places, ok. For example, get to one of those places where road is dug-up and they are building a flyover, from the past decade. Take an auto that is jam packed, and get in. Hold anything that you can grab on to, and go on. That is great thrill man! If you are releasing a supply-chain solution or a simple GPS software for India, God knows how you would do, if you don't know of this thrill.

Now comes the Hinglish. How many foreigners know the meaning of "that much is not there", or "this only" or "that only"? Come on, don't say "I am sorry", "did not get you" etc..., after all "Bro, it ain't got no wrong". When we understand americanisms, please do understand ours. I am also thinking of creating an exam in the TOEFL style, certifying foreigners in Hinglish :-)). If ever in future, we have call centers in USA, working for India, this training would be of great use to them, right. (Wildest imagination, alright)

About company outings? Which movie do all of us like, is it "Inception"? Yes, that is right. Come on, I don't really prefer Inception to my Hindi Shah-Rukh-Khan's Don, would you? Be open there, ok. Just because it got oscars, Slumdog Millionarie does not become the best Indian movie ever made! :-( I would like them westerners to dance to our tunes than we dancing to theirs, come on, put some attitude into it, that's what I am talking about.

And why play those obscure team-building games? Play some local games, like Gilli-Danda, Kabaddi etc... Those build (and break) teams and bones. Give 'em a taste of India, alright. You can play simple stuff like, "leave a foreigner in some village on the highway, and see how he gets back to the resort, asking directions, hitch hiking rides, taking short-cuts". :-)

And get used to the indian menu. Don't complain, we eat burgers and drink coke when in USA, and you should not complain in India either, ok. Now you find something "extremely hot", well, drink lots of water after taking it, no sugars and stuff. No cereals in the morning, only Idly-Sambar and stuff. Come on, let's pretend we (almost) do not have any Cokes and burgers in India, what would you do? Get the idea.

Now comes the relations part. 'What is the "brother's mother-in-law's father's grand-son" to you?' kinda questionnaire. Okay, remember, make no mistakes, India is good in family systems, it ain't like USA, and if you make one mistake when writing a software or marketing it, it would be a very awkward discussion you have there. Face it, and find out the complexities of relations in India. Clear that exam, in the end, something like the Anal section of GRE.

All them foreigners, and especially those "NRIs who hate India", should be subjected to these "norms", before entering India. This is the best way to tell the Phakes apart.

Wednesday, February 2, 2011

Number of factors of a number.

There is another problem that I came across, which is as follows:

There is a number n, find the number of numbers x, such that n is a factor of x, and the number of factors of x, equals n.

Now, if we want to find the number of numbers whose number of factors is n, it is clearly infinity, for any n. For this, we can choose a prime number p (any would do), and simply raise it to power n-1, making p^(n-1). This clearly has n factors. Since there are infinite number of primes, this number would be infinite. The only change in this problem statement is that, n should be a factor of x.

Let's start by proving that, there exists at least one such x, for every n. We will do this by using a construction of such a number.

Let's say,
n = p1^ap1 * p2^ap2 * p3^ap3 * ...... for distinct primes p1, p2, p3 etc...
Let's construct x as follows.
x = p1^(p1^ap1 - 1) * p2^(p2^ap2 - 1) * p3^(p3^ap3 -1) * ....
The number of factors for x, is
(p1^ap1 - 1 + 1) * (p2^ap2 - 1 + 1) * (p3^ap3 - 1 + 1) * ...
= p1^ap1 * p2^ap2 * p3^ap3 * ... = n

Also, since p1^ap1 - 1 >= ap1 etc..., we know that n divides x. So, there is at least one such x.

Let's say, n is of the form p (where p is a prime). Then,
X = 2^a2 * 3^a3 * 5^a5 * ... * p^(ap + 1) * ...
where all ak >= 0 for k >= 2.

Now,
n = (a2 + 1) * (a3 + 1) * (a5 + 1) * ... * (ap + 2) * ... = p

Since, p is a prime, only one of these factors should be p, and rest all should be 1s. Clearly, only ap + 2, can be p, since it can't be 1. So, this has only one solution, that is given by, ap = p - 2.

Let's consider n of the form p1 * p2 (where p1 and p2 are different primes). Then,
X = 2^a2 * 3^a3 * 5^a5 * ... * p1^(ap1 + 1) * ... * p2^(ap2 + 1) * ...

Now,
n = (a2 + 1) * (a3 + 1) * (a5 + 1) * ... * (ap1 + 2) * .. * (ap2 + 2) * .. = p1 * p2

Again, only non-1 terms can be ap1 + 2, and ap2 + 2. So,
(ap1 + 2) * (ap2 + 2) = p1 * p2

Since all primes >= 2, and since p1 and p2 are assumed to be distinct, the solutions are,
ap1 + 2 = p1 and ap2 + 2 = p2, or
ap1 + 2 = p2 and ap2 + 2 = p1.
So, here there are 2 solutions.

Similarly, if n is of the form, p1 * p2 * p3 * .... * pk, for distinct primes p1 .. pk, the number of such x's will be k!.

Now, let's say n has p^2 as a factor, for a prime p. Now, we can prove that, if p > 2, this has infinite solutions. Consider all other prime factors of n, to use the construction given above, to fill their part of factors. Now, just consider the p^2 part of n.

p^2 = (ap + 3) * (Terms due to other prime factors than p1, p2 etc...). Now, it can be that
ap + 3 = p^2 (or)
ap + 3 = p

In the second case, there are infinite solutions, since when ap + 3 = p, other prime factors than p1, p2, p3, ..., can contribute to the other p in p^2. Also, if p > 2, ap + 3 = p is possible.

Let's consider when p^3 is a factor for, p >= 2.
p^3 = (ap + 4) * (Terms due to other prime factors than p1, p2 etc...). Now, it can be that
ap + 4 = p^3
ap + 4 = p^2
ap + 4 = p
However, even the second possibility gives infinite solutions here, which is ap + 4 = p^2. Similarly, infinite solutions would result, whenever, a number n has p^ap as a factor, where ap >= 4.

So, if a number n has p^2 as a factor, for prime p > 2, it has infinite x's having this property, and also when n has p^3 as a factor, there are infinite x's having this property, for any prime p.

Now, only possible n remaining is,
n = 2^2 * p1 * p2 * p3 * p4 * ... * pk.
x = 2^(a2 + 2) * p1^(ap1 + 1) * p2^(ap2 + 1) * .... * pk^(apk + 1).
n = (a2 + 3) * (ap1 + 2) * (ap2 + 2) * (ap3 + 2) * ... * (apk + 2)
= 2^2 * p1 * p2 * p3 * p4 * ... * pk.