A little math probablility problem.

I was originally planning tomorrow to post the new Perspective Magazine for you to ogle at (distribution on Friday!) but I shall delay that and you shall be rewarded for waiting with a PDF you can download of the magazine. Ooh.

Instead tonight I had some free time (because tomorrow I shall be skiving school spending time productively at home) So I decided to look at an NRICH problem. Yes, that’s right. I was so bored I decided to do math. Edit: Apparently I didn’t notice the star rating system so it seems as though I picked an easy one.

Click to see problem: Succession in Randomia

Let’s consider a probability tree:


… OK. The first thing we notice is that it looks prettier. Let’s see the series for B now: 1/4 + 1/16 + 1/64 + … . This is identical to T. We can do the same for L and say we have 2/8 + 2/32 + 2/128 … which is exactly the same as B and T. Plugging it into a/1-r (r being 1/4) we get 1/3 for all three. Hence we can say that in fact it is a completely unbiased way of choosing a successor.

My answer to that question is therefore: “Yeah they have an equal chance

Well, I wasn’t going to stop here. Why don’t I simulate it? Here is the coding that simulates the situation (the cheapest brute force technique to tackle the problem):

If you don’t know programming, go take a read through the code anyway and see if you can get a grasp of what’s going on :)

// The number of times each king as won.
$bingo = 0;
$toto = 0;
$lotto = 0;

// How many times we are going to do the crowning ceremony
$ceremonies = 10000;

// Loop through these instructions to carry out the crowning ceremony.
for ($i = 1; $i < $ceremonies+1; $i++) { $win = FALSE; # Nobody has become king yet. $oddeven = 1; # Because the first throw is odd. Assume 1 = odd, 0 = even. $firsttoss = TRUE; # We are tossing for the first time. // This variable is used later to determine which variable $x or $y is // reassigned a value and which keeps the previous toss value. $a = 0; // Keep on tossing the coins until somebody wins the kingdom. while ($win == FALSE) { // Here we only flip one coin, this will alternate between $x and $y. // The one ($x or $y) that isn't assigned a new value will retain the // previous toss value so we can find out whether or not we have got // two HH or TT in a row. // Assume H = 1, T = 2 if ($a == 0) { $x = rand(1,2); $a = $a + 1; } elseif ($a > 0) {
$y = rand(1,2);
$a = 0;

if ($firsttoss == TRUE) {
// Nobody can win on the first toss.
$firsttoss = FALSE;
} else {
// If it is HH and ODD...
if ($x == 1 && $y == 1 && $oddeven == 1) {
// Lotto will become King.
$lotto = $lotto + 1;

// Somebody has won the Kingdom.
$win = TRUE;

// If it is TT and ODD...
if ($x == 2 && $y == 2 && $oddeven == 1) {
// Lotto will become King.
$lotto = $lotto + 1;

// Somebody has won the Kingdom.
$win = TRUE;

// If it is HH and EVEN...
if ($x == 1 && $y == 1 && $oddeven == 0) {
// Bingo will become King.
$bingo = $bingo + 1;

// Somebody has won the Kingdom.
$win = TRUE;

// If it is TT and EVEN...
if ($x == 2 && $y == 2 && $oddeven == 0) {
// Toto will become King.
$toto = $toto + 1;

// Somebody has won the Kingdom.
$win = TRUE;

// ... If nobody has won anything ...
if ($win != TRUE) {
// We flip again, so Odd->Even or Even->Odd.
if ($oddeven == 0) {
$oddeven = 1;
} else {
$oddeven = 0;

// Tell the computer to print out what results we have.
echo 'Bingo: '. $bingo .'
echo 'Toto: '. $toto .'
echo 'Lotto: '. $lotto .'

I ran it and here is an example result I get. Out of 10,000 ceremonies, this is the number of times each king has won:

Bingo: 3322
Toto: 3340
Lotto: 3338

Pretty close, eh?


Surviving the Week

fat_geekWell, I took a break on the last scheduled post because that Perspective release was considered a “big” thing. Mock exams (to mock us, obviously) are coming up in about a weeks time, and I am disgusted with my current state of revision – or lack of it. Why I am still typing this blog post I don’t know, but I think it’s great to share a bit about what’s going on (or whatever I deem suitable for online viewing – which isn’t much).

Today is penguin day. That’s because it’s a Friday. The story behind this was during my work experience, where apparently Fridays were when people would come late to work, and bum around most of the day – hence bringing along the slang term of “waddling”. This then slowly evolved into the weekly celebration of Penguin day. I’ve taken this into my own schedule, meaning Fridays are the days when I am more slack than usual. This usually leads to either a 8:30PM curfew or a 2:30AM curfew, depending on what I indulge myself in.

The past week I’ve been home alone. Aside from the shortened periods of sleep time and slightly less bother on privacy (OK – let’s stray away from the TMI swamps), some of the more interesting revelations on “how to live like a lazy bum” were reallised.

For example, only use a fork. If it’s soup, just tilt the plate/bowl/saucepan back and slurp it up. A spoon isn’t required. A knife? That’s why we have teeth, you know. To carnivorously rip apart our food.

Just eat straight from the saucepan you cook in. This saves you having to wash a plate, and the absolute requirement of you having to wash the pan before your next meal serves as an indirect form of motivation to do the “dishes”. If you’re having toast, that’s even easier, you don’t need any cutlery nor dishes.

Trash? You don’t need a trash bag. Just dump it in a common area (you’ll create hardly any trash anyway – just the regular packaging) and every morning before you go out to school – because you’re going out anyway, throw it in the outside bin. If you purchase take away food from outside, eat it whilst walking home. By the time you’ve reached home, you would’ve already been able to dispose of the

Cleaning up your room/bed/any sort of house cleaning can be neglected for a couple days. If you don’t bother to sleep on your bed, you don’t need to clean it. If you don’t bother to turn on the lights, draw the curtains, open the windows or even turn on the aircon, these are less little minorities you have to bother about.

Dirty laundry can also be minimized if you don’t bother to change your clothes or bother to wear anyt- ok. Danger zone.

Alright – that was enough of for a “personal life” post. I promise the next post won’t be random and will actually be related to technology – and really interesting. I also apologize for the image if it has scarred any of you.


Poetry Anthology Competition Presentation

I’m taking a bit of a break from my computer, Gentoo, KDE, etc related articles yet again to talk a bit about the vast array of creative and multimedia related creations I produce once in a while. Seeing as you guys must be bored out of your minds from the thumbnails I’ve released of the magazine I’ve been working on, Perspective (see Issue 1, and the more recent Issue 2), I’ve decided to release online a fun presentation I had to do.

The teachers at my school have learned that I know animation, so they’ve taken to shoving every presentation they need at me. This one, being a presentation on a poetry competition (seriously, all I can say is “this is the deadline, these are the themes, get working now”) has sparked off a rebellious nerve in my body, causing some unwarranted video of flying penguins to find its way into the choreography, as well as an opportunity to rickroll my whole school!

Anyways, here is the video:

Poetry Anthology Competition from Dion Moult on Vimeo.

Tools used were Blender and Macromedia Flash. Flash was used for the 2D animation, then exported into Blender. Blender was used for the 3D animation, compositing, and the final video sequencing. A tad bit of Audacity was used as well for sound equalizing and syncing, but that didn’t take up a huge role. Total time taken to produce was approximately 10 hours (including rendering time). Oh, and the stand-up poet clip at the end was compulsory to include, and not part of my doing at all.

And yes, I love the fact that I got to rickroll the entire school.

Other credits go to Florentyna Leow, who gave me the quotes and got the videos of penguins and Rick Astley for me.

Oh, and here’s the link to the Vimeo webpage if you’ve got something against me embedding the video in my blog post. The Vimeo page has a link to download the original 221MB mpg file.

Promise a back-to-techy stuff article soon.


Now with … 2.6.25-gentoo-r9!

Being somewhat of a techy-related blog, I guess that should warrant a post on my recent battle with the Kernel gentoo-sources 2.6.25-gentoo-r9. The version I was running before was r7, which was sadly two revisions out of date. :( Even worse before that was I was using 2.6.24-r4. Which was a whole version out of date. To end with a climax, before that I was using 2.6.19-r5, which was FIVE versions out of date. This probablys shows I’m getting better at time management, or I’m getting more uncomfortable with the notion of “if it ain’t broke, don’t fix it“.

Using Gentoo, one is expected to be rather capable of compiling and configuring a linux kernel. Side effects include 1) a Gentoo user is therefore able to optimise a system for his/her hardware, and 2) the Gentoo Linux Distribution becomes one of the geekiest available. (trumped only by LFS). So there I was, poking around my list of packages when I noticed bah! I’m two revisions out of date. I woosh off in all glory to my /usr/src/linux, make menuconfig, zoom around enabling drivers and removing unnecessary crud (seriously, I thought reiserfs was dead? Even worse, it assumes I want OSS instead of ALSA?). Some minutes later, I save my configuration, quit, and compile make && make modules_install. Baah-dum-bah-bee. Flawless compile. Copy the bzImage to my /boot, (whoah, I’ve got a lot of old kernel builds there – I should remove them), name it something intelligent (like kernel-2.6.25-gentoo-r9), add a new entry into my grub.conf to boot to r9 as well as r7, then type in the magic word: “reboot”.

Oh, wait! – you say, where is the problem? No problem! (or so I thought) No kernel panics, no nothing fancy, no forgetting to add filesystem support … so I punch up startx, ratpoison, KDE loads, start surfing the web, chatting on Kopete, grooving along to my … wait, what? NO MUSIC? Panic. I check my mpc. It’s playing. I check my mpd, it’s on. Check alsamixer and whooooop-what? No alsamixer? Not good. Oh wait I said, I remember I removed it from runlevel to speed up boot-time. So I /etc/init.d/alsasound start. and then catastrophe strikes! No drivers detected?

Rush back to my kernel menuconfig, Device Drivers -> Sound -> ALSA (check OSS is disabled) -> PCI Devices -> hmm… Yes, I do have Intel/SiS/nVidia/AMD/ALi AC97 Controller enabled. Time to double check if that’s the right one. Read the doc on it, and yep – it’s snd-intel8x0 for sure. Perhaps it’s a module problem? Modprobe snd-intel8x0 gives me FATAL: NO MODULES FOUND. Oh no!

— Cut: I thought I could turn a very geeky issue into a dramatic story but apparently I was wrong —

Ok. So I ended up having to unmask alsa-driver and alsa-headers, then dump ALSA_CARDS=”intel8x0″ into my etc/make.conf, then emerge alsa-driver. How silly, in my opinion, that I should require a non-supported package after a kernel upgrade. I’ve sent the alsa-bugs guys an email asking them what’s going on, and hopefully I’ll get an answer soon about why the in-kernel driver no longer likes my computer.


A baby named Linux

I’m sorry. I might like Linux but I can see that pencil thin line (yes, that means it’s erasable) that differentiates (argh! Calculus!) between appreciation and fanaticism. I’ve done my share of blatant Linux propaganda (with a fair few converts) but I’ve dimmed down a bit now. If people want me to help with their computer woes, the first thing I’ll suggest is to switch to Linux, but otherwise, I’ve generally stopped blasting “Thou are ignorant” speeches to random passers-by.

Excellent example of ultimate Linux fanatic (fanatic in this context is used in the negative sense of the word) goes to Christian Nielson (and his girlfriend). I’m sorry. This is almost as crazy as the guy who changed his name to Optimus Prime (and various others). By itself, the word Linux is a pretty good name – in fact, that’s mainly the reason Linux did better than BSD: the name sounded cooler. However, I think we should think again before naming our kids after products. Think about their future and whether you’d appreciate it if we named you “Lolcat”.

Click to read the article.

Epic example of how the world as we know it is plain crazy. (Read the comments to the post too, they’re just as insightful)

OK, that’s it for today’s post. Signing off: iDion iMoult.


Cause of the open-source lag.

Quite accidentally, I’ve probably discovered the very thing the turns people away from open source (or, the free movement). That very thing is actually caused by the oh-so-famous Richard Stallman, who decided to take the liberty to sing the “free software song”.

Listen to it.

If you didn’t feel like repenting for your sins or strangling yourself, or if your eyes brighten (reason left for interpretation) when you see the photo to the right …

… well, I am concerned about the state of the world as we know it.

Seriously, if you want to advertise something, don’t record something that makes William Hung look good, especially if you’re seen as a pioneer in that subject. I’ll even go so far to compare it to Microsoft’s recent ads featuring Bill Gates waggling various parts of his anatomy (including, but not limited to, his backside). Thank goodness that song was shoved to a corner on the gnu website.

Note: I understand the differences between open-source and free software, as well as Gnu, Unix and Linux. Nothing here is intended as a personal insult (sorry, but to be blunt perhaps yeah, I really felt like choking when I listened to that), and anything taken personally is regretted.

Oh, and for those who read my article on the practicality of the open source theory, apparently the newly predicted year of Linux domination is 2018 – that’s about 7% market share per year.


Warning: you must be stupid.

Useful information stuff:
Most of the 350-018 and 70-284 professionals who are interested in 650-393 need to start preparing for 642-446 as well as 642-503 right away.

I’m sorry but for all the fake phishing and whatnot websites in the world this is officially the worst I have seen for this year.


I’m npot even goindg to tel you nogt to fal for itt.

(I’m just putting some stuff you might/or might not be interested in before the release of my latest project – don’t worry: it’s worth the wait)


Boxcat in a Catbox

Useful information stuff:
You cannot become an SY0-101 or N10-003 professional until or unless you clear 642-812 as well as 70-431 and 350-030 with flying colors. An extra 220-602 would not hurt either.

With the ability to now use my fingers (yeah, I have 96 fingers) to count the hours before my holiday ends, I’ve decided to do something useful so that people would actually say, “yes, my good sir, that is an accomplishment.” So, my good sir, what is an accomplishment? (I would reply) and they would post a comment (hint).

In unrelated news, I’ve noticed that once I post something that doesn’t show you one of my creations, you don’t even bother to leave a comment. That’s right, you ungrateful ******** (starts with b, ends with s, plural). In any sense, I’ve learnt (actually, learnt isn’t a word, the correct usage is learned – but I don’t go to English class anymore, do I?) that I should spoon feed you more crazy stuff of mine.

Boxcat! Oh, Boxcat, the wonderful cat friend of Catface, star from weebls-stuff’s catface series. So, in a small tribute to boxcat, I have built Boxcat. Well, actually, here’s what happened.

Problem: I have a 10 year old computer that randomly crashes (well, Windows, what do you know), and the only way to fix it is to whack it repeatedly (not joking).

Solution: take it apart, find out what is causing the loose connection or whatever, and put it in a box.

Ok, Image fun fun time now (in no particular order):

So, the final product even had a tail (trailing power cord) and some eyes (LED), and a fashionably marker-pen drawn mush. Oh, I also found that a simulated whacking does fix it. (and yes, I did find the loose connection). Also, in the making of Boxcat, the original power switch was broken, so now to turn it on I have to simulate “pressing the switch” by touching two exposed wires together with precise timing. Awesome, is it not?


Watch the Time

…or rather, only if you can understand that contraption on your wrist. Or on other parts of your body.

I’ve been having my holiday, hence the complete lack of discipline on adding posts here. However, being in Australia (after visiting Manchester, Paris and Amsterdam), I’m obliged to write something to keep you guys occupied whilst I enjoy not doing anything. Of course, when I’m back I will chain myself to creative slavery and produce such whoo-ed stuff you’d probably hit that refresh button the whole day.

Seems as though some Japanese company has been taking the initiative to show that not only is Japan the leading country in providing toilets that have more knobs that provide a list of features longer than my … well, a lot of features, Japans is also the leading country in providing Watches that look as though ThinkGeek should be shamed at their amateurish geekware.

Not only do these watches tell the time, some help train your math skills, your resilience to oscillating images, your ability to easily wrap a large cloth around the arm, and even your ability to read binary. Not saying that the watches are completely just for fun … I’d gladly wear (some of) these if I had them (for free).

Well, don’t just listen to me, it’s time (no pun intended) for you to watch (seriously) it yourself.

Which is your favourite watch?


Music Jam – This is my banana!

Many people like to have session they call “jamming” where their friends meet in in a stereotypical basement, grab some drums, a guitar or two, some microphones, and probably an electronic keyboard.

Using that as a guideline, some friends and I decided were bored one day, and met up in a tiny room (think bathroom), with an upright piano (yes, there are non-electronical pianos too). The urge to create music filled our heads, and soon we had created an instrumental backdrop to the most popular Fruit and Vegetable song.

The result? Here you go. This is 100% ad-libbed (that means made up) on the spot. Completely spontaneous. Do not mind the out of tune bits, because none of us really knew where the tune was going.

CLICK: Banana Song Jam

You know you want to hear it.

The lyrics are as follows:

This is my banana, tra-la-la-la-la. (hand action depicting really large object)
This is your banana, la-la-la-la-la-la, (hand action depicting really small and short object)
CHOP your banana, la-la-la-la-la (violent slice of hand through the air, accompanied by a short jump)
and you have no more banana! (victorious pose – use imagination)

There are variations on the type of fruit and method of mauling it, including but not limited to: rambutans (peel), papayas (squeeze), kiwi fruit (shave), coconut (smash), sugar cane (suck), cucumber, etc.

This is completely work-safe and has no sexual connotations at all, no matter what you may imagine.

If you are interested of some of our earlier tries, you can listen to take onetake two, and take three.

I swear, one of these days I’m going to compose a proper song for this. Feel free to give suggestions on what you might think will make the song more enjoyable.

Note: a school teacher walked in during the final jam. Needless to say she walked out pretty fast again.

Note 2: Yes, I played the piano the whole while. Again, I had no idea where the song was going.

Note 3: There were about 4 other people singing.


Kraft is for sissies!

Some remember my last attempt at perfecting my cookery skills. Obviously, poaching eggs aren’t my thing. (those Emacs folks quipping up with C-x-poach shut up). This event actually happened a couple months ago, but that’s irrelevant. The fact is, a friend and I decided to team up and tackle the hardest of all culinary skills: cooking Macaroni and Cheese. As you can see, it is such a complex process that it is hard to find detailed documentation on it online. Unfortunately, we ourselves were not able to get snapshots of the early stages of creation for fear of the camera getting wet.

We started off by purchasing the necessary materials, this being in order of importance:

  • Baking gloves (I swear the pot has a mind of its own)
  • Cheese
  • Decoration (this included various leaves we could get from downstairs)
  • Macaroni (Remember kids! Use real macaroni from the packets. Kraft is for sissies!)

Well, after several hours of image editing cooking, this is what we turned up with! Click on the image to check out the full size!

This was taken with my phone camera. Yes, I actually cooked that without messing up!

Edit: some people asked me whether I really cooked this. Yes, I cooked that, and no image editing was used except for adding the “italiano” text. Also, I cooked it using proper macaroni, not the instant stuff Kraft gives you.


Python steals XKCD Comics – snippet

Useful information stuff:
After 70-640, the students who are enrolled for 640-822 start preparing for their 70-236 as well as 640-863 so that they can be exempted from 642-436 and 1Y0-259 and can appear directly in 70-536, saving time and resources.

When somebody asks a programmer:XKCD Comics

Dude, why do you program? There’s nothing useful that you can make that hasn’t been made already. It’s like making your own hand-phone when you could just buy it at a shop. Go get a life and do something productive.

Then of course, the programmer smiles and replies:

Why, for:

  • The money
  • The girls (“ooh that looks terribly complex…”, oh yes, it is…“)
  • Nobody can check whether or not you’re really doing your work.

However, I personally think that programmers do it because they like to communicate with their computer. Since I’m learning Python, I like to learn it through making small things to speed up my day. I’ve made a blackjack game (OK, that slows down my day), a program that executes series of shell commands to speed up boring tasks, a to-do list program, and my latest creation:


Of course, all you need to do is setup a cron-job to execute the snippet every time XKCD updates (Mondays, Wednesdays, Fridays) and bingo, you’ve just got yourself a personal archive of missed XKCD comics!

Here there be snippet:

#!/usr/bin/env python
import urllib
source = urllib.urlopen('http://xkcd.com/').read()
linebyline = source.splitlines()
found = 0
for value in linebyline:
    if found == 0:
        check = value.find('http://imgs.xkcd.com/comics/')

        if check != -1:
            found = 1
            # find the next occurance of the " to find end of URL.
            next = value.find('"', 10)
            image = value[check:next]
            length = len('http://imgs.xkcd.com/comics/')
            print 'Comic found: ' + image
            length = length + check
            filename = value[length:next]
            print 'Saved under: ' + filename
            path = '/home/dion/documents/Projects/Python/' # change this!
            image_file = urllib.urlretrieve(image, path + filename)


Amazing, isn’t it? Here’s the latest one I grabbed:

…and oh yes, it was terribly complicated.


What’s up?

Internet Explorer Sucks.

Useful information stuff:
Successful candidates of 350-001 and VCP-310 who have prepared from testking suggest the same for all the exams, including 640-802 as well as 70-290 and 70-270.

Today I learned two things:

1) Don’t write blog posts in Internet Explorer. It will crash and you will lose your whole post.

2) People don’t like me for promising I have big updates but never show anything.

Sorry. However the turmoil on the site should give you and idea that something is happening. Something you guys should love.


A Smart Registration

E2-Productions has had the registration system down for a while to stop people registering whilst the portfolio system testing was going on. The portfolio system is about 99% finished so the registration system is up again. The project system will be undergoing testing at the end of this week (Saturday) so stay tuned for an update on that. Hopefully by next week the site can be released.

Meanwhile, E2 has upgraded its registration page in the process. No longer does it ask you for only your desired username, password and your email, it now guides you through an IQ test to make sure we don’t get stuck with a low-quality community. Also, it’s to keep our “personal” side whilst keeping the site professional.

To register, once on E2-Productions.com just click on My Account and click the Register link. You will see the test includes a grammar checker, so we don get pos leik funny u no. We also check your mathematical skills and your ability to follow instructions, as well as a simple test of common sense.

The original test was devised by The Kingdom Of Loathing, and found on their Altar of Literacy once joining. So credits go to them for their Literacy test and Common Sense test. Should you have any trouble, please post your comments here.

Upcoming schedule is as such: This Saturday – project system for testing. This Monday – BMR updated and maintained. This Wednesday – POSE2 latest version released.