Hacker News new | ask | show | jobs
by poopbutt7 1107 days ago
If you clarify the prompt a little (I used Write a python script that can produce this pattern:), GPT-4 gave me this:

To generate the given pattern, we need to identify the structure. After analyzing, it seems that the pattern follows a certain structure where the binary representation of each number from 1 to 15 is preceded by a certain number of zeroes. Here's a python script to generate such a pattern:

    def generate_pattern():
        pattern = ""
        for i in range(1, 16):
            # Convert i to binary and remove the "0b" prefix.
            binary = bin(i)[2:]
            # Number of zeroes to add before each binary.
            zeroes = 5 - len(binary)
            # Add binary to pattern with zeroes.
            pattern += "0" \* zeroes + binary
        return pattern

    print(generate_pattern())

The script starts by iterating through numbers from 1 to 15. For each number, it converts the number to a binary string and removes the "0b" prefix that Python adds by default. It calculates the number of zeroes to add before the binary string to maintain a fixed width of 5 characters, and then adds the binary string to the pattern with the preceding zeroes. Finally, it returns the complete pattern.

Which outputs: 000010001000011001000010100110001110100001001010100101101100011010111001111

It's missing the first set of zero's, but matches otherwise.

So, I guess it's AGI then.

1 comments

The answer is wrong though (not just because it's missing leading zeros, but perhaps you didn't copy the right input?) and it's certainly not the shortest way to output that.
Not sure I follow- the answer matches minus the first leading zeros. Change the range from 0-32, and it matches exactly. So it pretty clearly recognized the pattern and produced working code.

This question is a pretty obscure benchmark. Another commenter has it just printing the string, as suggested.

If there's some weird math trick to get an optimal implementation, it's probably beyond the grasp of nearly all actual people.

> If you send it out past 16, it keeps matching the pattern as provided.

"If you modify it, it will give the correct answer"

Ah, you're right, it's pretty dumb then. Swing-and-a-miss, GPT-4.
Well, it's both dumb and smart: it's smart in the sense that it recognized the pattern in the first place, and it's dumb that it made such a silly error (and missed obvious ways to make it shorter).

This is the problem with these systems: "roughly correct, but not quite, and ends up with the wrong answer". In the case of a simple program that's easy to spot and correct for (assuming you already know to program well – I fear for students) but in more soft topics that's a lot harder. When I see people post "GPT-4 summarized the post as [...]" it may be correct, or it may have missed one vital paragraph or piece of nuance which would drastically alter the argument.