Clash of Clans. What's the total time to train?

120 Views Asked by At

all about clash of clans game.

I have total of 6 barracks. Two of them produces one barbarian each every 20 seconds, the another two barracks produces one archer each every 25 seconds, and the last two produces 1 minion each every 45 seconds. the capacity of army camp is 200.

all barracks train simultaneously.

one archer has an housing space of one.

one barbarian has an housing space of one.

one minion has an housing space of two.

so how much time will it take to full the 200 camp capacity?

http://snag.gy/7c22a.jpg I get this number of units at every full capacity.

2

There are 2 best solutions below

3
On

Don't focus on the amount of each type of class in the army camp. Look instead at the time.

If it takes $20$ seconds to make 2 housing spaces, then it will take $20*100 = 2000$ seconds to fill it completely.

If it takes $25$ seconds to make 2 housing spaces, then it will take $25*100 = 2500$ seconds to fill it completely.

If it takes $45$ seconds to make 4 housing spaces, then it will take $45*50 = 2250$ seconds to fill it completely.

Now, think of these three events as three different people. They each have a separate time to complete one army camp.

Now, if they all work together, how long would it take? (which is essentially your question):

$$\frac{1}{2000} + \frac{1}{2500} + \frac{1}{2250} = \frac{1}{t}$$

We get that $t = 744$ seconds, or about $12.4$ minutes

0
On

To get a lower bound on the answer, let's oversimplify the problem at first. (We can later correct the error that this introduces.) Assume the first two barracks produce a continuous "flow" of barbarian-stuff at the rate of $2$ barbarian-units every $20$ seconds, which is to say, $\frac{1}{10}$ barbarian-unit per second. Since one barbarian-unit fills one housing-unit, the rate at which the first two barracks fill the camp is $\frac{1}{10}$ housing-unit per second. Similarly, the next two barracks produce archer-stuff at a rate of $\frac{2}{25}$ archer-units per second, filling $\frac{2}{25}$ housing-units per second. The last two barracks produce minion-stuff at the rate of $\frac{2}{25}$ minion-units per second, filling $\frac{4}{45}$ housing-units per second.

The total flow of "stuff" into the camp is the sum of all three flows,

$$ \frac{1}{10} + \frac{2}{25} + \frac{4}{45} = \frac{45}{450} + \frac{36}{450} + \frac{40}{450} = \frac{121}{450} $$

measured in housing-units per second. The number of seconds this would take to fill $200$ housing units is

$$ \frac{200}{\left(\frac{121}{450}\right)} = 200 \times \frac{450}{121} \approx 743.8. $$

Clearly this is an oversimplification and has produced an error. The camp cannot fill at some time like this; since barbarians, archers, and minions are produced only at times that are multiples of $5$, the camp must fill at a time that is a multiple of $5$.

In fact, in the first $743.8$ seconds the first two barracks will have produced barbarians $37$ times (because $37 \times 20 = 740$), the next two will have produced archers $29$ times (because $29 \times 25 = 725$) and the last two will have produced minions $16$ times (because $16 \times 45 = 720$). Taking into account the number of housing units occupied by each barbarian/archer/minion produced, the number of housing units that the barracks will have filled in this time is

$$ 37 \times 2 + 29 \times 2 + 16 \times 4 = 74 + 58 + 64 = 196. $$

So we just need to fill four more housing units. The next barbarians will be produced at $760$ seconds, the next archers at $750$ seconds, and the next minions at $765$ seconds.

So the next event is at $750$ seconds; we get two archers, raising the number of occupied housing units to $198$, and the next archers are due at $775$ seconds. The next event after this is at $760$ seconds; we get two barbarians, and the number of occupied housing units is now $200$, broken down as follows:

\begin{array}{lll} 76 \text{ barbarians} & \times 1 \text{ unit/barbarian} & = 76 \text{ units}\\ 60 \text{ archers} & \times 1 \text{ unit/archer} & = 60 \text{ units}\\ 32 \text{ minions} & \times 2 \text{ unit/minion} & = 64 \text{ units}\\ \end{array}

and the process completes in $760$ seconds.

The numbers in your linked image ($76, 56, 34$) would take (respectively) $760$ seconds, $700$ seconds, and $765$ seconds to be produced at the rates stated in your question; what happened to the archers that should have been produced at $725$ seconds and $750$ seconds after the start? Do the barracks start production at different times? Or do they each produce their first batch of barbarians/archers/minions instantly?

If the answer is that the first batch is produced instantly, then at the very start we already have two barbarians, two archers, and two minions, occupying $8$ housing units. We therefore need to fill just $192$ more units; in the oversimplified model, the number of seconds this would take is

$$ \frac{192}{\left(\frac{121}{450}\right)} = 192 \times \frac{450}{121} \approx 714.05. $$

At this time we would have $72$ barbarians (the two we started with, plus $70$ more produced in the first $700$ seconds), with the next ones due at $720$ seconds, $58$ archers, with the next ones due at $725$ seconds, and $32$ minions, with the next ones due at $720$ seconds. So far, the number of housing units occupied is

$$ 72 + 58 + 32 \times 2 = 194. $$

The next event is at $720$ seconds: we get two barbarians and two minions, occupying a total of $6$ housing units, so now the units occupied are $$ 74 + 58 + 34 \times 2 = 200, $$ which (almost) agrees with the numbers in your image, but now we have more archers and fewer barbarians. So I suspect that after all there is some other discrepancy in "starting times" among the six barracks.