If A is a set of natural numbers and k is a natural number greater than 1, let
Bk(A) = {w | w is the representation in base k of some number in A}
For example, B2({3,7}) = {11, 111} and B3({3,7}) = {10, 21}
So the question asks us to give an example of a set A for which B2(A) is regular and B3(A) is not.
Well one thing is obvious, the set must be infinite. Otherwise you can always make a finite state machine for it. That observation doesn't help much :)
Try 1: A = set of all even numbers
Base 2 - The regular expression Σ*0 covers it.
Base 3 - It wasn't immediately apparent to me how to do it in base 3. But it can be...
We can have 2 states, one for remainder 0 and the other for remainder 1. 'remainder 0' is the accept state. Suppose the next input symbol is 2. If the input string so far represents x and we stick a 2 on the end, the new number will be 3x+2. If the old remainder was r, the new remainder will be (3r+2) mod 2. We can manage the transitions for other input symbols in a similar way.
Try 2: A = set of all powers of 2
Base 2 - 10*
Base 3
Here I am stuck. I cannot figure out a machine that will recognize this set.
If I want to show that this set is not regular, I guess I'll have to use the pumping lemma. But given an arbitrary number p, I can't think of a string longer than p symbols that is guaranteed to be a power of 2.
There's a big dilemma about the pumping lemma...Any help?
Bk(A) = {w | w is the representation in base k of some number in A}
For example, B2({3,7}) = {11, 111} and B3({3,7}) = {10, 21}
So the question asks us to give an example of a set A for which B2(A) is regular and B3(A) is not.
Well one thing is obvious, the set must be infinite. Otherwise you can always make a finite state machine for it. That observation doesn't help much :)
Try 1: A = set of all even numbers
Base 2 - The regular expression Σ*0 covers it.
Base 3 - It wasn't immediately apparent to me how to do it in base 3. But it can be...
We can have 2 states, one for remainder 0 and the other for remainder 1. 'remainder 0' is the accept state. Suppose the next input symbol is 2. If the input string so far represents x and we stick a 2 on the end, the new number will be 3x+2. If the old remainder was r, the new remainder will be (3r+2) mod 2. We can manage the transitions for other input symbols in a similar way.
Try 2: A = set of all powers of 2
Base 2 - 10*
Base 3
Here I am stuck. I cannot figure out a machine that will recognize this set.
If I want to show that this set is not regular, I guess I'll have to use the pumping lemma. But given an arbitrary number p, I can't think of a string longer than p symbols that is guaranteed to be a power of 2.
There's a big dilemma about the pumping lemma...Any help?

No comments:
Post a Comment