resampling to avoid limit - nchoosek
4 views (last 30 days)
I am investigating the combination of vehicles and houses.
My equation for this is:
Where VID1 is a cell containing all the possible combinations of vechicles for one house and size(Hcombos2,2) is the number of households.
My problem is that I have 429 vehicles and 36 households. I need to limit the number of combinations I generate: when I combine 429 vehicles with 36 houses, I should get out 1000 (arbitrary) of those combinations. .
Steven Lord on 14 Apr 2021
Assuming VID1 has 429 elements and Hcombos has 36 rows, that means you're trying to generate one of this many combinations:
N = nchoosek(429, 36)
If you were planning to operate on each combination in turn, how fast can you perform those operations? Let's assume you could process a million combinations a second. How long would it take?
To think about that period of time you need to look at the timeline of the far future.
Let's talk about the bigger picture for a second. What exactly do these combinations represent? Do you just want a logical matrix of size [numel(VID1),size(Hcombos,2)] with restrictions on how many true values can be in each row and/or each column, to map households and vehicles? Do you want random permutation matrices?