Answer the question
In order to leave comments, you need to log in
Break up a group of 100 people into 5 so everyone gets to know each other?
Good afternoon everyone.
Actually, I'm trying to write an algorithm to break n people into groups of 5 people, so that all n get to know each other... The first circle of fives where no one knows who did, but then how to break?
Answer the question
In order to leave comments, you need to log in
Just for such situations, education is needed)))) https://ru.wikipedia.org/wiki/Combinatorics
As a
basis, take https://ru.wikipedia.org/wiki/Combination
-
And in the statement, a condition like "for fewer iterations", no?
Use the power of prime numbers as an increment of the members' numbers in the group.
5: (1,6,11,16,21), (2,7,12,17,22),..
7: (1,8,15,22,29), (2,9,..) ,..
11: (1,12,23,34,45), (2,13,..), ..
13: ...
17: ...
(plus numbering loop: 101=1, 102=2 ,..)
I won't give proof yet, just "mathematical intuition".
Lower bound: in less than 25 partitions, there is no solution, because each has to get to know 99 people, and in one split a person gets to know a maximum of 4 people, ceil(99/4)=25.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question