tag:blogger.com,1999:blog-31278044.post519252880177200653..comments2015-05-06T19:46:34.202-04:00Comments on 2amsomewhere: Too... Tired... To... BlogUnknownnoreply@blogger.comBlogger6125tag:blogger.com,1999:blog-31278044.post-8028842278747523392007-04-19T22:59:00.000-04:002007-04-19T22:59:00.000-04:00just wondering writes:is it 2-3-8-17?Interesting a...just wondering <A HREF="http://2amsomewhere.blogspot.com/2007/04/too-tired-to-blog.html#4373904649803848470" REL="nofollow">writes</A>:<BR/><BR/><I>is it 2-3-8-17?</I><BR/><BR/>Interesting answer, but there's actually a better combination than that.<BR/><BR/>Think of it this way. Regardless of the selection of weights, there are only three possible choices for each weight during a measurement.<BR/><BR/>* off the scale<BR/>* on the scale, in the pan with the unknown weight<BR/>* on the scale, in the pan opposite that with the unknown weight.<BR/><BR/>Label each of these choices with the numbers 0, 1, and -1 respectively. Then it is possible to describe any measurement combination using a sequence of numbers. <BR/><BR/>Suppose two weights are on the left pan, the third weight is off the scale, and the fourth is on the right pan. The way we would write this is (1, 1, 0, -1).<BR/><BR/>Some of you may be familiar with bits and bytes on a computer. A bit is a binary (base-2) digit, which can take on a value of 0 or 1. String eight bits together, and you have a byte. Computers use patterns of zeroes and ones to represent number internally, and a byte can be used to represent an integer between 0 and 255 inclusive. You do this by thinking of each digit as being the coefficient of an expansion of powers of two. Consider the number 13, which expands to<BR/><BR/>8 + 4 + 1<BR/><BR/>or <BR/><BR/>1 x 2^3 + 1 x 2^2 + 1 x 2^0<BR/><BR/>or <BR/><BR/>1101<BR/><BR/>By the same token, we can think of our weight notation as an example of ternary arithmetic. That means we can express numbers in terms of a sum of powers of three, namely 1, 3, 9, and 27. Using this choice, you can measure up to 40 ounces (the sum of all the weights on the opposite pan, or (-1, -1, -1, -1).<BR/><BR/>Please bear in mind that the solution outlined above didn't occur to me until I was on my way home. With some guidance from my interviewer, we were able to derive the optimal choice by trial and error. <BR/><BR/>When we had arrived at the solution, I asked him why he thought the powers of three made a natural choice. He stumbled on that one for a moment and made the case that it eliminates redundancy. That is, for any unknown weight in the measurable range, there are no cases where you could choose two placements of weights to measure the same unknown value.<BR/><BR/>Taking a more rigorous track, if you think of number systems as vector spaces, selecting the optimal combination of weights boils down to finding an orthonormal basis for that particular numbering system.<BR/><BR/>Had you been allowed to place weights only on one side of the scale, the logic would have reduced to a base 2 number system, meaning the powers of 2 would have been the optimal choice.<BR/><BR/>--<BR/>2amsomewhere2amsomewherehttps://www.blogger.com/profile/12343733349708172680noreply@blogger.comtag:blogger.com,1999:blog-31278044.post-71086818467085242062007-04-19T22:26:00.000-04:002007-04-19T22:26:00.000-04:002am, when they are asking these questions are they...2am, when they are asking these questions are they sitting across from you drumming their pencils? Humming the Jeopardy tune? Eating donuts? <BR/><BR/>I really think this is going to pay off for you in the near future. Hang in there.Sassyhttps://www.blogger.com/profile/02589923941661580046noreply@blogger.comtag:blogger.com,1999:blog-31278044.post-43739046498038484702007-04-19T18:26:00.000-04:002007-04-19T18:26:00.000-04:00is it 2-3-8-17?is it 2-3-8-17?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-31278044.post-72317472335939962392007-04-18T21:13:00.000-04:002007-04-18T21:13:00.000-04:00Sassy writes:What happened to "why is a man-hole c...Sassy <A HREF="http://2amsomewhere.blogspot.com/2007/04/too-tired-to-blog.html#6691816174614548187" REL="nofollow">writes</A>:<BR/><BR/><I>What happened to "why is a man-hole cover round" kind of questions? These interviews sound brutal.</I><BR/><BR/>I am learning from this job interview process that if you want to get hired at the really high profile high tech companies, you're going to have to prove your mettle with them.<BR/><BR/>This has been the case with both the Big Software Company in the Pacific Northwest (2 hours of phone screens with programming questions, minimum of four hours of programming questions in person) and the Payment Subsidiary of a Big Online Auction Company (1 hour of technical phone interview, 4 1/2 hours of mostly technical interviewing).<BR/><BR/>Had I gone through with it, the February interview with Big Financial Information Service in Manhattan would have been even more intense, lasting a full day.<BR/><BR/>I didn't make it to the in-person stage with Big Online Book Purveyor of the Pacific Northwest, but I did make it through three rounds of one-hour phone interviews. Had I moved on, I would have needed to provide a work sample and traveled to their HQ for a battery of interviews.<BR/><BR/>The Goliath Search Engine of the Known Universe is also notorious for its interviewing. I put my name in with them a couple months ago, got a response from a real live human, but then got a followup letting me know that the position was no longer open.<BR/><BR/>--<BR/>2amsomewhere2amsomewherehttps://www.blogger.com/profile/12343733349708172680noreply@blogger.comtag:blogger.com,1999:blog-31278044.post-66918161746145481872007-04-18T18:27:00.000-04:002007-04-18T18:27:00.000-04:00What happened to "why is a man-hole cover round" k...What happened to "why is a man-hole cover round" kind of questions? These interviews sound brutal.Sassyhttps://www.blogger.com/profile/02589923941661580046noreply@blogger.comtag:blogger.com,1999:blog-31278044.post-48214360177264108872007-04-18T13:33:00.000-04:002007-04-18T13:33:00.000-04:00You have to start requesting Friday interviews! Ot...You have to start requesting Friday interviews! Otherwise these 48-hour days are gonna kill you!<BR/><BR/>Nice to see you posting, however briefly.Anonymousnoreply@blogger.com