algorithm - Knuth the art of computer programming ex 1.1.8 -


I can not understand the meaning of what it means in my instructions for exercise 8 from chapter 1.1.

This task is to create an efficient GCD algorithm for its notation theta [j] using two positive integer m and n . >, phi [j] , b [j] and a [j] where theta and phi strings and a And b - positive integers that represent computational step in this case.

An input

a ^ mb ^ n

My question is How to use it for directions Along with it the algorithm can be associated with the original r (with the rest) | Mn | and replaced by n replaced by min (m, n)) .

When Knuth says, "input to string one ^ mb ^ n ", What does it mean that the input should take the form of m number a s and n number b S Ab .

Take a moment to look back on your equation 3 in that chapter, which shows someone. (Σ, j_)) = (σ, a_j) = (αφ_jω, b_j) if α does not contain θ_j (σ, j)) = (σ, a_j)

  f ((σ, j_)) = At least the string for which σ = αθ_jω f ((σ, N)) = (σ, N)  

So the idea is to define the sequence of each variable j To do, Θ_j, φ_j, a_j & amp; B_j . In this way, using the above Markov algorithm, you can specify what happens to your input string, depending on the value of j .

Now, to reach your main question;

My question is how can it be associated with the direction given in excercise to use its algorithm in the book along with the original R (remainder). Mn | And n is replaced by the minimum (M, N).

Essentially what Neuth is saying here, it is that you can not divide the above mentioned Markov's algorithm, then what is the closest to the partition? Okay, essentially we can reduce the smallest number by a large number till we leave it with the rest for example;

10% 4 = 2 is similar to the following:

  10 - 4 = 6 can we remove the other 4? Yes. Do it again 6 - 4 = 2 Can we remove another 4? No. We have our balance  

And now we have our balance. It is necessary that what does it mean that you have to do with our input string like appliance Please.

If you read the answer to the suggestion of Knuth behind the book and work through some examples, you will see that it is essentially by removing ab and then adding one It is doing this by adding c and not pairing ab . r = m% n, m = n, n = r (resume) . The difference is that in the above we have used the modulus operator and the division, but in the above example we have only used subtraction.

I hope it will be helpful. I actually read on my blog so if you are still feeling a bit stuck then read through the series.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -