, , ( ), , . .
, , , . , . , , .
:
, , , .
, (, 40% , 60% ) (, 100, 40 , 60 ). .
, , (. , ). :
- Randomly select a row.
- Mark the row examined.
- For each column constraint:
* Get the value for the relevant column from the row
* Test for selectability:
If there a value target for the value,
and if we haven't already selected our target number of incidences of this value,
then the row is selectable with respect to this column
* Else: the row fails.
- If the row didn't fail, select it: add it to the subset
. , , ..., , ,
.
:
, . , ( 100), , , , .
, : , , . , ( : 100, : 40%, 10%) , , , .
( : 100, : 40%, 40%), , , , . ( : 100, : 20%, 40%), , ( ).
. , .
( ) . : , , , , .
OP, : , . : " ".
: , , - , , . , , .
, , . , .
Pre-:
, , , , , , , .
, , (.. 100 ) , . , , (, 40 60 ), .
, , - . , , .
, . , . : , , : ( ) .
However, for the OP question, this is possible. As I explain, we can randomly select strings and test them individually, because each has one weight.