WoodCentral Forums

Est. 1998 — 27 years of woodworking knowledge

Puzzle -- self-describing sentences

Posts

Puzzle -- self-describing sentences

#1

Puzzle -- self-describing sentences

Alex Y

Some sentences can be all about themselves. One example is:

Only the fool would take trouble to verify that his sentence was composed of ten a’s, three b’s, four c’s, four d’s, forty-six e’s, sixteen f’s, four g’s, thirteen h’s, fifteen i’s, two k’s, nine l’s, four m’s, twenty-five n’s, twenty-four o’s, five p’s, sixteen r’s, forty-one s’s, thirty-seven t’s, ten u’s, eight v’s, eight w’s, four x’s, eleven y’s, twenty-seven commas, twenty-three apostrophes, seven hyphens, and, last but not least, a single!

It could be fun to try to create the structure and coding to generate something like this! But here is an easier [but still plenty hard, IMO] one:

In this sentence, the number of occurrences of 0 is _, of 1 is _, of 2 is _, of 3 is _, of 4 is _, of 5 is _, of 6 is _, of 7 is _, of 8 is _, and of 9 is _.

Fill in the blanks to create a true statement. Just to keep you from going down some rabbit holes, I will state that the numbers are in base 10, and that the two solutions of which I am aware both have single digits in each blank.

Re: Puzzle -- self-describing sentences

#2

Just to be clear

Alex Y

The blanks must be filled in with numerals. So while filling in each blank with the word "one" would work, that is not a solution I am looking for.

:D

Re: Puzzle -- self-describing sentences

#3

Re: Puzzle -- self-describing sentences

Larry Barrett

I can get a solution pretty easily, up to a point, by filling in the entry for 0, then starting at the end and working backward, skipping the entry for 1 until all others are filled in, like this:

In this sentence, the number of occurrences of ...

0 is 1, 1 is _, 2 is 1.

then fill in the entry for 1: ... 0 is 1, 1 is 3, 2 is 1.

This works up thru 8:

... 0 is 1, 1 is _, 2 is 1, 3 is 1, 4 is 1, 5 is 1, 6 is 1, 7 is 1, 8 is 1. And then fill in the entry for 1:

... 0 is 1, 1 is 9, 2 is 1, 3 is 1, 4 is 1, 5 is 1, 6 is 1, 7 is 1, 8 is 1.

But when 9 is added at the end, the entry for 1 becomes 10, and this scheme falls apart.

Re: Puzzle -- self-describing sentences

#4

Correction

Alex Y

At the end of the original post, I said "the two solutions of which I am aware both have single digits in each blank"

I was wrong. The second single-digit "solution" I found was not in fact a solution. There are two solutions, but one is composed only of single-digit numbers while the other is not so limited.

I have read that there are only two solutions, and seeing how to find both of these leads me to be pretty certain that is correct. But a rigorous proof of that is another matter...

Re: Puzzle -- self-describing sentences

#5

Hint

Alex Y

An iterative process can lead to both solutions.

The all-single-digits answer is harder to get with an iterative process--finding a starting point that ends in an answer is almost as hard as finding the answer--but the answer allowing multiple digit numbers in the blanks is much easier, with an obvious stating point.

Re: Puzzle -- self-describing sentences

#6

Iterative Process

Alex Y

This seems to be going nowhere. Here's what I mean by the iterative process:

From the puzzle: "occurrences of 0 is _, of 1 is _, of 2 is _, of 3 is _, of 4 is _, of 5 is _, of 6 is _, of 7 is _, of 8 is _, and of 9 is _."

Shortening for formatting:

0:_, 1:_, 2:_, 3:_, 4:_, 5:_, 6:_, 7:_, 8:_, 9:_

Seeing that, we see one of ech digit, so fill that in as the first guess:

0:1, 1:1, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1

That didn't work, so try counting in the line above and filling in the results:

0:1, 1:11, 2:1, 3:1, 4:1, 5:1, 6:1, 7:1, 8:1, 9:1

That still doesn't work, but two more iterations and you are there!

Re: Puzzle -- self-describing sentences

#7

Re: Iterative Process -- finish

Alex Y

The multi digit solution is 1,11,2,1,1,1,1,1,1,1

Re: Puzzle -- self-describing sentences

#8

Re: Hint for single-digit solution

Alex Y

The single-digit solution can also be fond using the same iterative process. that's the way I did it, letting Excel do the dirty work. But it takes a bit of luck to find the right starting point. Most led to a situation where the iteration was cycling between two incorrect answers.

But there is an analytical way of getting to the answer with no iteration--just checking a very few possibilities.

Start with a few observations that you can easily see, but need to see how to use them.

1) the numbers in the blanks must add to 20.

2) the numbers in the blanks must all be at least 1

2a) Said another way, the numbers in the blanks can be stated as 1,1+a,1+b,1+c,1+d,1+e,1+f,1+g,1+h,1+i

3) There is a relationship between a and the number of letters that are non-zero.

And while I've omitted one important observation, I've probably said too much :-)

Re: Puzzle -- self-describing sentences

#9

The single-digit solution

Alex Y

This doesn't seem to be drawing any guesses or partial answers, so here is the solution and answer, repeating some from the previous hint.

the number of occurrences of 0 is _, of 1 is _, of 2 is _, of 3 is _, of 4 is _, of 5 is _, of 6 is _, of 7 is _, of 8 is _, and of 9 is _

Start with a few observations:

1) the numbers in the blanks must add to 20.

2) the numbers in the blanks must all be at least 1

2a) Said another way, the numbers in the blanks can be stated as 1,1+a,1+b,1+c,1+d,1+e,1+f,1+g,1+h,1+i

2b) a+b+c+d+e+f+g+h+i = 10

3) a+1 = number of 1's in the sentence = 1 (from the original) + 1 (the number of 0's) + the number of zeros in a,b,c,d,e,f,g,h,i

or: a=1+number of zeros in a,b,c,d,e,f,g,h,i = 1+ 9-number of non-zeros in a,b,c,d,e,f,g,h,i

Since a is non-zero, a= 9-number of non-zeros in b,c,d,e,f,g,h,i

and a final rearrangement,

the number of non-zeros in b,c,d,e,f,g,h,i = 9-a

4) Using the relationships in (2) and (3), we can see what the other letters must equal for each possibility for a, and see which one works. As an example, if a=5, there are four non-zero numbers among b,c,d,e,f,g,h,i, whose sum is 5. The only way that can happen is for those numbers (in no particular order at this point) to be 2,1,1,1. If this is a solution, it means that 6,3,2,2,2 must be in the blanks, and the rest filled with 1's. But that means there will be 4 2's, but there is no 4 in this solution.

You can try other values for a and fail until you come up with a=6. 3 of b,c,d,e,f,g,h,i add to 4, meaning they are 2,1,1. In this case, the blanks in the original are filled with 7,3,2,2 and the rest 1's

the number of occurrences of 0 is 1, of 1 is 7, of 2 is 3, of 3 is 2, of 4 is 1, of 5 is 1, of 6 is 1, of 7 is 2, of 8 is 1, and of 9 is 1

That works!

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.