Live data from Hacker News

A Quick Puzzle to Test Your Problem Solving

nytimes.com

211–220 of 311 posts

Re: A Quick Puzzle to Test Your Problem Solving

#211

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…

Fun fact: Mathemetica has a method FindSequenceFunction which does exactly what you describe. In my experience, however, it generally requires at least 4 terms.

I'm not totally sure how the math behind it works (maybe it's similar to Eureqa?) but the results speak for themselves and are rather incredible.

For example, if I run FindSequenceFunction on this input:

    {0, 1, 3, 8, 19, 43, 94, 201, 423, 880}
Which is the number of 0,1 sequences of length n that contain two adjacent 1s

Mathematica produces the result:

    1/10 (5 2^(1 + x) - 5 (1/2 - Sqrt[5]/2)^x + 
    3 Sqrt[5] (1/2 - Sqrt[5]/2)^x - 5 (1/2 + Sqrt[5]/2)^x - 
    3 Sqrt[5] (1/2 + Sqrt[5]/2)^x)
Which, astonishingly, is correct for all the values I've tried. So apparently Mathematica understands more about this sequence than I do, and I know its definition.

Another party trick is to use the input

    {-(1/6), 2/15, -(13/140), 23/315, -(83/1386), 305/6006, -(2269/
     51480), 4259/109395, -(16103/461890), 30616/969969}
Which is the integral x^n (1 - 2 x)^n for x from 0 to 1, for n = 0..
    (2^(-2 - 3 x)
    x! (Sqrt[\[Pi]] (1 + x)! + 
    3 (-1)^x 2^(
    2 + 3 x) (1/2 (1 + 2 x))! Hypergeometric2F1[1, 3/2 + x, 
    2 + x, -8]))/((1/2 + x)! (1 + x)!)
Which as far as I can tell, is a closed-form solution (!) to the integral. A solution it worked out to an integral it has never seen, but only the first 10 elements in the sequence.

So it's safe to say Mathematica knows a lot more about math than I do.

Re: A Quick Puzzle to Test Your Problem Solving

#212

Earlier quoted context omitted.

I tried floating point numbers. Also, at 28 decimal places, the test breaks; it's not arbitrary precision. So, technically, the answer isn't simply "any ascending sequence of numbers".

Hah! Nice catch.

Pentester. :)

Re: A Quick Puzzle to Test Your Problem Solving

#213

Earlier quoted context omitted.

My process was: [3 5 7] [7 5 3] [8 4 2] [5 7 3] [1 2 3] [1 1 1] [0 1 2] At that point I could've done some more to be really certain, but felt confident enough and guessed (correctly).

So you limited yourself to non-negative integers, and had no idea what negative numbers or fractions would do.

Based on the context of the question and the UI of the testing interface, fractions seem unlikely to be an intended part of the question. I likewise wouldn't bother testing unicode U+216x roman numerals.

Re: A Quick Puzzle to Test Your Problem Solving

#214
My explanation to the scarcity of "No"s: people are used to seeing in these puzzles mostly sub-types of increasing series: exponential, linear, etc. By the time they had ruled out these sub-types, and had resorted to guessing "ascending", they wouldn't have encountered even a single No.

I predict that if the rule was narrower, like "exponential", much more guesses would have yielded No's.

Re: A Quick Puzzle to Test Your Problem Solving

#215
post #196

Earlier quoted context omitted.

I tried floating point numbers. Also, at 28 decimal places, the test breaks; it's not arbitrary precision. So, technically, the answer isn't simply "any ascending sequence of numbers".

I actually avoided going that far to avoid getting bad data. I was trying to answer the question, "What does the experimenter THINK his rule is?" rather than what will the computer do. Since the computer can't be infinite, it will inevitably fail with overflow, underflow, and such. I was relieved, in fact, when it worked with negatives and floats in a "safe" range. I also tested with 1,1,2 and 1,2,2 to make sure that…

I too tried to test if it was only one pair that was significant. However I grew impatient and didn't try to come up with more tests when I thought I had a sufficient answer to explain my most vexing observation (negative, positive, positive out of combinations involving negative numbers).

The observation to brainstorm for ways of proving that a statement is in fact wrong, and exhausting them, is such an eloquent way of wording the hunt for a negative.

Re: A Quick Puzzle to Test Your Problem Solving

#217

Earlier quoted context omitted.

My process was: [3 5 7] [7 5 3] [8 4 2] [5 7 3] [1 2 3] [1 1 1] [0 1 2] At that point I could've done some more to be really certain, but felt confident enough and guessed (correctly).

So you limited yourself to non-negative integers, and had no idea what negative numbers or fractions would do.

Also he didn't know what numbers whose digits add up to 88 would do.

Re: A Quick Puzzle to Test Your Problem Solving

#218
post #74

Earlier quoted context omitted.

Hah! No, I'm not American :) But, in case no-one guesses, the answer is (rot13): erirefr nycunorgvpny beqre

You vastly overestimated NYT's estimate of the cleverness of their readers

A bit cruel, but I admit I laughed at that.

Re: A Quick Puzzle to Test Your Problem Solving

#219

Earlier quoted context omitted.

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…

Fun fact: Mathemetica has a method FindSequenceFunction which does exactly what you describe. In my experience, however, it generally requires at least 4 terms. I'm not totally sure how the math behind it works (maybe it's similar to Eureqa?) but the results speak for themselves and are rather incredible. For example, if I run FindSequenceFunction on this input: {0, 1, 3, 8, 19, 43, 94, 201, 423, 880} Which is the nu…

For this purpose mathematicians use OEIS (oeis.org). Check it out.

Re: A Quick Puzzle to Test Your Problem Solving

#220

Cool. The funny thing is I inserted a constraint of my own invention without even realizing it: "Use the fewest number of examples possible." Of course, this meant failing miserably, and was nowhere in the problem statement. Perhaps that's an additional factor - not exactly confirmation bias, but not unrelated.

this is exactly what I did. I wonder what the psychology/cognitive science explanation of this might be.
Post reply on HN