# Poisson Twister Generator by Cumulative Frequency Technology
```
usingnsDeonYuliCPoissonTwist32D;//Poissontwistergenerator //bytechnologyofcumulativefrequencies namespaceP060302 {classcP060302 {staticvoidMain(string[]args) {cDeonYuliCPoissonTwist32 DPT= newcDeonYuliCPoissonTwist32D(); intw=7;//bitwidthofuniformrandomvariable PT.SetW(w);//setbitwidthofuniformvariable doubleAlpha=2.0;//Alphaparameter PT.CStart(Alpha);//startgenerator//PT.CTimeStart(Alpha);//startgeneratorusingtimevalue Console.WriteLine(\"w={0}N={1}\",PT.w,PT.N); Console.WriteLine(\"Alpha={0:F2}\",Alpha); Console.WriteLine(\"cEta={0}\",PT.cEta); intwX=200; int[]nuG=newint[wX];//frequenciesofgenerator for(inti=0;i<wX;i++)nuG[i]=0; for(inti=0,j=1;i<PT.N;i++,j++) {intEta=PT.CNext();//Poissonvariable  Console.Write(\"{0,5}\",Eta); if(j%8==0)Console.WriteLine(); nuG[Eta]++;//counterofrandomvariable } } Console.WriteLine(); doublespEta=0.0;//Poissonprobabilitysum longsnuEta=0;//Poissonfrequencysum intsnuG=0;//frequencysum bygenerator  Console.Write(\"EtaPCnuC\");  Console.WriteLine(\"cnuCnuDYG\"); for(intEta=0;Eta<PT.cEta;Eta++) { Console.WriteLine(  \"{0,2}{1,12:F10}{2,8}{3,8}{4,8}\",  Eta,PT.pC[Eta],PT.nuC[Eta],  PT.cnuC[Eta], nuG[Eta]);  spEta+=PT.pC[Eta];  snnuEta+=PT.nuC[Eta];  snuG+=nuG[Eta]; }
```
Listing 10
```


interval. Usually, it is determined on a basis of the experimentally obtained data for a certain situation. Next, if the mathematical expectation is determined, then the dispersion is known also because of the distribution properties of Poisson probabilities. If it turns out that the values of the mathematical expectation and the dispersion are sufficiently close, then the hypothesis of the distribution of certain random variables in accordance with Poisson law is correct. However, if there is a meaningful difference in the obtained values of these characteristics, this would testify against the hypothesis of Poisson distribution of the given random variables. Therefore, first of all, it is necessary to confirm two basic aforementioned properties of Poisson distribution on equality of parameter \(\alpha\) to mathematical expectation and dispersion. Below is the program code that validates this. The generator in it creates the random variables in quantity \(N=2^{w}=2^{32}=4294967296\). Program names _P060402_ and _cP060402_ are chosen by chance. using nsDeonYuliCPoissonTwist32D; //Poisson twister generator  //by technology of cumulative frequencies namespace P060402  { class cP060402  { static void Main(string[] args)  { cDeonYuliCPoissonTwist32D PT =  new cDeonYuliCPoissonTwist32D();  PT.SetW(32); //bit width of random variable  double Alpha = 2.0; //Alpha parameter  PT.CStart(Alpha); //start generator  console.WriteLine(\"w = {0} N = {1}\", PT.w, PT.N);  console.WriteLine(\"Alpha = {0:F2}\", Alpha);  double p1 = 1.0/(double)PT.N; //event probability  double m = 0.0; //mathematical expectation  double D = 0.0; //dispersion  for (long i = 0; i< PT.N; i++)  { int Eta = PT.CNext(); //random variable  m += Eta * p1; //mathematical expectation  D += Eta * Eta * p1; //dispersion  }  D = D - m * m;  console.WriteLine(\"m = {0:F10}\", m);  console.WriteLine(\"D = {0:F10}\", D);  console.ReadKey(); //result viewing  }  } } After running the program _P060402_, the following listing appears on the monitor. w = 32 N = 4294967296 Alpha = 2.00 m = 2.0000000014 D = 2.0000000116 This listing shows the obtained values of mathematical expectation \(m\) and dispersion \(D\). Their negligible difference from the value of parameter \(\alpha=2.0\) is related to the discreteness of Poisson model in probabilities and frequencies of the events. Further, a general discussion should also supplement the estimates of possible generation of the random variables with respect to Poisson distribution. To do this, let us refer to the capabilities of the basic twister generator _nsDeonYuliTwist32D_, which is used here for uniform random variables creation. For a given length of \(w\) bits it realizes several complete twisting sequences.