English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

we wish to make a string of letters which contains every possible three letter combinations of P's and Q's somewhere(that is, it mustcointain all these: PPP,PPQ,PQP,PQQ, QPP, QPQ,QQP and QQQ). An example of such a string,of length 18 is, PPPPQPQQPPQPQQPQQQ
What is the length of the shortest such string?

A:8

B:10

C:12

D:16

E:18

please show how you worked it out.

2006-07-10 14:59:09 · 5 answers · asked by hello 2 in Science & Mathematics Mathematics

5 answers

qqqpppqpqq

B 10

i used guessed and check

2006-07-10 15:06:11 · answer #1 · answered by Russel 1 · 3 1

First we agree there are 8 combinations, so the best we can do is if we overlap the last two letters of one combination with the next. That would be 8 overlaps plus the starting and ending letters, for a total of 10.

But to prove this we have to find a way to overlap all 8 combinations. The way I did this was to start with PPP. The next letter will be the opposite of the first letter in the sequence of 3 letters. So PPP will go to PP+Q.
PPQ will go to PQ+P
PQP will go to QP+Q
etc.

The full sequence is:
PPP --> PPQ --> PQQ --> QQQ --> QQP --> QPQ --> PQP --> QPP

(Notice how this returns to PPP next, so we have completed the circle).

Anyway putting this together you get:
PPPQQQPQPP

(Also, you can create different arrangements by cycling these letters, or reversing the whole string, but they are all 10 letters long. That is the minimum.)

So the answer is:
B: 10.

2006-07-10 15:45:49 · answer #2 · answered by Puzzling 7 · 0 0

ppp,ppq,pqp,pqq,qpq,qqp,qqq,qpp so...

qqpppqpqqq
so 10 is my answer, mostly because this is giving me a headache

2006-07-10 15:06:41 · answer #3 · answered by meatball822 3 · 0 0

Answer= A.8 (solved it on a Microsoft word document)

2006-07-10 15:03:58 · answer #4 · answered by CLBH 3 · 0 0

answer = FAHQ

2006-07-10 15:03:17 · answer #5 · answered by Captain Obvious 1 · 0 0

fedest.com, questions and answers