A maths question

Dragon

Well-Known Member
If I've got 8 students and 3 rooms and I've got to fit all students in all 3 rooms but no room must be empty ( so e.g. 6,1,1 or 4,2,2) how many possibilities are there to fill the rooms. (Note: 6,1,2 = 6,2,1)

And the same thing with 6 students and 4 rooms, but this time 3,1,2 != 1,2,3


Can you tell me how to calculate that?
 

Dragon

Well-Known Member
I'm sorry, I forgot to add something very important: The students are numbered, so it is a difference if students 1,2,3,4 are on one room or students 1,2,3,5. But in the first task the rooms they are in are of no matter (so it is the same if students 1-6 are in room 1,2 or 3) while in the second task it matters in which room the students are.
 

Kasatka

Active Member
So i did, i was eating a sammich. As for numbered students, you'd then likely need to get some spreadsheets running :P
 

Zooggy

Junior Administrator
Staff member
Hoy, :)

For the first one, I think the easiest way is to figure out the basic configurations, like Kat did, of which there are 5. But then, you have to figure out that the various rooms are themselves different, even if the students aren't. So, you get 3 x (6-1-1), 6 x (5-2-1), 6 x (4-3-1), 3 x (4-2-2) and 3 x (3-3-2), for a total of 3+6+6+3+3=21 different combinations.

The second one is trickier. I think you can start by figuring out 4^6=4096 different total combinations, then subtracting the ones where one, two or three rooms are empty: 1 room empty = 4 x 3^6=2916; 2 rooms empty = 6 x 2^6=384; 3 rooms empty=4 x 1^6=4; for a total of 4096-2916-384-4=792 different combinations.

I can go through each step in more detail, if you need me to.

Cheers,
J.
 

Dragon

Well-Known Member
My Maths Prof said it has got something to do with this interesting stuff. Using the formula I got to a number of 966 different probabilities ... sounds pretty wrong to me and yet she said there have to be more than 21 probabilities.
 

Zooggy

Junior Administrator
Staff member
Hey, :)

I can list all 21 out for you, if you want. :)

If the different students actually do matter, as opposed to what you said, then you get 3^8 - 3 x 2^8 - 3 x 1^8 = 6561 - 768 - 3 = 5790 combinations.

I don't see any way of getting to a number like 966... :|

Cheers,
J.
 

Zooggy

Junior Administrator
Staff member
Hoy, :)

Hmmm... My maths are off somewhere... In brute-force double-checking, I come to 5796 combinations, instead of 5790...

I trust my second result a bit more, so, can anyone double-check my previously posted math and see where I'm losing 6...?

Cheers,
J.
 

Zooggy

Junior Administrator
Staff member
Hoy, :)

That would be 6561 - (768 - 3), which is not what I meant. :)

However, I see now that I probably subtracted too many cases from the one-room-empty parcel. I shall review accordingly...

Thanks for the tip, it was in the right direction. :)

Cheers,
J.
 

Zooggy

Junior Administrator
Staff member
Hoy, :)

I would like that, yes. I need to try and figure out where I went wrong...

Cheers,
J.
 
G

Gombol

Guest
Hoy, :)

That would be 6561 - (768 - 3), which is not what I meant. :)

However, I see now that I probably subtracted too many cases from the one-room-empty parcel. I shall review accordingly...

Thanks for the tip, it was in the right direction. :)

Cheers,
J.

Cookie.

Cookies are the answer to everything. Silly Zoogy.
 

Zooggy

Junior Administrator
Staff member
Hoy, :)

Problem 2:

As promised, the correct answer to problem 2, derived by two different methods, is 1560.

Method 1:

There are two possible configurations, previously listed by Kat, namely 3.1.1.1 and 2.2.1.1. There are 4 different anonymous student distributions for configuration 1, and 6 for configuration 2. So, you get, 4 x 6!/3! = 480 for config 1, and 6 x 6!/(2! x 2!) = 1080 for config 2. 480 + 1080 = 1560.

(If the rooms don't matter, you drop that 4 and that 6, and you get 120 + 180 = 300. If the rooms do matter but the students don't, you simply get 4 + 6 = 10. If neither of them matters, then you get Kat's answer of 2.)

Method 2:

There are a total of 4^6 = 4096 distributions of 6 students across 4 rooms, of which, some have some rooms empty.

For 3 rooms empty, all the students are in one room, which can be any one of the 4 rooms. Thus, 4 x 1^6 = 4.

For 2 rooms empty, there are 6 combinations of which rooms are empty. For each combination, you get a total of 2^6 distributions, but you have to subtract the 2 cases in which one of the two rooms is also empty. Thus, 6 x (2^6 - 2= = 372.

For 1 room empty, bear with me, this is tricky. There are 4 different rooms which could be empty. For the remaining 3 rooms, you are left with 3^6 distributions but you have to subtract the cases where one or two of those rooms are also empty. The reasoning is the same as in the paragraph above, only for 3 rooms. You get 3 x (2^6 - 2) cases for one room empty, and 3 cases for two rooms empty. Thus, 4 x (3^6 - 3 x (2^6 - 2) - 3) = 4 x (729 - 186 - 3) = 2160.

The answer is thus 4096 - 2160 - 372 - 4 = 1560.

--//--

Problem 1:

A similar correction to the maths for the variation on problem 1 now yields the correct result of 5796. It occurs to me, though, that, even though these maths are correct, they don't actually answer the problem...! :eek: I had assumed that it was the students which didn't matter, not the rooms... :rolleyes:

Anyway, applying the same factorials-based combinatorial calculus in method 1 above, I get 28 different distributions for 6.1.1, 168 for 5.2.1, 280 for 4.3.1, 420 for 4.2.2 and 560 for 3.3.2, for a grand total of 1484.

(You get 5796 if both the students and the rooms matter, 21 if the rooms matter and the students don't, and 5 if neither of them matters.)

I still don't know where the 966 comes from, I'm afraid...

Cheers,
J.
 

Dragon

Well-Known Member
60f7b40ae0086e2979e12743948f9237.png


use this formula, with n = number of students and k = number of rooms and you'll get the correct answer.

Btw its called a Stirling Number of the second kind.

And yes, 1560 on the second task is correct, came in too late though ^^
 
Top