February 21st, 2008

Neko (lofulah)

For the record...

...I still hate interviews.

Especially ones that ask me to recall things like the best sorting method... :P Fucking algorithms. Especially when the last time I saw them was 3+ years ago...

That being said, I did manage to get a rather curious problem out of that interview. So, given a random number generator that can only give you 0 and 1, what's the fastest way of extracting a fair 0, 1, or 2? (err, so you have a 1/3 chance of getting 0, 1/3 chance of getting 1, 1/3 chance of getting 2.)

roll it two times:
If we get 00, 01, 10 we pick a, b, or c respectively. Otherwise, we reroll twice. Is there a better way to do this?
Neko (lofulah)

I think, therefore I am.

"Every person makes choices as to how they will live," Richard began.
"Evil does not exist independent of man. Men do evil by choice. Choice involves the requirement to think, even if ineffectually. The most basic choice you can make is to think or not to think, to let others do the thinking and tell you what to do, even if they tell you to do evil.
"Wise choices require more, they require rational thinking. Refusal to think rationally affords one the ability to maintain the illusion of knowledge, wisdom, even sanctity while committing evil. If you follow the teaching of others who do your thinking for you and who have you do evil, the innocent victims are harmed just the same as if you choose to harm them yourself.
"Celebrating faith over reason is merely a way of denying what is, in favor of embracing any whim that strikes your fancy.

-Confessor, Final book from the Sword of Truth Series.