Intereting Posts

Show that a certain set is measurable
Is there such a thing as partial integration?
The p-adic numbers as an ordered group
Is there a concept of |x|<0?
What is a number?
How many sorts are there in Terry Tao's set theory?
The ideal $I= \langle x,y \rangle\subset k$ is not principal
What do people mean by “finite”?
Inverse/Implicit Function Theorem Reasons?
Proof of the following fact: $f$ is integrable, $U(f,\mathcal{P})-L(f,\mathcal{P})<\varepsilon$ for any $\varepsilon>0$
Integral of Bessel function multiplied with sine
Integrating absolute value function
Adding Elements to Diagonal of Symmetric Matrix to Ensure Positive Definiteness.
Has anyone talked themselves into understanding Euler's identity a bit?
Do maximal proper subfields of the real numbers exist?

I’m going to write a program (function) that can convert a long string to a number. For this, first I convert each character (letter) to a number; like `a=0.01, b=0.02, c=0.03`

… . then for example I have:

abc // I don’t want to return 0.010.020.03 (because it is false in mathematic and the returned number length is more than the string length!), I want to have a certain number

that just belong to this characters (abc) combination and be less than the length of string. For example for this return 54 (just for example)

For example I can combine (+) these numbers but there are many problems with this way, and no I will have problem with combinations. Like abc will be `(0.01+0.02+0.03)=>0.06`

, but again bca, cba, bac,… (all combinations) will have same value (0.06)

- Accelerating Convergence of a Sequence
- Detecting perfect squares faster than by extracting square root
- How to arrange functions in increasing order of growth rate , providing f(n)=O(g(n))
- Algorithm for calculating $A^n$ with as few multiplications as possible
- Median of medians algorithm
- Finding the largest equilateral triangle inside a given triangle

**Any suggestion or help about how is this possible?**

- Calculate variance from a stream of sample values
- Non-power-of-2 FFT's?
- Determine the number of factors for extremely large numbers.
- Algorithm for creating binary rational numbers
- Finding XOR of all subsets
- How does Mathematica solve $f(x)\equiv 0\pmod p$?
- Graph Run Time, Nodes and edges.
- All pairs shortest path in undirected and unweighted graphs
- Guess the number despite false answer
- Dominant term and Big Omega

I believe that this question must be asked in Computer Science Stack Exchange.

If the conversion is one-way, I mean you don’t need to get the string from the number (the reason might be storing both the string and the number in database) then you can use hash codes that is available in every programming language.

You can also convert the string to hexadecimal decode, For example the hexdec() function in PHP does this, or pack/unpack also does the same (this is a two-way solution).

But in theory, if there is a sequence of numbers, $[a_1,a_2, … , a_n ]$ the following formula always generates a unique number for that sequence (Note, it is not a set it is a sequence) :

$$\prod_{i=1}^{n}{p_i}^{a_i}$$

where the $p_i$ is the $i$-th prime number. For example for $[2,4,7]$ it will be $2^2 \times 3^4 \times 5^7$ and by dividing the result to each prime number you can get the power number.

I guess the Huffman coding or Prefix code is also useful to convert string to a binary then convert the binary to decimal number.

If the alphabet consists of $m$ characters, then there are $m^n$ possible strings of length $n$. If you want to map each such string to a different nonnegative integer, then there are $m^n$ possible integers. If $m > 10$, some of those integers will have length greater than $n$.

It is impossible to device a method for doing this that works for ALL strings.

*Proof.* If $\phi$ is such a method, then your requirement means that $\phi(s)$ is a string shorter than $s$ for all inputs $s$. So, by applying it recursively, we see that for enough many repetitions $\phi(\phi(\cdots(s))\cdots)$ is a string with length 1 bit. Congratulations! You have compressed an unabridged version of collected works of Shakespeare to a single bit.

The methods for compressing data used in practice work, because the inputs TYPICALLY given to them can be compressed by a function that EXPANDS (the more common) atypical inputs. The average length of a random string cannot decrease as per the argument from Robert Israel’s answer.

- Solution set of cos(cos(cos(cos(x)))) = sin(sin(sin(sin(x))))
- Two basic examples of trace diagrams?
- Infinite product of measurable spaces
- Task “Inversion” (geometry with many circles)
- borel-measurable function is pointwise limit of a sequence of continuous functions, wich is uniformly bounded
- Group actions transitive on certain subsets
- Unbiased estimator of $\sigma$
- Limit points and interior points
- Is the unit sphere in $\Bbb R^4$ is path connected?
- Convergence of $\prod_{n=1}^\infty(1+a_n)$
- The limit of a convergent Gaussian random variable sequence is still a Gaussian random variable
- Sur- in- bijections and cardinality.
- Transpose matrix dual map
- Continuous composition with one discontinuous function
- Proving $\pi(\frac1A+\frac1B+\frac1C)\ge(\sin\frac A2+\sin\frac B2+\sin\frac C2)(\frac 1{\sin\frac A2}+\frac 1{\sin\frac B2}+\frac 1{\sin\frac C2})$