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









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.