Live data from Hacker News

A Quick Puzzle to Test Your Problem Solving

nytimes.com

231–240 of 311 posts

Re: A Quick Puzzle to Test Your Problem Solving

#232
post #7

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

A test engineer walks into a bar. He orders a beer. He orders two beers. He orders 999999999 beers. He orders 1.00001 beers. He orders -42 beers. He orders 1048576 beers...

Re: A Quick Puzzle to Test Your Problem Solving

#233

We should all be doing good on this one if we have been practicing making our test cases are red first before turning them green :D

Looking at my result there, seems to be something I need to start doing. TIL :P

To be fair, I did check 3/6/12 - just to make sure it was double and not powers of two. Guess that's the articles point though isn't it!

Re: A Quick Puzzle to Test Your Problem Solving

#234
This looked like a puzzle I had seen before, so I assumed this was the case (testing a few sequences just to verify) and turned out right.

I guess the conclusion is that if a problem looks suspiciously like one you've encountered before, there's a good chance that they are the same or similar. The world is self-organizing, not completely random where you must obsessively second-guess your accumulated wisdom.

Re: A Quick Puzzle to Test Your Problem Solving

#235
This doesn't seem to work right for negative numbers. The article says the rule is "each number must be larger than the one before it", but if you try -2 -4 -6 it says that pattern doesn't match the rule.

Maybe I'm just being pedantic here, but last I checked -6 was larger than -4.

Re: A Quick Puzzle to Test Your Problem Solving

#236

Earlier quoted context omitted.

Isn't your answer technically wrong, though? The sequence is not monotonically increasing. It's strictly increasing. If you test [1, 1, 2] or [1, 1, 1] or [1, 2, 2], you'll get "No" answers even though those sequences are monotonically increasing.

Not so. http://mathworld.wolfram.com/MonotoneIncreasing.html

So.

http://mathworld.wolfram.com/MonotonicFunction.html

https://en.wikipedia.org/wiki/Monotonic_function

Re: A Quick Puzzle to Test Your Problem Solving

#237

This doesn't seem to work right for negative numbers. The article says the rule is "each number must be larger than the one before it", but if you try -2 -4 -6 it says that pattern doesn't match the rule. Maybe I'm just being pedantic here, but last I checked -6 was larger than -4.

"Larger" in this context means "greater than" in the usual ordering of the real numbers.

Re: A Quick Puzzle to Test Your Problem Solving

#238

This doesn't seem to work right for negative numbers. The article says the rule is "each number must be larger than the one before it", but if you try -2 -4 -6 it says that pattern doesn't match the rule. Maybe I'm just being pedantic here, but last I checked -6 was larger than -4.

It works for floating point numbers -- 0.01 0.02 0.04 for example. So it's a geometric series that has to start with a positive number and doubles. (The submit button and the show the answer button were broken for me.)

Re: A Quick Puzzle to Test Your Problem Solving

#239

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,…

With an equal protection clause, i.e., no particular number or a group of numbers can appear in the rule, is the problem solvable?
Post reply on HN