how would I implement the following probability in a programming language, for example Java

StackOverflow https://stackoverflow.com/questions/8639325

  •  06-04-2021
  •  | 
  •  

Question

Suppose that you have 10 stations that are sending packets at a given time

let's assume that the time is obtained from a counter, so for example

we can have

counter = 1,2,3,...

if counter=1 then at this time we can have for example 5 stations sending packets, at another time, counter = 2 we can have 2 etc

I assume that the transmission time is zero

now, we know that the amount of stations that are sending packets at a given time follows the poisson distribution

I have 2 questions related to this:

  1. How would I use Java in order to somehow simulate this probability? In a for loop I can just count through the time, and then when the time changes, I can find out how many stations are sending packets, and this amount will be following the poisson distribution I haven't found any specific function that can do the following, for example class or anything else, would I have to create my own code for this purpose?

  2. By knowing that the amount of stations that are sending packets is following the poisson distribution, is it possible to somehow generate random packets from every station(1 to 10) so that the amount of packets that will be generated in the end, will be following the poisson distribution?

thanks in advance

Was it helpful?

Solution

1) You would have to write code to simulate that situation. AFAIK there is nothing in the standard libraries that would do this.

2) If the situation you describe is mathematically accurate, then you should be able to model that in your code.

If you don't have any experience programming, then you might have a difficult time with this. If you've programmed before, but not in Java, then it might not be too bad. You'd have to write an appropriate poisson function, but you could use the random number generation facilities in Java to help you out with rest.

Also, if the probability (p) that a node would be sending a value at time t is fixed for n nodes, then wouldn't this follow the binomial distribution?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top