Live data from Hacker News

A Quick Puzzle to Test Your Problem Solving

nytimes.com

261–270 of 311 posts

Re: A Quick Puzzle to Test Your Problem Solving

#261
Does laziness have anything to do with the responses? You get a rule that seems to work and so you seek the reward early. It takes effort to prove yourself wrong.

I was trapped by this and guessed it was exponential series n^1,n^2 etc for n starting at greater than 2. While technically true this was not the rule they had in mind.

Re: A Quick Puzzle to Test Your Problem Solving

#262
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…

[ 456 , 42 , 48 , No ] [ 1 , 2 , 3 , Yes ] [ 3 , 2 , 1 , No ] [ 45 , 46 , 47 , Yes ] [ -1 , 999 ,1238978 , Yes ] [ 1+1 , 1+2 , 1+3 , Fail ] [ 7 , 654 , 653 , No ] [ 7 , 654 , 655 , Yes ] [ 1.1 , 1.2 , 1.3 , Yes ] [ 1 , e , pi , Fail ] [ 1 , e , 42 , Fail ] [ -1.1 , -1.0 , -0.9 , Yes ] [ 2i , 3i , 4i , Fail ] [ 1 , e , pi , Fail ] [ 0 , 1 , 2 , Yes ] [ -1 , 0 , 1 , Yes ]

If anyone's tallying

Re: A Quick Puzzle to Test Your Problem Solving

#263
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…

[ 456 , 42 , 48 , No ] [ 1 , 2 , 3 , Yes ] [ 3 , 2 , 1 , No ] [ 45 , 46 , 47 , Yes ] [ -1 , 999 ,1238978 , Yes ] [ 1+1 , 1+2 , 1+3 , Fail ] [ 7 , 654 , 653 , No ] [ 7 , 654 , 655 , Yes ] [ 1.1 , 1.2 , 1.3 , Yes ] [ 1 , e , pi , Fail ] [ 1 , e , 42 , Fail ] [ -1.1 , -1.0 , -0.9 , Yes ] [ 2i , 3i , 4i , Fail ] [ 1 , e , pi , Fail ] [ 0 , 1 , 2 , Yes ] [ -1 , 0 , 1 , Yes ]

If anyone's tallying

Re: A Quick Puzzle to Test Your Problem Solving

#264

Earlier quoted context omitted.

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.

I know the question isn't directed at me, but I thought you might want to know. I couldn't try negatives or floating point on the iPhone. The keypad didn't have the option.

Re: A Quick Puzzle to Test Your Problem Solving

#265

My mathematical logic is rusty, but if I recall correctly, Gödel's incompleteness theorem basically states that it is impossible to solve this kind of question. No matter how many tests you run, there will always be an uncertainty. An incredibly stupid example is that the rule could be "yes for strictly increasing, OR if one of the numbers is -18273192783127897981." You'll never know. I understand this is contrived,…

Remotely related: I've been interested for awhile in how the same initial terms of a sequence could possibly be generated by multiple rules. For example, you might have 2,3... And the rest of the sequence might look like either 2,3,4,5,6... or 2,3,5,8,13... or 2,3,5,7,11... or even 2,3,5,10,20... Clearly, on some level those sequences are all much less complicated than one defined as "The first term is 2, the second…

How about this?

Choose a programming language. Choose a sequence prefix (in your example: 2, 3). Then consider all the programs that accept n as input and output a sequence of n numbers, such that the first numbers are always 2, 3. Now take the shortest of those programs. The sequence it produces is the "simplest".

If this sounds tedious to code, you could easily outsource via Odesk or something.

Re: A Quick Puzzle to Test Your Problem Solving

#266
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…

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.

Exactly. I'm just as 'No' averse as the next person but the 'No' I'm averse to is the one where you make wrong assumptions and it comes back to haunt you afterwards.

Re: A Quick Puzzle to Test Your Problem Solving

#267
post #44
post #7

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

Good old IEEE 64bit floating point numbers =) That also means that for(i=0;i<j;++i){} doesn't necessarily terminate for an arbitrary j smaller than infinity, which I find hilarious.

It terminates for an arbitrary j smaller than 2^53, which is enough for most people.

Re: A Quick Puzzle to Test Your Problem Solving

#268
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…

Thanks for setting up the survey!

Could you perhaps move to a bar chart instead of pie charts?

Re: A Quick Puzzle to Test Your Problem Solving

#269
post #164

Earlier quoted context omitted.

Similar to mine, but we both actually failed. Real numbers are accepted and we did not test that.

It accepts floating point numbers. To approximately double precision. But it accepts zero percent of real numbers.

I can nitpick better than that!

To talk about a certain fraction of real numbers you have to have a distribution over them. In general we take the uniform distribution if no distribution is explicitly given. That doesn't work for real numbers (it doesn't even work for natural numbers). (See https://math.stackexchange.com/questions/14777/why-isnt-ther...)

If there's no implicit default distribution, we have to pick on. I can pick one where they cover an arbitrary high percentage of real numbers..

Re: A Quick Puzzle to Test Your Problem Solving

#270
post #44

Earlier quoted context omitted.

Good old IEEE 64bit floating point numbers =) That also means that for(i=0;i<j;++i){} doesn't necessarily terminate for an arbitrary j smaller than infinity, which I find hilarious.

I'd prefer an example along the lines of: for(i = j; i With your example it's easy to lose the distinction between "would eventually terminate if you had a fast computer and a lot of time" and "never terminates even in theory." Here, it definitely looks like it should always run two iterations to matter what the numbers are (as long as they're finite), but it doesn't. Either way, though, it is definitely hilarious!

Thanks to undefined behaviour, C compilers can assume that you get exactly two iterations for this kind of loop on ints.
Post reply on HN