Mean value among enumeration of non numeric types

64 Views Asked by At

I would like to ask if we have an enumeration of non numeric types, for example an enumeration of Strings and a certain frequency of appearance exists for each String, for example:In an experiment String0 appears n0 times, String1 n1 times etc.

Is it then possible to define the mean value among these Strings?

More strictly, there is an enumeration of k + 1 strings. We have a random integer generator for integers [0 ... k]. We produce k + 1 random integers. Let's say the mean value of the experiment is k1 = 3.5. Each one of the k + 1 integers of the experiment is assigned to one of those strings of the enumeration. 0 is assigned to String0, 1 is assigned to String1 .. k is assigned to Stringk. (There is a bijection among those k + 1 integers and the k + 1 strings of the enumeration). The k1 = 3.5 for example mean value of the experiment to which string of the enumeration corresponds? Thanks in advance.

1

There are 1 best solutions below

3
On

You can certainly define the mean number of appearances of a string. It is just the total number of strings divided by the number of different strings. If you want to take the mean of two or more strings you can convert them to integers by viewing them as base $k$ numbers where $k$ is the number of different characters. If your alphabet is lower case you could view $a$ as $1$, $z$ as $26$ and the mean as halfway between $m$ and $n$. Is that useful?