Feb. 21st, 2008

ibneko: (Default)
...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?
ibneko: (Default)
"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.

Expand Cut Tags

No cut tags

Profile

ibneko: (Default)
ibneko

Most Popular Tags

Style Credit

Page generated Jun. 10th, 2025 10:19 pm
Powered by Dreamwidth Studios
January 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 2021