I have 132 potential positions in a wind farm layout and I have to place 66 turbines on these positions. I want to know how to make combinations to place these 66 turbines.

3 views (last 30 days)
My wind farm dimension is 11220X1360 and it is divided into grids with dimensions 340X340. There are 132 potential positions for 66 turbines in them. How to determine the ways in which they can be placed on 132 positions?
Walter Roberson
Walter Roberson on 28 Jul 2021
Edited: Walter Roberson on 28 Jul 2021
David answered the question you asked. If you need more precision then
n = sym(66);
numpositions = simplify(exp(gammaln(2*n)-2*gammaln(n)))
numpositions = 
ans = 1.2454e+40
crosscheck = factorial(sym(132))/factorial(sym(66))^2
crosscheck = 
The crosscheck is dpb's value, and I have to say it looks reasonable to me. Hmmm... seems to me that David's formula should probably be
n = sym(66);
numpositions = simplify(exp(gammaln(2*n+1)-2*gammaln(n+1)))
numpositions = 
Ah, that's better.
Anyhow... if knowing the number of ways you can position them is not what you need, you should expand on your question.
In a duplicate question it looked like you might be asking for code to produce all of the possible solutions. Although I could produce code for that purpose, as David showed, the code would take on the order of 10^20 years to finish. As in roughly 100000000000000000000 years.
David Goodmanson
David Goodmanson on 29 Jul 2021
Walter is correct, I forgot to add 1 when converting the gamma function to a factorial. A couple of previous comments are modified accordingly.

Sign in to comment.

Answers (1)

Jan on 17 Jul 2021
Edited: Jan on 17 Jul 2021
The notes of dpb and David mean, that the number of possible solutions is too large to be useful, if you want to test all of them. In your case testing all 132 over 66 solutions would take many years.
So you have to concentrate on a small subset. There are different ways to find "good" solutions in a huge set, e.g. randomly:
pos = randperm(1:132, 66);
Other methods of global optimizations allows to improve solutions iteratively from different starting points. This does not require to check all possible solutions, but to find a sufficiently good solution in a bearable amount of time.
David Goodmanson
David Goodmanson on 18 Jul 2021
Edited: David Goodmanson on 29 Jul 2021
Assuming 3.8e38 cases [this number has been corrected per Walter's comment], if one could do a case every picosecond it would take about 1.2e19 years, not counting meal breaks (the age of the universe is about 1.4e10 years). "Many years", indeed!
Walter Roberson
Walter Roberson on 18 Jul 2021
"I bet I could get there in one day, if I didn't sleep!"
(Will anyone else know what this refers to? Will I still know what this refers to a year from now?)

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!