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!

Monday, November 16, 2009

mystery update

"X is D"--- Somebody.

Besides, who wants free maths problems?

Tuesday, September 29, 2009

On light

For many many years, since the start of man, light has been an amazing thing. Fire was made for the sake of light. It was hailed as a great invention. Fluorescent light bulbs have such successful inventions in the history of man such that nowadays, even good and creative ideas in comics have been represented with the lighted bulb symbol over the head!
Over the years, light sources have gradually become more efficient, starting with the failed matchstick/candle/candle lantern/bonfire (ok this one IS bright, but that's a problem of scale)/fires in general, and followed by the incandescent light bulbs (remember those white street lamps that were replaced with yellow?*), to the imba light bulbs used today! Technology advances have been so great that for select areas the lighting can even match daylight in terms of brightness! At this rate, are we all headed to doom by blindness owing to overluminousity?
Fret not! So what if light bulbs get more powerful? The light can be split over many different areas!
Such a brilliant idea! We know that light can be put through prisms, reflected across mirrors, sliced and diced and have weird stuff done to it, and hence can be spread across a larger area! But has anybody thought of splitting it across time? (uh oh)
Global warming has forced everybody into caves (manmade tunnels that curve a long long way underground/through hills and twist and turn and turn and twist and are really really long (about 100 million kilometers before leading to actual human civilisation, so as to provide insulation) .
Now, man has made a total of five tunnels, of which entrances are all facing the end of a certain road (picture included below) and to provide light, a giant spotlight has been built and the end of the road! The giant spotlight shines into each tunnel for 1 second, takes 1 second to turn, and shines for 1 second, turns for 1 second etc. That is to say, if 1/10 of the power is used to shine into each tunnel, all will be well!

Map of end of road


Road
. \
. \ /
. -- S --
. / \



Now, there is nothing to split the light evenly among all 5 tunnels, so 1 second of light is required to light up each tunnel for 10 whole seconds! Now, light sharing is an already effectively established system within each tunnel, but... HEADACHE! Splitting light across time is such a huge problem!... or is it?
As luck would have it, the walls of the tunnel and quite irregularly shaped, and as such some clever people decided that planting mirrors along the sides of the walls would be good, such that light actually gets to the part of the tunnel where it is needed. So every surface in the tunnel is blocked by perfectly clear mirrors (ie no loss of light through reflection). If a particle of light were a sapient** being, and it wished to travel from the spotlight to the end of a tunnel, it would take about 5 minutes and 30 seconds (right?). However, as we know it, a light particle is not exactly sapient, and would prefer to travel in straight lines until it is bumped on. Hence, the percentage of light particles that travel in the abovementioned "optimal path" would be of an extremely small percentage, and as such there will be a distribution of light over time even if the spotlight shone for an infinitesimally short timespan.
Hence, man survives using light solely from the spotlight, and gets relatively even light over time. Is that not a perfect solution?
Any comments? (Honestly, does it even work?????)



* Was that even true?
* My understanding of sapience is the ability to know what one wants to do the way a human does (and in this case, do it)


P.S. A rather uninteresting solution to disproving it that I foresee is that it is physically impossible to produce the amount of light needed to illuminate such large areas, or something to the effect, but as that is rather unsatisfying, those who propose that could try the following variation. Would a similar effect be observed on a much smaller scale?

Thursday, September 17, 2009

Tada! It's me again. And today I have a ""Life"" question for everyone!





In an infinite grid, there are squares of 2 colours!


The two colours and black and white!


There is something strange about the grid!


Oh! The colours of the grid are randomly generated!


Pause.


There is an x% chance that each square is white!


(Note: x may or may not be 50%)


Me comes along!


(No bad grammar there, Me is a person representative of well...me.)


Me defines a continuous block as a group of connected squares!


Two squares are connected if they satisfy two criteria!


First, they must be adjacent!


Secondly, they must be of the same colour!


Me has picked a random square from the grid (0,0)!


(0,0) is an arbitrary point!


Me knows that (0,0) is white!


For what range of x is it possible (more than 1/inf% chance) that (0,0) is part of an infinite continuous block?


And what is the chance (in terms of x) that it is possible that (0,0) is part of an infinite continuous block? (take x to be above the limit taken to make it possible to have an infinite block)

Sunday, September 13, 2009

Sequences

Tada! Finally a new post after a long, loong, looong time of inactivity. This post is almost contentless except for a few devilishly hard sequences which I would like to share with everybody.

16, 4, 2, 21, 24, ?, ?, ?
14, 15, 20, 19, 3, 1, 18, 25, ?, ?, ?
9, 12, 15, 24, 3, ?, ?, ?
19, 7, 15, 20, 24, ?, ?, ?
17, 23, 23, 24, 11, ?, ?, ?

Anyway, if you solved ...

0 --- You aren't the best at seeing patterns
1-2 --- You saw more than me. Let that be consolation.
3-4 --- Keep up the good work.
5 --- HOW LONG WERE YOU STARING AT THOSE SEQUENCES!!!

Have fun with those sequences.