Tuesday, May 31, 2011

Khan Academy (and Time)

I recently discovered the Khan Academy. Sal Khan began creating 10-minute Youtube videos to tutor his cousins in various school subjects. Five years and over 2200 videos later his website is now an invaluable resource for learning, and great for anyone with a passing interest in subjects ranging from Physics, Finance, Astronomy, History, Calculus, Biology, Stocks, Chemistry, etc. I've recently been watching his videos on Astronomy and found them fascinating. Here are two of my favorites which emphasize the vast scale of the universe in both time and space (similar to my own "How Big Is a Billion" post).

Visualizing the age of the universe


Visualizing the scale of the universe

Thursday, May 26, 2011

Weird Job Interview Questions (brain teasers)

I am a few months late on this, but business sites published a list of the "Weirdest Interview Questions from 2010" earlier this year. Some are fun brain teasers, others are completely subjective questions with no right answer, and a few seem almost deviously presented to obtain information that interviewers can't legally ask ("what has happened in this country over the last 10 years" may offer some insight to political leanings).

Before reading the questions and then a select few of my personal responses, you must understand the purposes to questions like these. I've interviewed many candidates for computer engineer and various tech positions and questions like these help us get insight on a person's thought process and ability to "think outside the box". In an interview, a candidate does not have to answer the question with the correct answer (if there is only one), but seeing a candidate realize that there just isn't one answer to the question or ask for details which were intentionally omitted tells us they can adapt and try new methods to real life problems presented to them on the job. Sometimes they may give a wrong answer, but the thought process that took them there is what impresses us; and since they really only had 5 min or less to come up with the answer we understand that the first hypothesis is usually not correct but a stepping stone to finding the final answer if given enough time. (a self-motivated candidate who calls back a few days later with an updated answer after time to reflect on the question is even more impressive).

Few of the Weirdest Interview Questions from 2010:
  1. If you were shrunk to the size of a pencil and put in a blender, how would you get out?
  2. How many ridges are there around a quarter?
  3. What is the philosophy of martial arts?
  4. Explain to me what has happened in this country during the last 10 years?
  5. Rate yourself on a scale of 1 to 10 how weird you are?
  6. How many basketballs can you fit in this room?
  7. Out of 25 horses, pick the fastest 3 horses. In each race, only 5 horses can run at the same time. What is the minimum number of races required?
  8. If you could be any superhero, who would it be?
  9. You have a birthday cake and have exactly three slices to cut it into eight equal pieces. How do you do it?
  10. Given the numbers 1 to 1000, what is the minimum number of guesses needed to find a specific number if you are given the hint “higher” or “lower” for each guess you make?
  11. If you had 5,623 participants in a tournament, how many games would need to be played to determine the winner?
  12. An apple costs 20 cents, an orange costs 40 cents, and a grapefruit costs 60 cents. How much is a pear?
  13. There are three boxes. One contains only apples, one contains only oranges, and one contains both apples and oranges. The boxes have been incorrectly labeled such that no label identifies the actual contents of its box. Opening just one box, and without looking in the box, you take out one piece of fruit. By looking at the fruit, how can you immediately label all of the boxes correctly?
  14. How many traffic lights are in Manhattan?
  15. You are in a dark room with no light. You have 19 grey socks and 25 black socks. What are the chances you will get a matching pair?
  16. What do wood and alcohol have in common?
  17. How do you weigh an elephant without using a weigh machine?
  18. You have 8 pennies. Seven weigh the same, but one weighs less. You also have a judges scale. Find the penny that weighs less in three steps.
  19. Why do you think only a small portion of the population makes over $150,000?
  20. You are in charge of 20 people. Organize them to figure out how many bicycles were sold in your area last year.
  21. How many bottles of beer are [consumed] in the city [in a] week?
  22. What’s the square root of 2000?
  23. A train leaves San Antonio for Houston at 60 mph. Another train leaves Houson for San Antonio at 80 mph. Houston and San Antonio are 300 miles apart. If a bird leaves San Antonio at 100 mph, and turns around and flies back once it reaches the Houston train, and continues to fly between the two, how far will it have flown when they collide?
  24. How are M&Ms made?
  25. What would you do if you just inherited a pizzeria from your uncle
And now for a few of my answers to these. They may not be right, but I really enjoyed the thought processes it took to get me to them! One thing to note is many of these questions use a similar idea of the candidate assuming the "standard way" to do an activity. Once you break that assumption, these questions actually become really easy.

DO NOT READ MORE IF YOU DO NOT WANT TO BE SPOILED! HALF THE FUN OF THESE QUESTIONS IS THE PROCESS OF FIGURING THEM OUT!
  1. If you were shrunk to the size of a pencil and put in a blender, how would you get out?
    Pencil sizes are not all standard, a person the size of a "large pencil" could easily get out. Or, a person the size of a regular #2 pencil is still long enough to easily shimmy up the sides of a normal-sized blender. (there likely isn't a right answer, I'm sure "screaming my lungs" out tells as much insight as these answers)

  2. Rate yourself on a scale of 1 to 10 how weird you are?
    This reminded me of the "How humble are you" catch 22: a humble person never admits they are humble. My answer is 5, because a person who says 1 is afraid of being weird; yet we are all weird/different, so who wants to be the same? And a truly weird person doesn't believe they are weird and would never say 10. Anyone who says 10 is flaunting themselves in a way a weird person would not. Answers 4-6 work just as well.

  3. How many basketballs can you fit in this room? This is just a good example of estimating lengths and volumes, and a good test of memorization of formulas (but having the guts to ask for the volume of a sphere formula, since really we would just look one up if we didn't know it, is good too)

  4. Out of 25 horses, pick the fastest 3 horses. In each race, only 5 horses can run at the same time. What is the minimum number of races required?
    My favorite question, this one was fun. My first answer was based on the obvious omission: do we have a clock? If so, you would only need to race each horse once (5 races) and compare their speeds to find the top 3.
    If not, my original thought was 11, since each race you could always eliminate the slowest 2 horses. It would take 5 races to get the top fifteen, 3 races to get the top nine, 2 races to get the top 5 (if you raced the winner of the previous race again you could order all 9 horses), and 1 race to get the final 3.
    But the general rule of a numbers answer is the first one you get is likely wrong especially if it is double digits. So I worked on it more. Currently I believe 7 is the right answer, but I may be wrong:
    5 races to find the five horses who place #1. 1 race between the five "first placer" horses to get the champion of champions, then 1 race with the 2nd and 3rd placed horses of the "first placer" race, the 2nd and 3rd place horses from the champion's first race and the 2nd place horse from the 2nd place horse's first race. The idea is the 2nd and 3rd place horses who originally lost to the champion horse may still be faster than the other horses who won 1st in their races, and the 2nd place horse who lost to the 2nd overall horse may be faster than the other 1st placers and 2/3 of the champion's first race too. Take the 1st and 2nd place winners of this race and along with your champion you have the three fastest horses.
    Read it a few times, it makes sense :)

  5. You have a birthday cake and have exactly three slices to cut it into eight equal pieces. How do you do it?
    The first of the "breaking the assumption" questions. The assumption is when cutting cake you cannot move any pieces, which is false. Cut the cake in half, then in half again to get 4 equal pieces in the original shape of the cake (square, rectangle, or circle). Then line up the pieces in a row and cut one long cut through all 4 to get 8 equal pieces.

  6. Given the numbers 1 to 1000, what is the minimum number of guesses needed to find a specific number if you are given the hint “higher” or “lower” for each guess you make?
    I originally got snooty with the semantics on this one and said 1. It only takes 1 guess to possibly get the right answer (this is not the right answer and may come across wrong). But if you want the "minimum number needed to guarantee a right answer" then this is a simple binary search any computer engineer learned when first studying: you always guess halfway between the numbers.
    The guess pattern assuming the answer number is 1: 500 - 250 - 125 - 63 - 32 - 16 - 8 - 4 - 2 - 1! The answer is 10 guesses, but you will likely find it before the 10th guess unless the number is 1 or 1000.
    Also, if you paid attention in math class you know binary searches are all based on powers of 2. If you find the power of 2 higher than (or equal to) the maximum amount you know the answer based on the power. If the answer is between 1-8 your guesses would be "4 - 2 - 1", 8 is 2 to the 3rd power (2^3) so the answer would be 3. 2^10 power is 1024 so the answer to the 1-1000 question is 10. And any computer/video game geek should know the powers of 2 up until 11: 2 - 4 - 8 - 16 - 32 - 64 - 128 - 256 - 512 - 1024 - 2048 etc (these are the common numbers for "bits" and "bytes" for ram, memory, and processors among other things)

  7. If you had 5,623 participants in a tournament, how many games would need to be played to determine the winner? Very similar to the "guess" and "omitted info" problems above. My first answer was the obvious: 1 game. Nowhere does it say how many participants can battle in a single game, so a game where 5,623 gladiators fight each other until 1 is standing is possible.
    But if you assume only two can play at once then the answer changes. I got this answer "wrong" when I read this, I assumed it was asking for rounds and treated it like the "guess" question above. My answer was 13, since it would take 13 rounds (2^13 = 8000ish which is higher than 5,623) with multiple games per round.
    But after reading the question again while typing this post, the question asks for the number "games" not "rounds" So instead of asking the number of "guesses" like above, we are adding the actual number of the guess. I don't know the answer while typing this, but the formula is similar as above where you keep halving the number: 2,812 + 1406 + 703 + 352 + 176 + 88 + 44 + 22 + 11 + 6 + 3 + 2 + 1.
    In an interview I could likely spout off the string of numbers above (doubling or halving numbers in your head is easy) but without a calculator and pen and paper I wouldn't know the answer is 5,626 (I cheated and just used this computer's calculator), which is suspiciously close to the original 5,623 number above (I rounded a few times which explains the difference) which tells me there was probably an easier way to answer this than brute forcing the numbers and adding them. I will need to reflect on this. :(

  8. An apple costs 20 cents, an orange costs 40 cents, and a grapefruit costs 60 cents. How much is a pear?
    Not enough info. Probably market value. Plus you can't compare apples, oranges, and pears but if I had to guess it would be closer to the apple's price since the others are citrus and larger than a pear.
    In honesty, that is where I left my answer. But I researched the answer because I didn't feel like it was "right" like I felt my other answers were. And the "best" answer I found is when this question is asked verbally most candidates mishear the final word and think it is "pear" when the questioner really meant "pair". Therefore the answers would be a pair of apples = 40 cents, a pair of oranges = 80 cents, etc. When the question is written this confusion is removed.

  9. There are three boxes. One contains only apples, one contains only oranges, and one contains both apples and oranges. The boxes have been incorrectly labeled such that no label identifies the actual contents of its box. Opening just one box, and without looking in the box, you take out one piece of fruit. By looking at the fruit, how can you immediately label all of the boxes correctly?
    This one is really easy if you have a vivid imagination (or can draw it). Since you know all boxes are labeled incorrectly, you just draw from the box labeled as "Both". If you pick an orange you know only oranges are in it (since it is mislabeled), thus the box labeled "Oranges" must be apples and the "Apples" box must be filled both.

  10. How many traffic lights are in Manhattan?
    I've never been to Manhattan, so I would guess the number of blocks (and likely be way off) or ask someone in the room if they knew, then assume each block has 4 lights, realize that blocks share traffic lights so I can't multiple by 4, and arbitrarily multiple my guess by 2, then find the closest square number (my geeky Rubik's Cube days taught me 1 block has 4 intersections, 4 blocks have 9 intersections, 9 blocks have 16 intersections, etc, thus all intersections are to the 2nd power: 4, 9, 16, 25, 36, 49, etc. There is a formula in there somehwere but it would take longer in the interview to figure it out than just creating an educated guess as mentioned above.

  11. You are in a dark room with no light. You have 19 grey socks and 25 black socks. What are the chances you will get a matching pair?
    I assumed the was a trick question (as you always should), so my first answer is 50/50 chance (since picking a second sock is not affected by the color you picked first). My next guess is slightly less than 50, like 47ish, but it would take some math of total possible solutions which may take me a while (I'm rusty on my probability formulas). My 3rd guess and final answer (because this is what I would do in real life) is to just pick 3 socks and ensure a 100% chance of picking a matching pair. Nowhere does it say how many socks you need to pick up at once.

  12. How do you weigh an elephant without using a weigh machine?
    Using water, such as a pool, and determining the elephant's volume and then measuring its density. I don't know the exact formulas off the top of my head, but that is how you find weight without weighing an object. There are probably other ways too, but that was the first that came to mind. Given enough time, I could probably come up with some pretty creative contraptions that were not technically "weigh machines". Now getting the elephant to voluntarily participate is a much harder problem...

  13. You have 8 pennies. Seven weigh the same, but one weighs less. You also have a judges scale. Find the penny that weighs less in three steps.
    Really easy, although I had done a harder version of this test years ago. The assumption is you can only weigh 2 pennies at a time, which, again, is false. Weigh all 8 pennies as 4 vs 4. Take the group of 4 that was the lightest (since you know the light penny is among them) and weigh them 2 vs 2. Take the lighter pair and weigh them 1 vs 1 to find the lightest one.
    This test gets much harder if you don't know if the one odd penny is heavier or lighter than the others. The answer to that problem is long and complicated but uses the same principle as above (you start off weighing 3 vs 3 and hope the odd penny is one of the 2 not weighed), it just takes a few more rounds to determine if the penny is heavier or lighter.

  14. What’s the square root of 2000?
    My final answer is a guess depending on how far they want to go into decimals. But I know 40^2 is 1600 and 50^2 is 2500 so the answer is between 40 and 50. 2000 is smaller than 2050 which is halfway between 1600 than 2500, so the number is likely less than 45 which is halfway between 40 and 50. A quick mental multiplication tells me 45^2 is 2025, and 44^2 is 1936. I hate multiplying decimals mentally, so at this point I would guess 44.7 since 2000 is roughly 70% of the difference between 2025 and 1936. If I was allowed a calculator (and couldn't cheat the answer by typing it in) I would brute force the answer by narrowing down the decimals from 44.7 until I got the answer (which my computer now tells me is 44.72135... yea, I would not have found that precisely without a calculator to help).

  15. A train leaves San Antonio for Houston at 60 mph. Another train leaves Houson for San Antonio at 80 mph. Houston and San Antonio are 300 miles apart. If a bird leaves San Antonio at 100 mph, and turns around and flies back once it reaches the Houston train, and continues to fly between the two, how far will it have flown when they collide?
    Yea, I hate these problems as they are too cliche and not that hard to figure out. Not to mention we don't know if the trains are on the same track, left at the same time, or if the bird is even flying towards Houston.
    Anyways, I know the distance traveled in a specific time must add up to 300 so the formula is 60x + 80x = 300, or 140x = 300 where x is an equal amount of time both trains travel. I would need a calculator to figure out the exact decimals but mentally I know it it is just over 2.14 hours (140 goes into 300 2 times, the remainder of 200 another 1 time, and 600 4 times, etc). Convert this into time and you get roughly 2 hours, 6 minutes + less than 3 minutes (.04 x 60) or a little less than 2 hours and 9 minutes (again, without a calculator) until the trains hit. But the actual time in minutes is pointless, I want miles.
    A bird traveling 100 mph for an x time of 2.14 (100 x 2.14) travels 214 miles.
Whew! That was fun, yet draining. Let's see what odd questions 2011 brings!

The face tells all

An amazing reference sheet for animators (or amateur detectives) came across my desk this week:

(click here for the full-size-readable version)


An artist called Cedarseed compiled all of her notes on facial expression to create a "facial map" detailing the differences between emotional expressions! For example: the difference between a "sad expression" and a "blue expression" is that in the blue face the eyebrows are lower and the eyes' irises are partially covered by the eyelids, whereas in the sad face only the pupils touch the eyelids.

Cedarspeed analyzes 60 different expressions in this manner and offers a great starting point for any artist depecting a subtle expression. Of course, facial expressions are not universal (each culture may express the same feeling in different ways) and the accompanying body language can easily change the meaning of an expression. But for a quick facial cheat sheet, they don't get much better than this!

Friday, May 20, 2011

Sonic youth(ful) nostalgia

This week I had not one, but two (unrelated) interactions brought upon my retention of frivolous Sonic the Hedgehog facts from my early 90's gaming days. That is twice as many frivolous-Sonic-fact-caused-interactions in the past week than I've had in the past 16 years! (but that other previous interaction is a post for another day)

The first interaction this week came from my meeting with a video game composer who worked on the Sonic games 18 years ago. A few months ago I read an article about a local art school. The article briefly mentioned the President of the school, Spencer Nielsen, composed music for Sega games. Upon looking him up, I realized not only did I know much of his music but he wrote the soundtrack for "Sonic CD" which was my favorite soundtrack of the Genesis era. I talked to my coworkers who previous worked at the art school and this week I finally got to meet Spencer.

The conversation was amazing and we discussed various topics, both old and new. As the meeting ended I finally was able to ask the question that bothered me for 18 years: "What were the voices saying"?

Sonic CD was the first CD based game I owned and also the first to have a "Red Book Audio" soundtrack which meant the music played from an audio portion of the CD as opposed to a synthesizer chip from inside the game cartridge or system. As such, the soundtrack used actual recorded instruments and vocals when most soundtracks of the era were rudimentary beeps and bops. To celebrate the occasion, I bought my first pair of speakers and plugged them into the Sega CD system to enjoy the game's music in glorious stereo. Hearing the music out of multiple sources allowed me to pinpoint various instruments, vocals, and tracks in each of the soundtrack's songs. And after playing a specific level a few times I noticed something odd: in the background of "Tidal Tempest" music I heard voices speaking.

(listen to the left track at 1:03- 1:06, headphones help]


Now, much like earlier generations thought they heard secret messages hidden in LPs, my 11 year-old self was sure I had stumbled upon a secret code that I could use to "cheat" in the game (infinite lives, level select, etc)! Games of this era were notorious for hiding cheat codes in the least-expected places of the game for players to find (which incidentally is was led me to my second encounter detailed below). Unfortunately, I couldn't tell what the voices were saying so I had no idea how to use the "code". I listened to the music over and over and eventually, as in months later, gave up and moved on to the next game. But I never forgot the "code" and the question of "what the voices said" stuck in the back of my mind in the "will likely never know" folder. That is, until I met the composer of the song.

Eighteen years later, Occam's Razor had taken hold and I assumed the voices were from a conversation unintentionally picked up on mic. But I still wanted to ask the composer just in case... Spencer did not know of the voices I mentioned and assured me there was no way a conversation was accidentally recorded. But upon sending him my digitized copy of the song he conceded that was exactly what it was and was surprised anyone could hear it (no one had noticed it up until now). He also gave me a personalized signed copy of one of his out-of-print CDs; not for finding the "secret code" but just because is an overall awesome guy!

And so my Sonic-knowledge-event ended for the week, or so I thought.

As mentioned above, games of the 80's and 90's hid secret codes in the least expected places to reward "superfans" who found them (and to allow programmers to use them to skip to various levels in the game to bug test). Many games also offered a special menu for players to listen to every piece of music in the game, which sometimes numbered over 100. And Sonic 2 is notorious for hiding its codes in the "music test" option. If players listened to track 19, then 65, then 9, and then 17 a special sound occurred which allowed the player to select any level from the game (the numbers are actually the birthday of the director of the game - 9/17/1965). Other combinations of track order playback opened up other secrets, but this was the most famous.

So this week while reading one of my favorite webcomics, Sam and Fuzzy, a throwaway line caught my attention. One character yelled a computer command, "Command Code 1965917", which caused all the robots in the scene to attack the heroes. My guess is most people "read" the first two numbers of the sequence then glossed over them to the next word with the understanding that is was just a string of numbers. But for some reason the numbers stuck in the back of my mind and when I read them again the memories of selecting any level I wanted in Sonic 2 came flooding back. So I e-mailed the artist to point out his hidden geekery (another Sonic "superfan") and a few days later he posted my e-mail and his reply on his website.


I'm not sure I have many more frivolous-Sonic-facts left that could lead me to intersting interactions, but you never know what the future holds...

Wednesday, May 18, 2011

Fossils and Myths

Not long ago I read some interesting theories regarding the origins of myths and legends. One fascinating theory states various ancient societies unearthed fossils while digging for stones to build their civilizations. The bones of long extinct animals perplexed the ancient people who then created imaginative stories to explain them.

For example, imagine you lived in ancient Greece and one day while hunting for food you come across this strange skull as large as your chest:


Well obviously, this must be from some large one-eyed creature with vicious teeth capable of rending a man in half:


(of course, since you live no where close to the Serengeti you wouldn't recognize a the skull as that of a dwarf elephant , complete with a large hole for the trunk, which lived on Mediterranean island until 9,000 years ago)

Similarly, if you came across a protoceratops skeleton (ie a triceratops without horns) you may assume it was an beaked creature the size of a lion with giant wings connecting to the frilly areas behind the neck.

Thus the griffin was "born".

Finally, if you lived in ancient China/South America/Europe/India/pretty-much-anywhere-thanks-to-Pangaea and you came across this skeleton larger than your house:

That must be a dragon (and not a Spinosaurus). Better call a knight to dispatch of him, and then eat his bones to claim his power.

Many of history's most fantastical stories have humble beginnings grounded in reality.

Tuesday, May 17, 2011

Good Life shot - blocking

It has been a busy month of animating. As mentioned in my last post, I "finished" my shots for my short and began a new dialogue piece. I spent weeks of filming reference, building sets, modifying rigs, and blocking the 600 frame shot (ie more frames than all of my "finished" short shots) to the point where it can be shown in its first stage here.



When I am "finished" with this shot I will upload my video reference for the piece, but right now the "scruffy-bearded-man-effeminately-crying-over-a-teddy-bear" video is too embarrassing to be shown without countering it with the successful final product.