Take the 2-minute tour ×

Can someone please help me wrap my head around this problem

Given X number of servers that generate some message and a simulation duration of T seconds, at what time intervals should each server generate a message, so that on an average, there are 200 messages/sec generated.

Using a PRNG, i generated a uniform distribution of time intervals for each X server over T seconds, but how do i ensure that these intervals would result in 200 messages per second?

Thank you,

share|improve this question

1 Answer 1

up vote 1 down vote accepted

How is T important? Each server should generate 200/X messages per second, uniformly. To generate a schedule, draw 200/X samples from a uniform distribution on [0, 1) and time the messages accordingly (and repeat every second, or draw 200T/X samples from [0,T) right away).

share|improve this answer
Let me clarify that the problem does not require exact 200 messages/sec. Instead on an average over T seconds, there should be 200 messages/sec. So, it is possible that during second 1, there were ONLY 100 messages, second 2 -300 messages, second 3 - 50 messages and so on. Infact generating exact 200 messages per second by X servers is an easier task than the question –  Jimm Jun 16 '11 at 16:14
@Jimm: Take the parenthetical suggestion then: Let each server generate 200T/X samples on [0, T). Or if you want variable numbers of messages from each server, pick globally 200T samples from [0, T), and then for each sample pick uniformly a server from [1, X]. –  Kerrek SB Jun 16 '11 at 16:17
I would like the latter option in your suggestion. But i do not understand what you meant by 200 T samples from [0,T) any Why only 200 ? –  Jimm Jun 16 '11 at 16:31
@Jimm: 200 times T, so you average to 200 per second, non? (Multiplication is implicit, like "I want to eat 2 apples", not "2 times apples" :-).) –  Kerrek SB Jun 16 '11 at 16:34
Thanks , i think it sounds feasible. In statistic terminology, how would you reword this problem? In terms of mean and std deviation ? –  Jimm Jun 16 '11 at 16:49

Your Answer


