News for hackers. Stuff that matters.
Re:27 Jobs with Unbelievably Tough Interview Questions by curiousgal on Friday February 24, 2017 @07:07AM (#13722844)
>“What is the probability of an integer from 1 to 60,000 not having the digit 6?”

Am I missing something?

9 possibilities (0-9 excluding 6) for each of the last 4 digits and 6 (0-5) for the first one.

6 * 9^4 = 39366

The probability is 100/39366 = 0.0025%

Edit: More perls; "What is the angle at 3:15?" humm 0?

Re:27 Jobs with Unbelievably Tough Interview Questions by michaelt on Friday February 24, 2017 @08:03AM (#13723224)

  Am I missing something?
If I asked that question in a job interview, I'd expect the following mistakes:

0. Missing high-school-level math skills.

1. Double-counting numbers with double sixes (e.g. counting 666 three times)

2. Either failing to count the number 60,000 or mistakenly counting numbers 60,000-69,999

3. Failing to invert the result (i.e. counting the probability it /does/ have a six, instead of the probability it /doesn't/ )

4. Getting a result that was off by several orders of magnitude, and not noticing it.

5. Messing up the mental arithmetic (this is the reason I wouldn't use this question in an interview)

In other words it's a test of diligence and being able to get the right answer to simple problems. Which is a valuable quality in an industry with so many off-by-one errors!

  $ seq 1 60000 | grep 6 | wc -l
  20635

  1-(20635/60000) = 0.656 => 65.6%
Re:27 Jobs with Unbelievably Tough Interview Questions by BreakfastBob on Friday February 24, 2017 @08:03AM (#13723230)
You're pretty far off man. Assuming we're uniformly sampling the whole space, I thought of it as five independent games of choosing each digit, then "winning" each time by not getting a six. So the probability of 5 wins i.e. A number without a six is (9/10)^4 * (5/6). But that counts from 0 to 69,999. If we count up to one less in the tens of thousands place (5/5) we get 0 to 59,999. Which is off by one in both directions. So we can "slide" the window up but 0 was number without a 6 but 60,000 isn't so we have to discount another choice. Leaving us with (9/10)^4 * (5/5) * (59999/60000) = 0.656089065 or 39365 out of 60000.
Re:27 Jobs with Unbelievably Tough Interview Questions by mattzito on Friday February 24, 2017 @07:15AM (#13722884)
> Edit: More perls; "What is the angle at 3:15?" humm 0?

No, not 0, because the hour hand will have moved 1/4 the way to 4, making the angle 7.5 degrees.

Re:27 Jobs with Unbelievably Tough Interview Questions by dogma1138 on Friday February 24, 2017 @07:16AM (#13722886)
> Edit: More perls; "What is the angle at 3:15?" humm 0?

This question is about how angles are measured on a clock face, there are 2 methods where you either use hours (360/12) per hour, or minutes (360/60) per minute.

So at 3:15 the angle will be 30x3+30/4 or 97.5 degrees from 0 or just 30/4 which is 7.5 if the hour is your starting point.

Re:27 Jobs with Unbelievably Tough Interview Questions by anpcre on Friday February 24, 2017 @10:39AM (#13724587)
Perfect Answer
Re:27 Jobs with Unbelievably Tough Interview Questions by jayhoffs on Friday February 24, 2017 @07:20AM (#13722904)
> Edit: More perls; "What is the angle at 3:15?" humm 0?

It's not 0. At 3:00 sharp the angle is 90 degrees. 15 Minutes later the minute hand covered those 90 degrees, however the hour hand moved by a small amount too.

Re:27 Jobs with Unbelievably Tough Interview Questions by akho_ on Friday February 24, 2017 @07:20AM (#13722909)
Wrong answer to both questions. 0.0025 % of 60,000 numbers is 1.5. I can name more numbers without a 6 than that; 1 and 2, for example. Other commenters already wrote about the angle.
Re:27 Jobs with Unbelievably Tough Interview Questions by akho_ on Friday February 24, 2017 @07:23AM (#13722932)
(Of course, the probability question is incomplete without a distribution; I assume you were trying to solve for uniform)
Re:27 Jobs with Unbelievably Tough Interview Questions by toss892625 on Friday February 24, 2017 @08:02AM (#13723218)
You include the number 0, and exclude the number 60,000. As a result, the correct number number of possibilities is 39365.

The probability is 39365/60000