Number of action per year. Combinatorics question
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}
I'm writing a diploma about vaccines. There is a region, its population and 12 month. There is an array of 12 values from 0 to 1 with step 0.01. It means which part of population should we vaccinate in every month.
For example if we have array = [0.1,0,0,0,0,0,0,0,0,0,0,0]. That means that we should vaccinate 0.1 of region population only in first month.
Another array = [0, 0.23,0,0,0,0,0,0, 0.02,0,0,0]. It means that we should vaccinate 0.23 of region population in second month and 0.02 of region population in 9th month.
So the question is: how to generate (using 3 loops) 12(months) * 12(times of vaccinating) * 100 (number of steps from 0 to 1) = 14_400 number of arrays that will contain every version of these combinations.
For now I have this code:
for(int month = 0;month<12;month++){
for (double step = 0;step<=1;step+=0.01){
double arr = new double[12];
arr[month] = step;
}
}
I need to add 3d loop that will vary number of vaccinating per year.
Have no idea how to write it.
Idk if it is understandable.
Hope u get it otherwise ask me, please.
math combinations
|
show 2 more comments
I'm writing a diploma about vaccines. There is a region, its population and 12 month. There is an array of 12 values from 0 to 1 with step 0.01. It means which part of population should we vaccinate in every month.
For example if we have array = [0.1,0,0,0,0,0,0,0,0,0,0,0]. That means that we should vaccinate 0.1 of region population only in first month.
Another array = [0, 0.23,0,0,0,0,0,0, 0.02,0,0,0]. It means that we should vaccinate 0.23 of region population in second month and 0.02 of region population in 9th month.
So the question is: how to generate (using 3 loops) 12(months) * 12(times of vaccinating) * 100 (number of steps from 0 to 1) = 14_400 number of arrays that will contain every version of these combinations.
For now I have this code:
for(int month = 0;month<12;month++){
for (double step = 0;step<=1;step+=0.01){
double arr = new double[12];
arr[month] = step;
}
}
I need to add 3d loop that will vary number of vaccinating per year.
Have no idea how to write it.
Idk if it is understandable.
Hope u get it otherwise ask me, please.
math combinations
1
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
1
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
I don't understand what are12(times of vaccinating)
.The same asmonths
? In this case perhaps there are 10^24 variants (ifparts of populations
are independent month from month)
– MBo
Nov 16 '18 at 14:18
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21
|
show 2 more comments
I'm writing a diploma about vaccines. There is a region, its population and 12 month. There is an array of 12 values from 0 to 1 with step 0.01. It means which part of population should we vaccinate in every month.
For example if we have array = [0.1,0,0,0,0,0,0,0,0,0,0,0]. That means that we should vaccinate 0.1 of region population only in first month.
Another array = [0, 0.23,0,0,0,0,0,0, 0.02,0,0,0]. It means that we should vaccinate 0.23 of region population in second month and 0.02 of region population in 9th month.
So the question is: how to generate (using 3 loops) 12(months) * 12(times of vaccinating) * 100 (number of steps from 0 to 1) = 14_400 number of arrays that will contain every version of these combinations.
For now I have this code:
for(int month = 0;month<12;month++){
for (double step = 0;step<=1;step+=0.01){
double arr = new double[12];
arr[month] = step;
}
}
I need to add 3d loop that will vary number of vaccinating per year.
Have no idea how to write it.
Idk if it is understandable.
Hope u get it otherwise ask me, please.
math combinations
I'm writing a diploma about vaccines. There is a region, its population and 12 month. There is an array of 12 values from 0 to 1 with step 0.01. It means which part of population should we vaccinate in every month.
For example if we have array = [0.1,0,0,0,0,0,0,0,0,0,0,0]. That means that we should vaccinate 0.1 of region population only in first month.
Another array = [0, 0.23,0,0,0,0,0,0, 0.02,0,0,0]. It means that we should vaccinate 0.23 of region population in second month and 0.02 of region population in 9th month.
So the question is: how to generate (using 3 loops) 12(months) * 12(times of vaccinating) * 100 (number of steps from 0 to 1) = 14_400 number of arrays that will contain every version of these combinations.
For now I have this code:
for(int month = 0;month<12;month++){
for (double step = 0;step<=1;step+=0.01){
double arr = new double[12];
arr[month] = step;
}
}
I need to add 3d loop that will vary number of vaccinating per year.
Have no idea how to write it.
Idk if it is understandable.
Hope u get it otherwise ask me, please.
math combinations
math combinations
edited Nov 16 '18 at 14:14
Nikita
asked Nov 16 '18 at 13:55
NikitaNikita
33
33
1
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
1
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
I don't understand what are12(times of vaccinating)
.The same asmonths
? In this case perhaps there are 10^24 variants (ifparts of populations
are independent month from month)
– MBo
Nov 16 '18 at 14:18
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21
|
show 2 more comments
1
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
1
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
I don't understand what are12(times of vaccinating)
.The same asmonths
? In this case perhaps there are 10^24 variants (ifparts of populations
are independent month from month)
– MBo
Nov 16 '18 at 14:18
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21
1
1
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
1
1
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
I don't understand what are
12(times of vaccinating)
.The same as months
? In this case perhaps there are 10^24 variants (if parts of populations
are independent month from month)– MBo
Nov 16 '18 at 14:18
I don't understand what are
12(times of vaccinating)
.The same as months
? In this case perhaps there are 10^24 variants (if parts of populations
are independent month from month)– MBo
Nov 16 '18 at 14:18
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21
|
show 2 more comments
1 Answer
1
active
oldest
votes
You have 101 variants for the first month 0.00, 0.01..1.00
And 101 variants for the second month - same values.
And 101*101 possible combinations for two months.
Continuing - for all 12 months you have 101^12 variants ~ 10^24
It is not possible to generate and store so many combinations (at least in the current decade)
If step is larger than 0.01, then combination count might be reliable. General formula is P=N^M
where N is number of variants per month, M is number of months
You can traverse all combinations representing all integers in range 0..P-1
in N-ric numeral system. Or make digit counter:
fill array D[12] with zeros
repeat
increment element at the last index by step value
if it reaches the limit, make it zero
and increment element at the next index
until the first element reaches the limit
It is similar to counting 08, 09, here we cannot increment 9, so make 10 and so on
s = 1
m = 3
mx = 3
l = [0]*m
i = 0
while i < m:
print([x/3 for x in l])
i = 0
l[i] += s
while (i < m) and l[i] > mx:
l[i] = 0
i += 1
if i < m:
l[i] += s
Python code prints 64 ((mx/s+1)^m=4^3
) variants like [0.3333, 0.6666, 0.0]
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carryl[i] > mx:
earlier than mx
– MBo
Nov 19 '18 at 13:08
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339244%2fnumber-of-action-per-year-combinatorics-question%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You have 101 variants for the first month 0.00, 0.01..1.00
And 101 variants for the second month - same values.
And 101*101 possible combinations for two months.
Continuing - for all 12 months you have 101^12 variants ~ 10^24
It is not possible to generate and store so many combinations (at least in the current decade)
If step is larger than 0.01, then combination count might be reliable. General formula is P=N^M
where N is number of variants per month, M is number of months
You can traverse all combinations representing all integers in range 0..P-1
in N-ric numeral system. Or make digit counter:
fill array D[12] with zeros
repeat
increment element at the last index by step value
if it reaches the limit, make it zero
and increment element at the next index
until the first element reaches the limit
It is similar to counting 08, 09, here we cannot increment 9, so make 10 and so on
s = 1
m = 3
mx = 3
l = [0]*m
i = 0
while i < m:
print([x/3 for x in l])
i = 0
l[i] += s
while (i < m) and l[i] > mx:
l[i] = 0
i += 1
if i < m:
l[i] += s
Python code prints 64 ((mx/s+1)^m=4^3
) variants like [0.3333, 0.6666, 0.0]
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carryl[i] > mx:
earlier than mx
– MBo
Nov 19 '18 at 13:08
add a comment |
You have 101 variants for the first month 0.00, 0.01..1.00
And 101 variants for the second month - same values.
And 101*101 possible combinations for two months.
Continuing - for all 12 months you have 101^12 variants ~ 10^24
It is not possible to generate and store so many combinations (at least in the current decade)
If step is larger than 0.01, then combination count might be reliable. General formula is P=N^M
where N is number of variants per month, M is number of months
You can traverse all combinations representing all integers in range 0..P-1
in N-ric numeral system. Or make digit counter:
fill array D[12] with zeros
repeat
increment element at the last index by step value
if it reaches the limit, make it zero
and increment element at the next index
until the first element reaches the limit
It is similar to counting 08, 09, here we cannot increment 9, so make 10 and so on
s = 1
m = 3
mx = 3
l = [0]*m
i = 0
while i < m:
print([x/3 for x in l])
i = 0
l[i] += s
while (i < m) and l[i] > mx:
l[i] = 0
i += 1
if i < m:
l[i] += s
Python code prints 64 ((mx/s+1)^m=4^3
) variants like [0.3333, 0.6666, 0.0]
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carryl[i] > mx:
earlier than mx
– MBo
Nov 19 '18 at 13:08
add a comment |
You have 101 variants for the first month 0.00, 0.01..1.00
And 101 variants for the second month - same values.
And 101*101 possible combinations for two months.
Continuing - for all 12 months you have 101^12 variants ~ 10^24
It is not possible to generate and store so many combinations (at least in the current decade)
If step is larger than 0.01, then combination count might be reliable. General formula is P=N^M
where N is number of variants per month, M is number of months
You can traverse all combinations representing all integers in range 0..P-1
in N-ric numeral system. Or make digit counter:
fill array D[12] with zeros
repeat
increment element at the last index by step value
if it reaches the limit, make it zero
and increment element at the next index
until the first element reaches the limit
It is similar to counting 08, 09, here we cannot increment 9, so make 10 and so on
s = 1
m = 3
mx = 3
l = [0]*m
i = 0
while i < m:
print([x/3 for x in l])
i = 0
l[i] += s
while (i < m) and l[i] > mx:
l[i] = 0
i += 1
if i < m:
l[i] += s
Python code prints 64 ((mx/s+1)^m=4^3
) variants like [0.3333, 0.6666, 0.0]
You have 101 variants for the first month 0.00, 0.01..1.00
And 101 variants for the second month - same values.
And 101*101 possible combinations for two months.
Continuing - for all 12 months you have 101^12 variants ~ 10^24
It is not possible to generate and store so many combinations (at least in the current decade)
If step is larger than 0.01, then combination count might be reliable. General formula is P=N^M
where N is number of variants per month, M is number of months
You can traverse all combinations representing all integers in range 0..P-1
in N-ric numeral system. Or make digit counter:
fill array D[12] with zeros
repeat
increment element at the last index by step value
if it reaches the limit, make it zero
and increment element at the next index
until the first element reaches the limit
It is similar to counting 08, 09, here we cannot increment 9, so make 10 and so on
s = 1
m = 3
mx = 3
l = [0]*m
i = 0
while i < m:
print([x/3 for x in l])
i = 0
l[i] += s
while (i < m) and l[i] > mx:
l[i] = 0
i += 1
if i < m:
l[i] += s
Python code prints 64 ((mx/s+1)^m=4^3
) variants like [0.3333, 0.6666, 0.0]
edited Nov 16 '18 at 15:13
answered Nov 16 '18 at 14:28
MBoMBo
50.3k23052
50.3k23052
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carryl[i] > mx:
earlier than mx
– MBo
Nov 19 '18 at 13:08
add a comment |
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carryl[i] > mx:
earlier than mx
– MBo
Nov 19 '18 at 13:08
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
What if I reduce number of possible vaccination up to 3 for example.
– Nikita
Nov 16 '18 at 14:31
General formula N^K
– MBo
Nov 16 '18 at 14:44
General formula N^K
– MBo
Nov 16 '18 at 14:44
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
This works totally fine, but I have a question. If I need to limit number of maximum number of vaccines how should I implement it. I mean, if I have 12x0 array and I want to set max number of elements to 2 so center variant will be [5x0, maxNumber, maxNumber, 5x0] and last array will be [10x0, max, max]
– Nikita
Nov 19 '18 at 12:09
You can just count a number of maxNumber. If limit is reached, perform carry
l[i] > mx:
earlier than mx– MBo
Nov 19 '18 at 13:08
You can just count a number of maxNumber. If limit is reached, perform carry
l[i] > mx:
earlier than mx– MBo
Nov 19 '18 at 13:08
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53339244%2fnumber-of-action-per-year-combinatorics-question%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
It looks like you want us to write some code for you. While many users are willing to produce code for a coder in distress, they usually only help when the poster has already tried to solve the problem on his own. A good way to show this effort is to include the code you've written so far, example input (if there is any), the expected output, and the output you actually get (console output, tracebacks, etc.). The more detail you provide, the more answers you are likely to receive. Check the FAQ and How to Ask.
– Rory Daulton
Nov 16 '18 at 14:08
1
Also, your question is not clear. Is it possible to vaccinate part of the population more than once? In other words, does the sum of the values in the array need to be at most one? Are there any other restrictions on your "combinations"? In just about any meaning of your question that I can see, your formula for the "number of arrays" is wrong. Consider that the number of months must equal the number of "times of vaccinating". Please justify the use of those three loops and of that formula.
– Rory Daulton
Nov 16 '18 at 14:12
I don't understand what are
12(times of vaccinating)
.The same asmonths
? In this case perhaps there are 10^24 variants (ifparts of populations
are independent month from month)– MBo
Nov 16 '18 at 14:18
@RoryDaulton I edited my question. 1. It is possible to vaccinate population from 1 up to 12 times. If we go with 12 times, it means 1 time per month. 2. No other restriction. 3. Min number of vaccination = 1 - 1 time in any of 12 month with step variation from 0 to 1 (0.01 step) => 100 vaccination options for 1 month => varying certain month for vaccination we get 1200 options for vaccination 1 times per year in any month.
– Nikita
Nov 16 '18 at 14:20
@MBo I have 12 months. So I can vaccinate population min - 1 times (in any of 12 month) up to 12 times (every month).
– Nikita
Nov 16 '18 at 14:21