Live data from Hacker News

A Quick Puzzle to Test Your Problem Solving

nytimes.com

111–120 of 311 posts

Re: A Quick Puzzle to Test Your Problem Solving

#111
post #7

It responds "No" to (10000000000000000, 10000000000000001, 10000000000000002) so the rule is not so simple after all :)

Further subtleties:

* The number may have optional sign and digits after a decimal point, and may use exponential notation. Example: (-1.2e1, .0E+0, 1.e-3) => "Yes". As seen in the second and third number here, there may be no digits before or after the decimal point, but both at the same time (i.e., ".0" and "0." parse but not ".").

* If the number begins with "0x" or "0X" it is read in hexadecimal, where the digits a-f may be in either case. Hexadecimal notation must not be accompanied by decimal point, sign, or exponential notation.

* No whitespace is permitted within the numeral, even between the sign and the digits as in "+ 11", but both tabs and spaces may be used before and after the numeral without changing its value. In particular, by using a input of the form "1 " it is possible to make rectangular display empty while still parsing it as number. Note that pressing "Check" leads to the numbers being displayed in the rectangle in exactly the same way as they were displayed in the text box, which may depend on the position of the cursor in the text box.

ETA: Also, you mentioned rounding, but there is also exponent overflow and underflow. The application refuses to parse numbers greater or equal to 1.7976932e308. It parses arbitrary negative exponents fine, but it does not recognize that 1e-324 is greater than 0.

Re: A Quick Puzzle to Test Your Problem Solving

#112

The puzzle is not nearly as interesting as the code being able to understand my answer! My answer: The numbers increase from left to right Application response: As you seem to have guessed, the answer was extremely basic

I simply said: "a < b < c", with no other words, and it gave me the same answer as yours.

Re: A Quick Puzzle to Test Your Problem Solving

#113
post #53

Earlier quoted context omitted.

I'm curious about how you came to your answer and what led you there? Were you testing a pre-supposed hypothesis that confirmed itself?

I got the part about increasing eventually, but I thought the third number also had to be the sum of the other two. I came up with the sum idea after trying (3 6 9), so only 2 tests. The idea that they had to be increasing came later. I don't have it open but I'm pretty sure one of my tests was (1 2 5) which should have tipped me off... in conclusion yes, I'm probably dumb.

I know you're joking, but I think this is important:

Failing the test does NOT mean a person is dumb. The point of the article is that confirmation bias seems to be a fundamental default in the way everyone thinks. Certain people with specialized training in inductive problem solving (scientists etc.) have learned to compensate.

If folks think it's an issue of intelligence, then they might be willing to think "but not me, because I'm smart." (After all, many programmers believe that they are smarter than the average bear). But while programmers are well-trained to think carefully about sequences of numbers, they might be as susceptible as anyone else to confirmation bias in other areas.

Re: A Quick Puzzle to Test Your Problem Solving

#115
post #3

I'm curious to see more about the distribution of questions and answers people had, and how the HN population may differ from the NYT's. There will certainly be self selection bias here, but if you're willing to share how you did with others, please enter it here: https://docs.google.com/forms/d/17e5BIL0lH8OHsGj89Zdtdl8GeCV... The result summary is visible here: https://docs.google.com/forms/d/17e5BIL0lH8OHsGj89Zdtdl…

Guessed after just one "No" 3 9 27 yes (is it exponential series?) 4 16 64 yes (is it only odd numbers?) 5 7 9 yes (is it any numbers of the same parity?) 6 7 8 yes (is it any set of increasing numbers?) 6 7 6 no (just to confirm that it's x

6,7,7 or 1,1,1 satifies x<=y<=z not 6, 7, 6

Re: A Quick Puzzle to Test Your Problem Solving

#116
I'm a data scientist, and it relieved me no end that I got this one right: http://i.imgur.com/V5oJ4i4.png I would have had second thoughts about my career choice if I got this wrong :)

The correct approach for any data modeling problem is to think in terms of entropy. Each subsequent approach should minimize entropy, until you reach diminishing returns.

Re: A Quick Puzzle to Test Your Problem Solving

#117

I'm a data scientist, and it relieved me no end that I got this one right: http://i.imgur.com/V5oJ4i4.png I would have had second thoughts about my career choice if I got this wrong :) The correct approach for any data modeling problem is to think in terms of entropy. Each subsequent approach should minimize entropy, until you reach diminishing returns.

I got so many nos. I can't believe that "Remarkably, 77 percent of people who have played this game so far have guessed the answer without first hearing a single no." That's crazy.

Re: A Quick Puzzle to Test Your Problem Solving

#118
post #7

It responds "No" to (10000000000000000, 10000000000000001, 10000000000000002) so the rule is not so simple after all :)

Responds "Yes" to 9007199254740990, 9007199254740991, 9007199254740992 but "No" to 9007199254740991, 9007199254740992, 9007199254740993 Presumably this is due to how Javascript handles integers, i.e. it uses the integer part of a float64, to wit > parseInt('9007199254740992') 9007199254740992 > parseInt('9007199254740993') 9007199254740992 Edit: I think this is the code that actually reads the numbers the user enters…

you broke it.

Re: A Quick Puzzle to Test Your Problem Solving

#120

Earlier quoted context omitted.

People familiar with unit testing and test driven development will feel at home with this kind of puzzle. That doesn't mean that they will be less biased in social/political decisions, it just means that this test will fail to prove a point.

That's exactly what I was thinking. I (sometimes) follow TDD, and I applied it to this problem. I made sure to include negatives, 0, positives, and include primes here or there to help avoid issues with multiplication/exponentiation. After a few of these, I felt pretty confident that the rule was simple.

Did you try floating point numbers? I didn't see anything in the text that said integers only.
Post reply on HN