This question is mostly related to my post on codegolf you may consider reading it, but I'll still try to explain it as best as I can here.
The problem states that you have to generate a $25$ letter string using the emojis "" and write a piece of code that converts said string into numbers from $0$ to $9$ without losing their pattern. eg.
Input:
Output: 000112324
and your code is valued on the basis of the sum of all the digits in the output, so making sure the emoji that is repeated the most gets the value $0$ then the next most repeated gets $1$ is the strategy to the perfect code.
your score will be the average result value obtained from the $10,000$ runs and multiply by the size of the code in bytes.
The goal is to create a program that, on average, produces strings with the lowest possible value based on the emoji-to-number mapping chosen for each run (a run is considered converting 25 emojis to a string hence there will be $10,000$ unique runs considered in your score)
In one of the answers the user mentioned that
If anyone has a lot of time and compute power, it would be interesting to see how low you could get it by brute forcing the best random seed.
so technically you could write code that completely ignores the "figuring out most repeated emoji" part and just assign whatever comes first the digit $0$ and so on. In a perfect seed where all the emojis are correctly ordered in a way that the most repeated ones occur before the ones that are repeated less would go on to take the win.
I was trying to figure out this exact probability of how many runs it would take to get to a seed where in all the $10,000$ runs all of the emojis are in the order. One example of such a string is:
- where the unique appearance of emojis is
- and their amount of repetition is
- $5$
- $5$
- $4$
- $\space4$
- $3$
- $1$
- $1$
- $1$
- $1$
which are both in the same order so the "bad and smaller code" would perform just as well as the good one.
With my high school knowledge of PnC and Probability, I tried to figure out the mathematical solution, but Spoiler alert:
I couldn't
So I did the next best thing and ran a piece of code $1,000,000$ times and calculated that there were exactly $4155$ strings in which the list of the appearance of the emojis and the "appearance list" sorted by their no. of occurrence was the same. So the probability of getting one such string would be $$\frac{4155}{1000000}$$ and probability of a perfect seed where we get a perfect string $10000$ times in a row would be: $$\left(\frac{4155}{1000000}\right)^{10000}$$
am I getting this right? and how can one go about doing this mathematically if its possible. The code if anyone is interested