Jump to content
BrainDen.com - Brain Teasers
  • 0


superprismatic
 Share

Question


Here are the first 1001 digits of pi:

3.
14159265358979323846264338327950288419716939937510
58209749445923078164062862089986280348253421170679
82148086513282306647093844609550582231725359408128
48111745028410270193852110555964462294895493038196
44288109756659334461284756482337867831652712019091
45648566923460348610454326648213393607260249141273
72458700660631558817488152092096282925409171536436
78925903600113305305488204665213841469519415116094
33057270365759591953092186117381932611793105118548
07446237996274956735188575272489122793818301194912
98336733624406566430860213949463952247371907021798
60943702770539217176293176752384674818467669405132
00056812714526356082778577134275778960917363717872
14684409012249534301465495853710507922796892589235
42019956112129021960864034418159813629774771309960
51870721134999999837297804995105973173281609631859
50244594553469083026425223082533446850352619311881
71010003137838752886587533208381420617177669147303
59825349042875546873115956286388235378759375195778
18577805321712268066130019278766111959092164201989

We are to convert this into a string of letters.
We will use the assignment A=0, B=1, C=2, ..., Z=25
and these rules for making strings:

Let d(i) be the ith digit of pi (we ignore the
decimal point). We start with an empty string and
an index, n, initialized to 1.
1. if d(n) is in the set {0,3,4,5,6,7,8,9}, we
concatenate the letter corresponding to d(n)
to the string, then we increment n by 1.
2. if d(n) is 1 then we have the choice:
2a. concatinate B to our string, then
increment n by 1.
2b. concatenate the letter corresponding to
10+d(n+1), then increment n by 2.
3. if d(n) is 2 and d(n+1) is greater than 5, we
concatinate C to the string, then increment n
by 1.
4. if d(n) is 2 and d(n+1) is less than 6, we
have the choice:
4a. concatinate C to the string, then increment
n by 1.
4b. concatinate the letter corresponding to
20+d(n+1) to the string, then increment
n by 2.

The challenge is to determine how many different
strings we can make in this way from the first 1001
digits of pi.
[/code]

[b]

Note well:

It may seem that this problem is a good one for

a programmer. Not so! The number of strings

are so numerous that you cannot enumerate them

with a program. The real solution to this problem

rests with insight. Owing to the size of the data

set (1001 digits), it may be helpful to massage the

data using a program, but this is by no means

necessary, and it may actually increase the time

to solution.

[/b]

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

If my logic is correct...

2^177 or 1.91561942608236E+53 different strings, then take into account the 1s and 2s that are next to each other, which will reduce your choice by one for each set that is together, you get (2^177)-37 or (1.91561942608236E+53)-37

Link to comment
Share on other sites

  • 0

If my logic is correct...

2^177 or 1.91561942608236E+53 different strings, then take into account the 1s and 2s that are next to each other, which will reduce your choice by one for each set that is together, you get (2^177)-37 or (1.91561942608236E+53)-37

First of all, I think you miscounted the 1s and 20s, 21s, 22s, 23s, 24s, and 25s. There are 176 of them, not 177. Even with that, I think your number is way too big.

Link to comment
Share on other sites

  • 0

I counted all combinations which allow more strings (i.e. 1 and 2 followed by 0,1,2,3,4,5). In pi we have:

1x 1121 = once 4 digits

3x 211

1x 122

2x 111 = six times 3 digits

3x 22

11x 21

3x 12

8x 11 = 25 times 2 digits

plus 104 single digits

total number of possible strings is:

2^104 * 3^25 * 5^6 * 8 = approx. 2.15 * 10^48

Link to comment
Share on other sites

  • 0

You beat me to it Hugo, I went back and found my mistake and counted the multiples again like you did,

My first answer was off by a factor of 5.

excel gave me...

I agree with 2^104 * 3^25 * 5^6 * 8 being the formula,

2^104 = 2.02824096036517 E+31

3^25 = 847,288,609,443

5^6 = 15625

8^1 = 8

Multiplied together you get 2.14813182865392E+48

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...