# Maximum number of teams of three people such that each team is built in one of two ways

A coach picks team members in two ways:

A. The team of three people should consist of one experienced participant and two newbies. Thus, each experienced participant can share the experience with a large number of people.

B. The team should have two experienced members plus one newbie. Thus, each newbie can gain more knowledge and experience.

All the teams during the training session should belong to one of the two ways described above. Furthermore, they agree that the total number of teams should be as much as possible.

There are $E$ experienced members and $N$ newbies on the training session. Can you calculate what maximum number of teams can be formed?

I have solved this problem in a purely mathematical way! Let the number of teams of type A be $x$ and type B be $y$. Now

\begin{align*} 2\cdot x+y&=E\\ 2\cdot y+x&=N \end{align*}

Now adding these equations, I get

\begin{align*} 3\cdot (x+y)&=N+E\\ (x+y)&=(N+E)/3 \end{align*}

For the maximum number of integral teams, I should take floor of $(N+E)/3$ as it is equal to $x+y$ (the number of teams).

We also have to check another condition, i.e., $x+y= (N+E)/3$. Now we have to back substitute in starting equations and constrain $x$ and $y$ to be greater than zero!

This would yield us the condition where this will be true; otherwise one type of teams will be zero and that case is trivial.

Now, I want to know is there a better solution than all of this maths?

• When you add the 2 equations, it gives: $3 \cdot (x+y)=N+E$ not $N$ only. – K. Rmth Jul 13 '15 at 17:47
• Edited! @K.Rmth – Shubham Sharma Jul 13 '15 at 17:52

It seems to me that the number of teams you can form would be $\min\left\{N,E,\left\lfloor\frac{N+E}{3}\right\rfloor\right\}$.
• It's quite obvious one can't make more teams than $\lfloor \frac{N+E}{3} \rfloor$. If one manages to make more than N teams from a roster containing N newbies, there will be at least a teams containing no newbies, which is supposed impossible. The same reasoning works for E experienced players. Hence, the number of teams one can form is $\leq \min\left\{N,E,\left\lfloor\frac{N+E}{3}\right\rfloor\right\}$. Since paw88789's solution manages to create that many teams, it is optimal. – GBQT Aug 15 '15 at 20:10