Monday, December 28, 2009

Disclaimer and stuffses like that

First, let me start off this little blog post with a not-so-famous quote:

"dunno
i lazy help you write programming qns
esp when you suan me until liddat"

This hurtful message was sent to me via MSN, and I believe it to be most untrue. After much reflection, I concluded a few things.

{centralise} {bold} {underline} {times} Reflections{/underline}{bold}{justified}

{spam}

{insert random long and monotonous introduction here}

I deeply regret the fact that I did not state prior to this that any and every of the characters on my blog are totally ficticious and all resemblence to any living or dead person in the world you call real is probably unintended and unreal. If you make the connection and strongly believe in it, please note that not everybody may think the same way. This will prevent tensions from arising. Just to add to the word count and make this more obvious, Don't Link My Rants To The Real World. Moo! I meant "Rawr!".

{boring conclusion to bring word count closer to the prescribed limit}

Sunday, December 27, 2009

Programming question (for a certain penquin and co.)

To start off, more accurate would be co. and penquin, but that sounds weird.

Anyway, this question was inspired by both a simplish math question and a comment from C_o_s, whoever that is.

So you are given 2 integers a and b, which you want to express in the form of:

x!y!....weird!/c!d!...weirder!
(Recall that 3!=6, just like pi != pie)

C_o_s quickly realises this is trivial (say a!(b-1)!/b!(a-1)!) works.

Hence, he suggests limiting all of x, y, ..., c, d, .... to primes, not necessarily distinct. He thinks for another second, and realises that the proof of existence is simply trivial. Hence, he has raised (and solved 2 seconds later) the question of how many prime factorials are needed to express a/b in the desired form.

Eg1: 2/3= 2!2!/3!, hence the answer is 3.
Eg2: 3/5=3!3!2!/5!, hence the answer is 4.

Input: a number n, stating how many prime factors a has
a number m, stating how many prime factors b has
n numbers, which are the prime factors of a
n numbers, the powers of the prime factors of a
m numbers, which are the prime factors of b
m numbers, the powers of the prime factors of b

Bounds should be around 500 primes from the first 1000 primes. Powers should be at most 100?

VINTAGE (Very important note to all generic entrants): The test cases have not been created because C_o_s is suspected to be lazy.

Friday, December 25, 2009

The conservation of fail

First, a bit of personal experience on fail. Fail is an omnipresent thing. You see it on failblog, you see it on the streets, you see it quite a lot in certain concerts (such as thumping noises from the backstage), and you see it all over the place during certain Math trainings. However, I have noticed that even though fail permeates every possible spot, the theories of fail seem to be scattered and few. As such, I will express my thoughts on fail.

1) A definition: Fail is the deviation of reality from expectations.
2) Another definition: Expectations are mostly average (ie. if people are above average* of the field, they are above expectations, and vice versa)
3) Hence, if we let the proficiencies of people in an arbitrary and absolutely random subject be a1, a2, a3, ... , an, then fail = (a1-a2)+(a1-a3)+(a1-a4)+ ... +(a1-an)+(a2-a1)+(a2-a3)+....(an-a(n-1))
That equals to 0.
Restating, the sum of fail is 0.
4) Since sum of fail is constant (at 0), there is conservation of fail.

Implications:
1) If you fail more, people will fail less.
1.1) Failing can be good for your relationships
1.2) Failing can improve the lives of others and increase overall happiness.

Note: Fail can be of different forms, eg imagined fail, perceived fail, real fail, massive fail, or just plain fail, but overall fail is conserved.

* Arithmetic mean, of course

P.S. The quality of this article fails. Are you happy now?

P.P.S. This article was written by a bored person in front of a screen in 20 minutes without any prior research whatsoever, and if any information is wrong or misleading, please contact the hotline for pizza deliveries and have a nice time with your family. Have fail!