Suppose there are two kinds of balls (i.e. Good ball and Bad ball) in a bag. Now I take out all the balls one by one and put them in a line. We denote Good ball as 1 and Bad ball as 0. If there are total n balls, then the line can be represented as a vector
of size n, where ai is denoted as follows,

Now I want to define a evaluation method M to measure
. My idea is that the earlier we select out Good balls, the higher value of M. Thus
should get the highest M.
Up to now, we want to define M to meet following conditions,
- Different
has different M - The earlier good balls are found, the higher value of M should be.








Does the number of found good balls affect the value of M ... or just the positions of them ?
For example is "1000" better or "0111" ?
Thanks for your reply!
In my situation, the number of good balls is a constant m (m < n).
So the position is only factor to influence M.
And what is the range of n ?
I may mislead you.
Here, the total number of balls (i.e. n) and the good balls (i.e. m) are given. So n can be any integer greater than 0.
Well,
In case n is small, u can take M as the decimal or the hexadecimal representation of the 01 string.