Uncategorized

Still alive

Today I was reminded about the lack of activity on my blog and on WIPUP, so tonight amidst my other projects I have sat down and I’m here writing.

The last post was back near the end of my first semester, first year in architecture at the University of Sydney. Since then I’ve spent a lovely winter break with relatives, attended the newly formed Sydney’s Blender User Group’s two meetings, had a short trip to Adelaide to experience FLUX: Student Architecture Congress (which was great, thankyouverymuch), performed as musical director (and terrible actor) for the Architecture Revue, released as well as started several large-scale projects from my webdevelopment work (of which I am not linking due to NDAs), worked on some music compositions, attended some of the Festival of Dangerous Ideas, am now also available on G+, started up a band, teaching some music, read at least 10 books, learning some violin, migrated away from a KDE infrastructure (I still do forum moderation, though), ploughed through most of my second semester (almost done, eh?), turned 19, and I’m now back alive in the online world.

That was a pretty good in-a-nutshell of the past 4 months, 16 weeks, or third of a year. I’m personally not too happy with the create:consume ratio I’ve had, but I guess it was a necessary dip in the cycle to get back into a worthy production mode. To make a first step I’ve uploaded a short (terrible) experimental soundscape I did with some friends a couple weeks back.

More to come.

Uncategorized

Tech tip #4: Copy a random set of files from a directory.

More for archival purposes than anything, today I wanted to copy some songs out of my serious mess of a music "collection" onto my microSD card. I didn’t want to have to choose and I haven’t rated my songs so that wouldn’t help. Instead I wanted a random selection of songs. I’m not a bashmaster (absolutely pathetic at it, actually) but this is what I ended up using – after symlinking all of the various directories I had my files under together:

find -L /home/drive/music -type f -name "*.mp3" | sort -R | tail -n100 | while read file; do cp "$file" /media/disk/music/; done

-n100 represents how many files are going to be copied. Hope it helps somebody! Of course any improvements are welcome.

Uncategorized

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:

Diagram2

… 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 :)

<?php
// 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?

Uncategorized

The end is nigh!

  • You know the end is nigh when October ends.
  • You know the end is nigh when you have an idea blockage and instead perform a medley of short compositions.
  • You know the end is nigh when you dress up as an Ipod commercial for Halloween.
  • You know the end is nigh when 9 people are chasing you for stuff in one day.
  • You know the end is nigh when you are chasing 9 (different) people for stuff also in one day.
  • You know the end is nigh when you want to get 9 (also unrelated) major tasks completed in that very same day.
  • You know the end is nigh when I actually follow my promise to do a post every 2 days (yeah cheapskate posts like these count too)

On a completely unrelated note, tomorrow I will be leaving for a camp, where I will spend my days trekking in the jungles, whilstling away the beads of sweat that erode canyons into my forehead. This means that there won’t be any blog posts (ha, don’t even ask about Twitter) during that time.

Oh and to make it slightly more interesting, if you read my previous post about Windows 7, here is more interesting information.

Finally, some past articles now have (related) information posted at the top.