Discussion about math, puzzles, games and fun. Useful symbols: ÷ × ½ √ ∞ ≠ ≤ ≥ ≈ ⇒ ± ∈ Δ θ ∴ ∑ ∫ π -¹ ² ³ °

You are not logged in.

- Topics: Active | Unanswered

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

Its been awhile since I've been here, but I have another calculation I need help with an I'm not sure how to set-up the Combinations Calculator, if that's the way, to calculate the following

If I have 20 slots

How many different combinations of 1, 2 & 3 are there without exceeding the sum total of 40?

i.e., Twenty (20) 2s can be one combination, or another one is ten (10) 3s and ten (10) 1s (The total for both is 40)

Make sense?

Thanks for any guidance

-- Mitch

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

Bump

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

Hey Mitch,

are the two sets: ten 3s and ten 1s and ten 1s and ten 3s distinct?

i.e, does order matter?

Thanks.

EDIT: disregard striked through text, writing up solution

*Last edited by Mathegocart (2021-02-25 01:50:28)*

The integral of hope is reality.

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

Waiting with baited breath

BTW - I'm a math midget, so be gentle

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Denominator****Member**- Registered: 2009-11-23
- Posts: 198

Hello, here are my thoughts:

Sounds like you are only looking at possible amounts of 1s, 2s and 3s (as opposed to a specific order of slots).

^ expanding that what I mean is that it appears you aren't differentiating between [ten 1s first then ten 3s], and [ten 3s first then ten 1s].

Looking only at a sum total of 40, here's one way to find the number of possible collections:

Start off with twenty slots of 2 (sum is 40). Then convert two 2s into one 1 and one 3 (so as to conserve the sum, as 2+2 = 1+3). This is another possible collection of numbers. You can repeat this process nine more times. Therefore there are 11 slot collections that sum to 40.

Let (x, y, z) be the numbers of 1s, 2s and 3s respectively. Then the collections are {(0,20,0), (1,18,1), ... (10,0,10)}, which give 11 possible ways to sum to 40.

Your question asks about combinations that don't exceed 40, so this is not the full answer. But hopefully this has given you a start or possibly new ideas on how to answer your question

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

UCanCallMeMitch wrote:

Waiting with baited breath

BTW - I'm a math midget, so be gentle

Hello, sorry for the delay - some life impediments proved to be quite tiresome and delayed me for a day. Nonetheless, here is what (I believe) to be a solution.

So I decided to tackle your intriguing problem by abstracting it to a system of equations (albeit underdetermined[i.e, there are less equations than variables]).

**The System**

x + 2y + 3z = n (where n is a positive integer)

x + y + z = 20(i.e, 20 slots for 1, 2, and 3)

__________________________________________________

Now, for obvious reasons, n can only range from 20 to 40 - and Denominator has solved the case for n=40, so really we can just try n=20 to n=39.

The most trivial case is obviously n=20 - there's only one set of slots that sums up to 20, and that's 20 1s. So there's one way to do that.

CASES

__________________________________________________

N = 21

Solving the system where n=21, we have that y=39-2x and z=x-19. Now from relatively obvious arithmetic reasoning(no negative amount of numbers), the only value that x can be 19. So that leaves us with z=0 and y=39-38=1. z=0, y=1, x=19. So 19 1s and 1 2s.

N=22

Solving the system where n=22, we have that y=38-2x and z=x-18. So x is constrained to {18, 19} for reasons above. So we have two solutions.

N=23

For the system n=23 we have that y=37-2x and z=x-17. x is constrained to {17,18}. Hence, two solutions.

N=24

For the system n=24, we have that y=36-2x and z=x-16. x is constrained to {16,17,18}. Hence, three solutions.

N=25

y=35-2x, z=x-15. x is constrained to {15,16,17}. Hence, three solutions.

N=26

y=34-2x, z=x-14. x is constrained to {14,15,16,17}. Hence, four solutions.

N=27

y=33-2x, z=x-13. x is constrained to {13,14,15,16}. Hence, four solutions.

N=28

y=32-2x, z=x-12. x is constrained to {12,13,14,15,16}. Hence, five solutions.

N=29

y=31-2x, z=x-11. x is constrained to {11,12,13,14,15}. Hence, five solutions.

N=30

y=30-2x, z=x-10. x is constrained to {10,11,12,13,14,15}. Hence, six solutions.

N=31

y=29-2x, z=x-9. x is constrained to {9,10,11,12,13,14}. Hence, six solutions.

N=32

y=28-2x, z=x-8. x is constrained to {8,9,10,11,12,13,14}. Hence, seven solutions.

N=33.

y=27-2x, z=x-7. x is constrained to {7,8,9,10,11,12,13}. 7 sols.

N=34, N=35, N=36, N=37, N=38, N=39

The pattern is relatively obvious so I'll just type up the number of solutions for each n.

[EDIT]: MISCOUNTED. ANSWER SHOULD BE 110 + 11 = 121

Respectively, they are: 8, 8, 9, 9, 10, 10. So adding them all up together.. we get 121 ways to fill 20 slots with 1s, 2s, and 3s that total no more than 40.

There is probably a more efficient way to determine the number of solutions, as my mathematical skills are a little rusty from years of inactivity, but 120 does seem to be the number you want.

*Last edited by Mathegocart (Today 01:42:57)*

The integral of hope is reality.

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

Thanks guys.

I was putz'n around with doing it manually and came up with 11 different combinations as Denominator said (no repeats)

Question For Mathegocart - is your formula allowing repeats?

Here's The Spreadsheet I Came Up With

Let me know if I'm completely off-base

*Last edited by UCanCallMeMitch (2021-02-26 13:13:34)*

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

UCanCallMeMitch wrote:

Thanks guys.

I was putz'n around with doing it manually and came up with 11 different combinations as Denominator said (no repeats)

Question For Mathegocart - is your formula allowing repeats?

Here's The Spreadsheet I Came Up With

Let me know if I'm completely off-base

Repeats? Could you clarify?

The integral of hope is reality.

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

Sorry for the confusion

Each Combination does not have repetition and order doesn't matter, i.e.

2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1 is the same as

3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 or

2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, etc.

*Last edited by UCanCallMeMitch (2021-02-27 02:13:03)*

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

UCanCallMeMitch wrote:

Sorry for the confusion

Each Combination does not have repetition and order doesn't matter, i.e.

2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 1 is the same as

3, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2 or

2, 2, 2, 2, 2, 2, 1, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, etc.

Yeah - my method counts all of those as the same. You want each of them to count as individual permutations?

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

No, order doesn't matter.

Just wanted to know how many different combinations of 1, 2 and 3 made up the 20 slots and the total sum of them equaled 40.

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

UCanCallMeMitch wrote:

No, order doesn't matter.

Just wanted to know how many different combinations of 1, 2 and 3 made up the 20 slots and the total sum of them equaled 40.

Those are the different combos. Order does not matter.

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**UCanCallMeMitch****Member**- Registered: 2020-02-28
- Posts: 31

As I said, I'm really a dunce with math - especially algebra, so I'm not completely understanding what you are calculating.

Are you calculating all the combinations that DON'T EXCEED 40?

Maybe a couple of examples would clear the fog for me ????

Thanks

"The more you explain it, the more I don't understand it."

-- Mark Twain

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

UCanCallMeMitch wrote:

As I said, I'm really a dunce with math - especially algebra, so I'm not completely understanding what you are calculating.

Are you calculating all the combinations that DON'T EXCEED 40?

Maybe a couple of examples would clear the fog for me ????

Thanks

The aforementioned linear system is how I determined the number of cases that total to an integer that did not total more than 40, yes.

The System

x = number of 1s

y = number of 2s

z = number of 3s

x + 2y + 3z = n (where n is a positive integer)

x + y + z = 20(i.e, 20 slots for 1, 2, and 3)

So for your first q, yes.

So to determine the number of combinations of 1s, 2s, and 3s that sum to 40, all we have to do is to replace n with 40(since the combo must sum to 40).

Solving for y and z in terms of x, we get that y=20-2x and that z=x.

I start finding said combos by manipulating the value of x - that is, the variable that represents the number of 1s in the combo. So it can range from 0(i.e, no 1s) to 10(not any higher as we would get a negative number for y - which represents 2.)

So there are 11 combos that sum to 40 that consist of 1s, 2s, and 3s.

Adding that to the 120 figure I reached earlier(forgot to add the number of combos for 40), we get 131.

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline

**Bob****Administrator**- Registered: 2010-06-20
- Posts: 8,950

hi Mitch and Mathegocart

I've been avoiding this question because I'm not very good with them. But I've finally plucked up the courage to have a go. I reasoned like this:

If n is the number of 1s, m the number of 2s and p the number of 3s then we have

n + 2m + 3p ≤ 40 and

n + m +p = 20

Subtracting

m + 2p ≤ 20

So I constructed a spreadsheet with columns for p values and rows for m values and the formula m + 2p. Anything out of range I deleted.

I found 121 valid entries (including m=p=0) such as

m = 5, p = 9 giving 2m + 3p = 37. n can then be 0 1 2 or 3.

and

m = 3, p = 11 giving 2m + 3p = 39, n can be 0 or 1.

As there are 121 possible values of m and p, and then lots of n possibilities, that would seem to be quite a big number altogether.

Please let me know of there's a flaw in my logic. If not then I'll see if I can devise a simple way a finding out how many in total.

Bob

Children are not defined by school ...........The Fonz

You cannot teach a man anything; you can only help him find it within himself..........Galileo Galilei

Sometimes I deliberately make mistakes, just to test you! …………….Bob

Offline

**Mathegocart****Member**- Registered: 2012-04-29
- Posts: 2,085

Bob wrote:

hi Mitch and Mathegocart

I've been avoiding this question because I'm not very good with them. But I've finally plucked up the courage to have a go. I reasoned like this:

If n is the number of 1s, m the number of 2s and p the number of 3s then we have

n + 2m + 3p ≤ 40 and

n + m +p = 20Subtracting

m + 2p ≤ 20

So I constructed a spreadsheet with columns for p values and rows for m values and the formula m + 2p. Anything out of range I deleted.

I found 121 valid entries (including m=p=0) such as

m = 5, p = 9 giving 2m + 3p = 37. n can then be 0 1 2 or 3.

and

m = 3, p = 11 giving 2m + 3p = 39, n can be 0 or 1.

As there are 121 possible values of m and p, and then lots of n possibilities, that would seem to be quite a big number altogether.

Please let me know of there's a flaw in my logic. If not then I'll see if I can devise a simple way a finding out how many in total.

Bob

Looks like you're right on this. Miscounted and accidentally added 10 to my answer. Woops!

May bobbym have a wonderful time in the pearly gates of heaven.

He will be sorely missed.

Offline