State a correlation that associates a distinct natural number with each string made from the infinite alphabet set

49 Views Asked by At

We are asked to take strings made from the set of infinite alphabet letters and assign them each one unique natural number. So from a string, we would get a unique number. We also have to make sure that if given a number, we can find it's unique string. So there is a 1-1 correspondence between the strings and the numbers. The question shows one way of doing things which is wrong because a number can end up being equal to two different strings since we are working with an infinite alphabet set. But this is the only way I can think go assigning strings to numbers. I cannot figure out how I would assign strings to numbers so that each number would also get a unique string. Any help would be appreciated and a final answer would help me a lot. Thank you.

Here is the complete problem

1

There are 1 best solutions below

2
On

Let $p_{1},p_{2},\ldots$ denote the prime numbers. Let $a_{i_{1}}a_{i_{2}}\cdots a_{i_{n}}$ be a string. Following the hint, $$ a_{i_{1}}a_{i_{2}}\cdots a_{i_{n}}\leftrightarrow p_{1}^{i_{1}}p_{2}^{i_{2}}\cdots p_{n}^{i_{n}}. $$ In this way, the power of the $k$-th prime tells us the value of the $k$-th string. No two distinct strings get mapped to the same integer due to the fundamental theorem of arithmetic.