Question text is in black, answers in blue.
Sorry, this could have been clearer in the book. For this problem, we have redefined the word "divides" to mean "is a substring of". With this definition, λ "divides" every string just as 1 divides every natural, and every string "divides" itself just as every natural divides itself. We define a positive natural to be prime if it is not 1 and the only naturals that divide it are 1 and itself. Similarly, we can now define a string to be "prime" if it is not λ and the only strings that "divide" it are λ and itself. Given this, you should be able to explain which strings are "primes" and prove that they satisfy the Atomicity Lemma.
No, I would like your method for Chinese remaindering to be self-contained, so that you can actually run and test it. This means writing a method to find inverses, which is only a few lines if you get it right. You also need a method to test relative primality -- implementing the Euclidean Algorithm is pretty easy either with or without recursion.
Of course, that is just better programming
style. As long as you have one method that does the job required,
of course it may call other methods that you have written.
Last modified 6 March 2011