Strings in the MIU System

Logic Level 1

In the M I U MIU system, you always start with the string M I MI and then form new strings by applying any of following rules any number of times:

Rules Examples
1. If your string ends with I I , you can add a U U at the end. M I M I U MI\longrightarrow MIU
2. You can double the entire string following M . M. M I U M I U I U MIU\longrightarrow MIUIU
3. Three consecutive I I 's can be replaced with a single U . U. M I I I U M U U MIIIU\longrightarrow MUU
4. Two consecutive U U 's can be removed from the string. M U U M MUU\longrightarrow M

Which of the following strings can be derived from M I MI using these rules?

Note: None of the rules can be used in the opposite way; for example, you aren't allowed to derive M U U I MUUI from M I MI by using a reversed version of rule 4.


Source: The M I U MIU puzzle was introduced by Douglas Hofstadter in his magisterial work Gödel, Escher, Bach .

M U MU M U I I I MUIII M I I U I U I MIIUIUI M I I U I U I I U I MIIUIUIIUI

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

16 solutions

Steve Gualtieri
Feb 11, 2018

Start by making an observation that will be helpful in excluding impossible results: by repeatedly applying rule 2 to M I MI , I I always comes in powers of 2. Moreover, every U U corresponds to 3 I I in a previous step and therefore I I only disappears in groups of 6. There is an exception when a final U is added to only remove the final three U U 's in the string. Though, multiple use of this trick can be replaced with combinations of steps 2,3 and 4 and an eventual sole use of rule 1.

We can now proceed as follows:

M U MU can't be derived form M I MI : you could try to repeatedly apply rule 2 to M I MI , then rule 3 and finally rule 4 so you finally end up with just one U U . Though, as noted, rule 1 always gives you a number of I I 's that is a power of 2, but you need them to be a multiple of 3 if you want no I I 's left.

If you apply the same way of reasoning to M U I I I MUIII , you see that you'd need to start from 6 n + 6 6n+6 consecutive I I 's, so you have 2 I I 's followed by 2 n + 1 2n+1 consecutive U U that you can eliminate. Again, 6 n + 6 6n+6 is not a power of 2 (It's a multiple of 3!), so it's not a number of I I 's that you can have. If rule 1 was applied at some point to eliminate a group of 3 I I 's at the end, you'd have to work with 6 n + 9 6n+9 . This number is not only divisible by 3, but it is also an odd number.

Finally, M I I U I U I I U I MIIUIUIIUI corresponds to 15 + 6 n 15+6n consecutive I I 's, or to 18 + 6 n 18+6n if rule 1 was used. Again, the former number is odd and the latter is a multiple of 3, so none of them is ever a power of 2.

We also give a possible way to obtain the M I I U I U I MIIUIUI , i.e. the right answer:

M I MI
M I I I I I I I I I I I I I I I I MIIIIIIIIIIIIIIII By 4 consecutive applications of Rule 2
M I I U I U I U U MIIUIUIUU By application of Rule 3 on selected groups of I I
M I I U I U I MIIUIUI By application of Rule 4 on the two U U at the end of the previous string.

P.S. Thanks to everyone ho reported an issue in either the problem or this solution.

I think MIIU (the second of the multiple choice options) can be formed from MI.

By rule 2 MI goes to MII

Then by rule 1, MII goes to MIIU.

Peter Macgregor - 3 years, 4 months ago

Log in to reply

It definitely does. Shame on my writing of this problem. That string should be replaced with M U I I MUII unless i did my numbers wrong again.

Thanks for noticing!

Steve Gualtieri - 3 years, 4 months ago

Log in to reply

Actually, if my work is correct, you can also form MUII from MI.

MI MII MIIII MUI MUIU MUIUUIU MUIIU MUIIUUIIU MUIIIIU MUIIIIUUIIIIU MUIIIIIIIIU MUIIIIIUU MUIIIII MUIIIIIU MUIIUU MUII

I don't believe there are any mistakes with this, but could you check my work?

Andrew Alvarez - 3 years, 3 months ago

Log in to reply

@Andrew Alvarez I just checked your work, and I do agree that it is correct. However, the second choice on the multiple choice options is "MUIII", and your string solely ends with 2 I's as opposed to 3. Besides that, you are correct.

Sylvester Mathiyalagan - 3 years, 3 months ago

Log in to reply

@Sylvester Mathiyalagan This problem used to have two correct answers because of an error of mine, and M U I I MUII was the other one together with M I I U I U I MIIUIUI . Many people had obviously noted and reported the issue ad it has been hence been fixed :)

Steve Gualtieri - 3 years, 3 months ago

Log in to reply

@Steve Gualtieri Ahh I understand! Thank you for clarifying this. :)

Sylvester Mathiyalagan - 3 years, 3 months ago

I think MUII can be formed this way. Rule 2: MI MII MIIII MIIIIIIII, rule 1: MIIIIIIIIU, rule 3: MUIIIIIU MUIIUU, rule 4: MUII

Elden Gandy - 3 years, 3 months ago

MUII (option 2) works through the below steps:

MI MIIIIIIII MUIIIII MUIIIIIUIIIIIUIIIIIUIIIII MUIIIIIUIIIIIUIIIIIUIIIIIU MUII IIIU II IIIU II IIIU II IIIU (separating to show next step more clearly) MUIIUUIIUUIIUUIIUU MUIIIIIIII MUIIUU MUII

William Amend - 3 years, 3 months ago

Though, as noted, rule "2" always gives you a number of I that is a power of 2, not rule 1. Besides that it is a really good explanation.

René Kötter - 3 years, 3 months ago

Great solution, l am wondering why they placed it in basic section.

Adarsh Adi - 3 years, 3 months ago

Can someone please explain why MU is not valid? MI, MII, MIII, MU

jeff z - 3 years, 3 months ago

Log in to reply

I was mislead by that one, too. I thought a simple application of rule 2, rule 2, and then rule 3 would do the trick. However:

MI -> MII -> MIIII -> MUI

Lex Giesbrecht - 3 years, 3 months ago

You can't add a single I at the end, just double everything that follows the M.

On a small historical and didactical note, the MIU system was introduced by Emil Post in the 1920's and popularized by Douglas Hofstadter in his book Gödel, Escher, Bach to familiarize people with the concept of Formal Systems , i.e. a set of axioms and logical rules that you can apply to those axioms in order to obtain theorems. Mathematics, of course, is such a system.

In the MIU system, MI is the axiom and every other string that you can obtain from it following the 4 rules is a theorem. In his book, Hofstadter shows how not all strings are theorems taking exactly MU as an example. You can see it this way: sometimes, seemingly acceptable strings -such as MU- are not theorems. This is an extreme semplification of Gödel's Incompleteness Theorem.

Steve Gualtieri - 3 years, 3 months ago

I think you missed the possibility to remove 3 I's: first double I a few times (power of 2), then add a single U, then replace the last /three/ I's with a U and then remove both U's to get 2 n 3 2^n-3 I's.

Ron van den Burg - 3 years, 3 months ago

You can actually end up with MU Mi - Mii - Miiii - Miiiiu -Muiu - Muiuuiu - Muiiuuiuuiu - Muiiiu - Muuu - Mu following these rules: first, double up, then double up again (using rule 2), then place a 'u' after the 'i' (using rule 1) then turn the first 3 'I' into a 'U' (rule number 3), double up twice again (following rule number 2), now remove the double 'U' then turn the last 3 'I' into a 'U' (rule number 3) to finally remove two conservative 'U'...

marieke Elzer - 3 years, 3 months ago

Log in to reply

"Muiuuiu - Muiiuuiuuiu" What did you do in this step?

Kevin Weatherwalks - 3 years, 3 months ago

Log in to reply

I see what happened.
MUIUUIU --> MUIUUIUUIUUIU --> MUIIUUIUUIU --> MUIIIUUIU --> MUIIIIU

There should be 4 i's in between the u's, not 3.

Kevin Weatherwalks - 3 years, 3 months ago

Log in to reply

@Kevin Weatherwalks Yeah, when I later reread my steps I realised I made a mistake in writing down... sorry

marieke Elzer - 3 years, 3 months ago

MI
MII By rule 2
MIIII By rule 2
MIIIIU By rule 1
MUIU By rule 3
MUIUUIU By rule 2
MUIIU By rule 4
And now I honestly don't have 3 consecutive U's.

By the way, this is not what you did in your listed example: you pass from MUIUUIU to MUIIUUIUUIU which is application of no rule.

Steve Gualtieri - 3 years, 3 months ago

Every U U corresponds to 3 I I in a previous step and therefore I I only disappears on groups of 6

This isn't quite true because of rule 1 though, no? You can always just produce a new U if the string ends in an I. So e.g.:

M I 2 2 M I I I I 1 M I I I I U 3 M I U U 4 M I MI \rightarrow_{2}^{2} MIIII \rightarrow_{1} MIIIIU \rightarrow_{3} MIUU \rightarrow_{4} MI

you can remove I I s in groups of 3 too.

Alec Benzer - 3 years, 3 months ago

Log in to reply

What you say is true and I'm going to correct my solution, as it also needs an update on the previously corrected answer.

Keep in mind though that this makes for a one time exception, meaning that any even number of the "add a final U U , turn the final three I I 's to a U U and remove the double U U " process that you described can be replicated via an appropriate application fo rules 2, 3 and 4.

Steve Gualtieri - 3 years, 3 months ago
Alice Smith
Feb 18, 2018

Patten matching and replacement are the wolfram language's unique features.

Mathematica Code:

L = Nest[DeleteDuplicates@ Flatten@{#, StringReplaceList[#, {x_ ~~ "I" ~~ WordBoundary :> x ~~ "I" ~~ "U", "M" ~~ x__ ~~ WordBoundary :> "M" ~~ x ~~ x, "III" -> "U", "UU" -> ""}]} &, {"MI"}, 9];

MemberQ[L, #] & /@ {"MU", "MUII", "MIIUIUI", "MIIUIUIIUI"}

Which gives us: {False, True, True, False}

I think the second one and the third one are both correct.

That's a nice coded solution - I never thought of trying a computation for this problem.

I think the '9' at the end means that you run through the rules nine times. Is that correct? If so I think that while your program correctly identifies the second and third as computable strings, you can not say with certainty that the first and last string will not appear if you run through more iterations.

Peter Macgregor - 3 years, 3 months ago

Log in to reply

Hmm...You're right.But because of the memory and the computation time,I decided to iterate 9 times.You can iterate more times if you want,however,it would take too much time and memory.

Alice Smith - 3 years, 3 months ago

You can surely get 3rd answer (M I I U I U I) by doing this:

  1. On MI you use rule 2, you get MII.

  2. On MII you use second rule again, you get MIIII.

  3. On MIIII you apply rule 2 another time and you get M with 8 I.

  4. Using rule 1 you add U at the end, you get MIIIIIIIIU.

  5. Next you use rule 2 to double entire string, you recieve MIIIIIIIIUIIIIIIIIU.

  6. Applying rule 3 you exchange III for U, you get string MIIUUUIUIUU.

  7. Using rule 4 you delete U pairs, you recieve MIIUIUI, which is the 3rd answer.

Therefore the answer 3 (MIIUIUI) is correct as well, you are not obliged to use rules (e.g. in my second step you recieve MIIII but you don't have to exchange III for U immediately [Three consecutive I's CAN be replaced with a single U.]).

Marcin Popławski - 3 years, 3 months ago

I will call "MI" "m(1)", "MIII" "m(3)", "MIIIIII" m(6), and so on.

You can derive m(2n) from m(n) for any natural number n, because of rule 2. You can derive m(n-3) from m(n) for any number greater than 3, because of rules 1, 3 and 4: Add an 'U' at the end, replace the last three 'I' by 'U' and then remove the 'UU'. I will call this "rule134".

The four proposed solutions are:

1) MU <-rule3- m(3) <-rule134- m(6) 9, 12, 15, 18, ... You never get to a number of 'I' that isn't divisable by three with adding three or halving. But you need to get to one 'I'. You can't get rid of the prime factor 3.

2) MUII <-rule3- m(5) <-rule134- m(8) <-rule2 three times- m(1), so it's derivable.

3) MIIUIUI <-rule3- m(10) <-rule2- m(5). m(5) is already shown to be derivable.

4) MIIUIUIIUI <-rule3- m(15) <- same as solution 1. I don't know if that's a proof yet.

Felix Müller - 3 years, 3 months ago

Answer 2 is "MUIII" with three Is, not "MUII" with only two. That probably explains why your code incorrectly gave True for answer 2.

Richard Peers - 3 years, 3 months ago

Log in to reply

The problem was changed after I posted this solution:)

Alice Smith - 3 years, 3 months ago

Unique feature? You might want to check https://en.wikipedia.org/wiki/Pattern_matching.

Denis Husadzic - 3 years, 3 months ago
Arjen Vreugdenhil
Feb 20, 2018

Consider what the rules do to the number of I I s in the string.

Rules 1 and 4 do not affect the number of I I s. Rule 2 doubles it; rule 3 subtracts 3.

The latter fact suggests that we consider the remainder of I I after division by three. Rules 1, 3, and 4 do not affect this remainder. Only rule 2 changes it, according to the pattern 1 2 ; 0 0 1 \leftrightarrow 2;\ \ \ \ 0 \leftrightarrow 0 Since we start with one I I , the remainder will always be 1 or 2. It is impossible to make it zero; i.e. the number of I I s can never a multiple of 3.

Of the four given strings, M U MU has zero I I s; M U I I I MUIII has three; M I I U I U I I U I MIIUIUIIUI has six. These are multiples of 3 and can therefore not be produced. This leaves M I I U I U I \boxed{MIIUIUI} with four I I s.


Recipe for producing a given string:

Let s = M x 1 x 2 x n s = Mx_1x_2\dots x_n , with x i { I , U } x_i \in \{ I,U \} ; let a a be the number of I I s, b b the number of U U s, and a a not a multiple of 3. For j = 1 , , b j = 1, \dots, b , let c j c_j be the position of the j j th U U in the string.

s = M I I U I U I ; n = 7 , a = 4 , b = 2 , c 1 = 4 , c 2 = 6. s = MIIUIUI; n = 7, a = 4, b = 2, c_1 = 4, c_2 = 6.

  • Define m = a + 3 b m = a + 3b . If a a is one greater than a multiple of three, let k k be the smallest even integer such that 2 k m 2^k \geq m . If a a is one less than a multiple of three, let k k be the smallest odd integer such that 2 k m 2^k \geq m .

m = 4 + 3 2 = 10 , k = 4 ( 2 4 = 16 10 ) . m = 4 + 3\cdot 2 = 10, k = 4\ \ \ \ (2^4 = 16 \geq 10).

  • Let s = 1 3 ( 2 k m ) s = \tfrac13(2^k - m) , which is necessarily an integer. Write s = 2 t + r s = 2t + r , with r = 0 r = 0 if s s is even and r = 1 r = 1 is s s is odd.

s = 1 3 ( 2 4 10 ) = 2 ; t = 1 , r = 0. s = \tfrac13(2^4 - 10) = 2;\ t = 1, r = 0.

  • Step 1 . Start with M I MI .

  • Step 2 . Apply rule 2 k k times.

M I M I I I I I I I I I I I I I I I I 16 × MI \mapsto M\underbrace{IIIIIIIIIIIIIIII}_{16\times}

  • Step 3 . Apply rule 3 b b times. For j = 1 , , b j = 1, \dots, b , replace the I I I III starting at position c j + 2 ( j 1 ) c_j + 2(j - 1) by U U .

M I I I I I 4 6 I I I I 8 10 I I I I I I I M I I U I U I I I I I I I MII\underbrace{III}_{4-6}I\underbrace{III}_{8-10}IIIIIII\mapsto MIIUIUIIIIIII

  • Step 4 . If r = 1 r = 1 , apply rule 1.

  • Step 5 . Apply rule 3 s s times. For j = 1 , , s j = 1, \dots, s , replace the I I I III starting at position n + 1 + 3 ( j 1 ) n + 1 + 3(j - 1) by U U .

M I I U I U I I I I 8 10 I I I 11 13 M I I U I U I U U MIIUIUI\underbrace{III}_{8-10}\underbrace{III}_{11-13}\mapsto MIIUIUIUU

  • Step 6 . Apply rule 4 t t times to the last 2 t 2t characters of the string.

M I I U I U I U U M I I U I U I MIIUIUI\underbrace{UU}_{}\mapsto MIIUIUI

This recipe generates the string in k + b + r + s + t k + b + r + s + t steps. This may not be optimal; certain strings exhibit symmetry that allows us to apply rule 2 later in the process.

Wow, good job on the 'recipe' part. Really cool.

Markus Pfaff - 3 years, 3 months ago

Multiple solutions exist for MIIUIUI, (four are shown, one is elaborated):

Assign I=1 and U=3:

so the transforms (rules) are: R1(x) = x +3, R2(x) = x * 2, R4(x) = x - 6 and R3 has NO CHANGE in value

Interestingly, Rule#2, R2 makes the result EVEN , and is R2 is required for growing a long string (so only if R1 is the last transform, can the answer be odd)

all answers evaluate to: A=3, B=6, C=10 , and D=15, and C is an early candidate being EVEN. In fact, by plain evaluation, NO SOLUTION DIVISIBLE BY 3 IS POSSIBLE as the +3 and -6 and x2 rules can never alter the by-3-divisibility of any number, so only one answer (C = 10) remains. SOLVED!!!

To manually verify this solution, candidate solutions include:

  • 10=(1 * 2 + 3) * 2 (not valid solution: ELIMINATED)
  • 10= *1 * 2 * 2 * 2 * 2 - 6 * (solution #1: VALID)
  • 10= (1 * 2 * 2 * 2 + 3) * 2 - 6 - 6 (solution #2: VALID - see below)
  • 10= (1 * 2 * 2 + 3) * 2 * 2 - 6 - 6 - 6 (solution #3: VALID)
  • 10= (1 * 2 * 2 * 2 * 2 * 2 + 3) * 2 - ( 6 * 10) (solution #4: VALID)
  • ... many other solutions possible

worked example for solution #2:

  • R2(MI)=MII (1 * 2 = 2)
  • R2(MII)=MIIII (2 * 2 = 4)
  • R2(MIIII)=MIIIIIIII (4 * 2 = 8)
  • R1(MIIIIIIII) = MIIIIIIIIU (8 + 3 = 11)
  • R2(MIIIIIIIIU) = MIIIIIIIIUIIIIIIIIU (11 * 2 = 22)
  • R3(MIIIIIIIIUIIIIIIIIU) = MIIUUUIUIUU (22 = 22)
  • R4(MII UU UIUI UU ) = MIIUIUI ( 22 - 6 - 6 = 10)

Interesting hint: even interim solutions divisible by three are never allowed, so that hint might help anyone that breaks down the problem into chunks, branches, or is working backwards from the solution.

This is exactly how I worked this out, too. The +3 operator means that the -6 operator can be simplified to -3. I believe any number x of I's that isn't a multiple of 3 can be made, it's just a case of finding a power of 2 that is larger than x and congruent to x modulo 3.

Trevor Pike - 3 years, 3 months ago

just for fun, a random solution in 22 steps (using recursion in java), note that rule 1 is obsolete

MI rule2: MII rule2: MIIII rule2: MIIIIIIII rule2: MIIIIIIIIIIIIIIII rule3: MUIIIIIIIIIIIII rule3: MUUIIIIIIIIII rule3: MUUUIIIIIII rule4: MUIIIIIII rule2: MUIIIIIIIUIIIIIII rule3: MUUIIIIUIIIIIII rule2: MUUIIIIUIIIIIIIUUIIIIUIIIIIII rule3: MUUUIUIIIIIIIUUIIIIUIIIIIII rule3: MUUUIUUIIIIUUIIIIUIIIIIII rule4: MUIUUIIIIUUIIIIUIIIIIII rule4: MUIIIIIUUIIIIUIIIIIII rule3: MUUIIUUIIIIUIIIIIII rule4: MIIUUIIIIUIIIIIII rule3: MIIUUUIUIIIIIII rule4: MIIUIUIIIIIII rule3: MIIUIUUIIII rule3: MIIUIUUUI rule4: MIIUIUI

Laurent Apicella - 3 years, 3 months ago
Robert Szafarczyk
Feb 19, 2018

Taking M=0, I=1, U=0 (mod 3) we obtain that the only rule which changes the sum of letters (mod 3) is rule 2. Since we can only double our sum and start with 0+1=1 the only values we can get are 1 and 2 (mod 3). All answears except for MIIUIUI have a sum equal to 0 (mod 3) thus it is the only possibility.

Very nice solution, Robert!

Geoff Pilling - 3 years, 3 months ago

Log in to reply

Thanks! BTW I've just realised that instead of taking I=2 and everything (mod 6) I can take I=1 and everything (mod 3).

Robert Szafarczyk - 3 years, 3 months ago

Log in to reply

Now it's even better :)

Robert Szafarczyk - 3 years, 3 months ago

Log in to reply

@Robert Szafarczyk I like elegant solutions! Was trying to think of one myself... :-)

Geoff Pilling - 3 years, 3 months ago
Zachary Lim
Feb 20, 2018

Each string can be assigned a value x x based on its elements by adding 1 1 for every I I and 3 3 for every U U . For example, M I MI will have an x x of 1 1 and M I I U I U I MIIUIUI will have an x x of 10 10 .

The four rules can then be analyzed in terms of how they affect x x : rule 1 increases it by 3 3 , rule 2 doubles it, rule 3 doesn't change it, and rule 4 reduces it by 6 6 . Now it becomes apparent that x x will always have the form 2 m + 3 n 2^m + 3n where m m and n n are integers.

This reduces the problem of determining whether a given string can't be derived (see note) to determining if its x x can be expressed in the form 2 m + 3 n 2^m + 3n . And because 2 m m o d 3 0 2^m \bmod 3 \neq 0 , it follows that x m o d 3 0 x \bmod 3 \neq 0 as well.

The x x of the 4 options are 3 3 , 6 6 , 10 10 , and 15 15 respectively, making option 3 ( M I I U I U I MIIUIUI ) the only possible string.

Note: In this solution, I only proved that all acceptable strings have an x x of the form 2 m + 3 n 2^m + 3n and used modus tollens to disqualify options 1, 2, and 4. This does not imply that all strings with an x x of the form 2 m + 3 n 2^m + 3n are acceptable; that would be affirming the consequent. The next step would be to try to prove that a string is acceptable if and only if its x x is of the form 2 m + 3 n 2^m + 3n .

The final result obtained can be said to be derived from M followed by a certain number of I 's ( that is MII or MIIIII and so on). Using rules 1, 2 and 4 the number of I 's can increase by doubling and reduce by 3 each time.

Thus the number of I's is of the form a × 2 b 3 × c a \times 2^{b} - 3 \times c or a × 2 b a \times 2^{b} , such that a itself is of the aforementioned form or equals 1, the starting value.

This makes it impossible to get the number of I 's to be a multiple of 3. Since 1 is not divisible by 3 , any a 0 = 1 × 2 b 3 × c a_{0} = 1 \times 2^{b} - 3 \times c won't be divisible by 3 and by induction any a N = a N 1 × 2 b 3 × c a_{N} = a_{N-1} \times 2^{b} - 3 \times c will not be divisible by 3 .

Each of the 4 options can be written as

  • M III, (3)
  • M III III, (6)
  • M II III I III I, (10) (hence, this is the only valid option)
  • M II III I III II III I, (15)
Ron van den Burg
Feb 23, 2018

Let n n be the nr of I-equivalents (nr of I's plus 3 times nr of U's) in the string.

If n = 3 m n=3m for some integer m m , the solution is impossible. This excludes 3 optional answers.

If n = 3 m + 1 n=3m+1 , let k = 4 l ( 3 m + 1 ) 3 k=\frac{4^l -(3m+1)}{3} for some large enough l l .

If n = 3 m + 2 n=3m+2 , let k = 2 4 l ( 3 m + 2 ) 3 k=\frac{2*4^l -(3m+2)}{3} for some large enough l l .

  1. Start with MI.
  2. Double 2 l 2l times, resp. 2 l + 1 2l+1 times (rule 2).
  3. If k k is odd, add one U (rule 1).
  4. Replace the last 3 k 3*k I's with U's (rule 3). There are an even nr of U's now at the end.
  5. Remove all UU's (rule 4).
  6. For every U in the required string, find the corresponding I-triplet and replace that I-triplet with a U (rule 3).

PROOF

Consider the nr. of I-equivalents n n and consider the remainder of n n after division by 3.

Rule 1 adds 3 3 to n n . The remainder stays the same.

Rule 2 doubles n n . The remainder 0 stays 0; remainder 1 becomes 2 and 2 becomes 1.

Rule 3 doesn't change n n . The remainder also stays the same.

Rule 4 reduces n n by 6. The remainder stays the same.

If you start with M I MI , you start with n = 1 n=1 and you can not get a remainder 0 0 by using the rules.

If the remainder of the n n of the result is 1 1 , there is an integer m m such that n = 3 m + 1 n=3m+1 . Let k = 4 l ( 3 m + 1 ) 3 k=\frac{4^l -(3m+1)}{3} for some large enough l l . Check that k k is always integer since its numerator is always divisible by 3. k k now represents the number of I-triplets that we have to remove after doubling to M I I . . . ( 2 l MII...(2l nr of I's ) . . . I )...I to get the string with the correct nr of I-equivalents. We can only reduce two U U 's or 6 6 I-equivalents per application of rule 4, so we have to add one U first if k k is odd. This is always possible because we start with a string ending with I, and doubling keeps an I at the end. Now it's just a matter of replacing the proper I-triplets with a U.

The case where the remainder of the n n in the result is 2 is similar.

Three of the answer options have a nr of I-equivalents with remainder 0, so they can't be produced starting with MI.

MIIUIUI can thus be produced. It has n = 10 n=10 with remainder 1 1 , m = 3 m=3 , l = 2 l=2 and k = 2 k=2 which is even:

(0) MI

(2) MII

(2) MIIII

(2) MIIIIIIII

(2) MIIIIIIIIIIIIIIII

(3) MIIIIIIIIIIIIIU

(3) MIIIIIIIIIIUU

(4) MIIIIIIIIII

(3) MIIUIIIII

(3) MIIUIUI

Jam M
Feb 22, 2018

M I M I I MI \rightarrow MII by Rule 2

M I I M I I I I MII \rightarrow MIIII by Rule 2

M I I I I M I I I I I I I I MIIII\ \rightarrow MIIIIIIII by Rule 2

M I I I I I I I I M I I MIIIIIIII \rightarrow MII I I I III I I I I I III I I I III I I I III I I by Rule 2

M I I MII I I I III I I I I I III I I I III I I I III I I \rightarrow M I I U I MIIUI U U UU U I UI by Rule 3

M I I U I MIIUI U U UU U I UI \rightarrow M I I U I U I MIIUIUI by Rule 4

Hanmo Yao
Feb 22, 2018

The U is not the problem here since every U can be obtained by consuming three Is. Therefore, we only have to concern about the I. That's to say, we presume that every string in the option can only be obtained by applying rule 2. In addition, as we can hardly manipulate complex strings once there is a U in the string, we can tell every string in the option can only be obtained by doubling I after the M each time. Therefore, we only have to care about the amount of I behind M: if the amount is even, we call it obtainable. How about the U then? As shown in rule 3, a single U can be considered as 3 Is. We can then define S = amount ( I ) + 3 * amount ( U ) where if S is even, this string is obtainable

Bernhard Seifert
Feb 21, 2018

Given are the four production rules

  • R 1 R_1 (append a U if the string ends with an I)
  • R 2 R_2 (append a copy of the string after the M)
  • R 3 R_3 (replace an III by a U)
  • R 4 R_4 (delete a UU),

a start string s 0 = s_0 = MI, and four strings, (at least) one of which can be derived from s 0 s_0 using the rules. The question is: which one? - If a string t t results from a string s s by using a rule R R , let's write s R t s R \to t .

For any n N n \in \mathbb{N} let's define the set of strings ('words') that can be derived from s 0 s_0 using n n steps by

W 0 : = { s 0 } W_0 := \{ s_0 \}

W n + 1 : = { t s W n W_{n+1} := \{ t | \exists s \in W_n with s R 1 t s R 2 t s R 3 t s R 4 t } s R_1 \to t \lor s R_2 \to t \lor s R_3 \to t \lor s R_4 \to t \}

and let W : = n N W n W := \bigcup\limits_{n \in \mathbb{N}} W_n denote the set of all derivable strings.

For any string s s let i ( s ) i(s) denote the number of "I"s in it. The four rules affect it like this:

  • If s R 1 t s R_1 \to t , then i ( t ) = i ( s ) i(t) = i(s)
  • If s R 2 t s R_2 \to t , then i ( t ) = 2 × i ( s ) i(t) = 2 \times i(s)
  • If s R 3 t s R_3 \to t , then i ( t ) = i ( s ) 3 i(t) = i(s) - 3
  • If s R 4 t s R_4 \to t , then i ( t ) = i ( s ) i(t) = i(s) .

Claim. For all s W s \in W there are a , b N a, b \in \mathbb{N} with i ( s ) = 2 a 3 b i(s) = 2^a - 3b .

Proof. We reformulate the claim as n N , s W n : a , b N : i ( s ) = 2 a 3 b , \forall n \in \mathbb{N}, s \in W_n : \exists a, b \in \mathbb{N} : i(s) = 2^a - 3b, and use mathematical induction by n n .

n = 0 \underline{n = 0} . The number of "I"s in s 0 s_0 , which is 1, can be written as i ( s 0 ) = 1 = 2 0 3 × 0 i(s_0) = 1 = 2^0 - 3 \times 0 .

n n + 1 \underline{n \rightarrow n + 1} .

Let t W n + 1 t \in W_{n + 1} . Then there are s W n s \in W_n and a rule R R with s R t s R \to t . By induction hypothesis, there are a , b N a, b \in \mathbb{N} with i ( s ) = 2 a 3 b i(s) = 2^a - 3b . There are four cases:

  • If R R is R 1 R_1 , then i ( t ) = i ( s ) = 2 a 3 b i(t) = i(s) = 2^a - 3b ,
  • If R R is R 2 R_2 , then i ( t ) = 2 × i ( s ) = 2 ( 2 a 3 b ) = 2 a + 1 3 × ( 2 b ) i(t) = 2 \times i(s) = 2 ( 2^a - 3b ) = 2^{a + 1} - 3 \times (2b) ,
  • If R R is R 3 R_3 , then i ( t ) = i ( s ) 3 = 2 a 3 b 3 = 2 a 3 ( b + 1 ) i(t) = i(s) - 3 = 2^a - 3b - 3 = 2^a - 3(b + 1) ,
  • If R R is R 4 R_4 , then i ( t ) = i ( s ) = 2 a 3 b . i(t) = i(s) = 2^a - 3b. \square

Now for the options:

L 1 = L_1 = MU i ( L 1 ) = 0 i(L_1) = 0
L 2 = L_2 = MUIII i ( L 2 ) = 3 i(L_2) = 3
L 3 = L_3 = MIIUIUI i ( L 3 ) = 4 i(L_3) = 4
L 4 = L_4 = MIIUIUIIUI i ( L 4 ) = 6 i(L_4) = 6

If L 1 W L_1 \in W then there are a , b N a, b \in \mathbb{N} with 0 = 2 a 3 b 0 = 2^a - 3b . Then 2 a = 3 b 2^a = 3b . That's not true, because 2 a 2^a cannot be divided by 3.

If L 2 W L_2 \in W then there are a , b N a, b \in \mathbb{N} with 3 = 2 a 3 b 3 = 2^a - 3b . Then 2 a = 3 b + 3 = 3 ( b + 1 ) 2^a = 3b + 3 = 3(b + 1) . Also false for the same reason.

If L 4 W L_4 \in W then there are a , b N a, b \in \mathbb{N} with 6 = 2 a 3 b 6 = 2^a - 3b . Then 2 a = 3 b + 6 = 3 ( b + 2 ) 2^a = 3b + 6 = 3(b + 2) . ditto.

We've found: L 1 W , L 2 W , L 4 W L_1 \notin W, L_2 \notin W, L_4 \notin W .

So a correct answer can only be L 3 L_3 . Option 3: MIIUIUI .

Andrei Stephenson
Feb 21, 2018

Applying the rules in reverse to see how each could be arrived at will reveal the answer. MU - MIII Note MU isn't possible from MI since you could get an I by applying rule 2 but if you applied it again you'd get MIIII instead of three I's. Also it takes just a few tries to see that the other rules can do no better than the above MUIII - MIIIIII Now we reversed rule 3 to sub U with three Is and ended up with six Is. Again starting from MI we can apply rule 2 to double I to give MII then applying again we get MIIII and applying again we get MIIIIIIII that is eight Is and not six. From these it's same to say that M(2nI) isn't a possible string if n is odd MIIUIUI - MII(III)I(III)I Note we have a total of eight Is and from what we said above this is entirely possible therefore this is correct For the last option all we need to do to see that it is false is substitute each U with three Is and count the number of Is and check that it is false. There are three Us so those will give 9 Is along with the six remaining Is this gives a total of 15 Is which is odd therefore such a string is not possible.

Meneghin Mauro
Feb 21, 2018

Calling s s a sequence of symbol, i i the number of I in it, u u the number of U in it, I call

f ( s ) = i + 3 u f(s)=i+3u

rule 1 is tricky, I'm going to look at a subset of the possible productions generated considering rule 1 only applied at most once and considering it's value removed later by rules 3 and 4. This can could be extended considering the extra cases separately

  • t1 times apply rule 2
  • t2 times (0 or 1) apply rule 1
  • t3 times apply rule 3 (at the end of the sequence, such that (t2+t3) is even)
  • (t2+t3)/2 times apply rule 4
  • t4 times apply rule 3

With the above constraints:

f ( s ) = 2 t 1 3 t 3 f(s)=2^{t1} - 3*t3

Considering 2 t 1 ≢ 0 ( mod 3 ) 2^{t1}\not\equiv 0 (\textrm{mod} 3) , you can see that f(s) is never a multiple of 3, so f(MI)=3, f(MUIII)=6, f(MIIUIUIIUI)=15 cannot be generated, while f(MIIUIUI)=10 can. you can verify that even relaxing the constrain on the application of rule 1, this holds.

Roland Casalis
Feb 19, 2018

The number of I I is never divisible by 3. Indeed, this is true for the starting string M I MI and this property is stable by the four rules. Hence M I I U I U I MIIUIUI is the only possible answer. This does not show that M I I U I U I MIIUIUI is derivable though.

To show that this is stable by the four rules, note that rule 1 and rule 4 does not change the number of I I . If n n is the number of I I at a given step and n n is not divisible by 3, then by applying rule 2, the number becomes 2 n 2n which still isn't divisible by 3. By applying rule 3, the number becomes n 3 n-3 which still isn't divisible by 3.

  1. MI <start>
  2. MII <rule 2>
  3. MIIII <rule 2>
  4. MIIIIIIII <rule 2>
  5. MIIIIIIIIIIIIIIII <rule 2>
  6. MIIUIIIIIIIIIII <rule 3>
  7. MIIUIUIIIIIII <rule 3>
  8. MIIUIUIUIII <rule 3>
  9. MIIUIUIUU <rule 3>
  10. MIIUIUI <rule 4> Conclusion: string option C can be derived

Hi everyone, I'll be happy if someone can tell me what I did wrong, I got answer number 2 (MUII): MI (rule 2) MII (rule 2) MIIII (rule 2) MIIIIIIII (rule 1) MIIIIIIIIU (rule 3) MIIIIIUU (rule 4) MIIIII (rule 3) MUII

Answer number 2 - MUII

Thanks

alon raveh - 3 years, 3 months ago

Log in to reply

Answer 2 is MUIII, not MUII.

Marcin Popławski - 3 years, 3 months ago

Answer number 2 is MUIII not MUII

Dennis Oh - 3 years, 3 months ago
Sparsh Gupta
Feb 19, 2018

Any string of this type can be made only when it satisfy the equation x = 2ⁿ - 3k or we can say x is not divisible by 3. Where x is the number of 'I' in the string and also considering 'U' as 3 'I'. And n is a natural number while k is whole number. For Option 1. MU x = 3. So, 2ⁿ = 3 + 3k So equation can't be satisfy because LHS is not multiple of 3. For Option 2. MUII x = 5. So, by putting n = 3 and k = 1, equation is satisfy. Hence sting could be made by using (Rule 2) 3 times(n = 3) and then (Rule 1),(Rule 3)&(Rule 4) 1- 1 time (k = 1). Similarly for Option 3 method is shown below. For option 4 x = 15 divisible by 3. So can't formed. Please tell me if I wrong. Or this rule is correct. Thanks.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...