Suppose I have Q
vectors as follows:
A_1 = [x_1,x_2,...,x_m];
A_2 = [y_1,y_2,...,y_n];
.
.
.
A_Q = [z_1,z_2,...,z_q];
Basically, m,n,q
are positive integers and not necessarily equivalent. Each vector element x,y,z
is a number between (0,1).
One possible combination of these vectors can be:
B_1 = [x_1,y_1,...,z_1];
In each combination, exactly one element of each vector should be included. Therefore, we can have m*n*...*q
different combinations. Now, I want to find those combinations such that mean of their elements equals to a specific number W
, i.e, mean(B_1)=W.
Note that W
is a number between (0,1).
An inefficient way is to compute all permutations and then compare W
with the mean of their elements. However, as Q,m,n,q
increase, the computer (MATLAB) can't handle it, which is obvious.
Would you please help me find an efficient approach to solve this problem in a reasonable time?
One can say that there may not be a vector, where the mean of its elements equals to W.
Yes, that's true. Then, is it possible to find combinations such that the mean of their elements is between (W-T,W+T),
where T
is between (0,1)
?
Many thanks in advance.