\(\(\( (*generate\ 10000\ random\ integers\ in\ the\ range\ 3, 4, 5, 6, 
      7*) \)\(
\)\(\(Exper1[p_]\)\(:=\)\((

        For[i = 1, 
          i ≤ 5, \(i++\), 
x[i - 1] = 0]; 

        For[i = 1, 
            i ≤ 10000, \(i++\), 
j = 
              Floor[5  Random[]] + 3; 
x[j - 3] = 
              x[j - 3] + 1; ]

          For[i = 1, 
            i ≤ 5, \(i++\), 
Print[
              x[i - 1]]]; 
 (*compute\ the\ chi - 
            squared\ statistic\ based\ on\ these\ 5\ categories*) 
V = 0; 

        For[i = 1, 
          i ≤ 5, \(i++\), 
V = \ 
            V + \((x[i - 1] - 2000)\)^2/2000]; 

        Print[N[V]])\)\(
\)\)\)\)

Exper1[1]

Exper1[1]

Exper1[1]

Exper1[1]

Exper1[1]

Exper1[1]

\(\(\( (*generate\ 100000\ random\ integers\ in\ the\ range\ 3, 4, 5, 6, 
      7*) \)\(
\)\(\(Exper2[p_]\)\(:=\)\((

        For[i = 1, 
          i ≤ 5, \(i++\), 
x[i - 1] = 0]; 

        For[i = 1, 
            i ≤ 100000, \(i++\), 
j = 
              Floor[5  Random[]] + 3; 
x[j - 3] = 
              x[j - 3] + 1; ]

          For[i = 1, 
            i ≤ 5, \(i++\), 
Print[
              x[i - 1]]]; 
 (*compute\ the\ chi - 
            squared\ statistic\ based\ on\ these\ 5\ categories*) 
V = 0; 

        For[i = 1, 
          i ≤ 5, \(i++\), 
V = \ 
            V + \((x[i - 1] - 20000)\)^2/20000]; 

        Print[N[V]])\)\(
\)\)\)\)

Exper2[1]

Exper2[1]

Exper2[1]

Exper2[1]

Exper2[1]

m =  5^3 17^4 3

b =  15 17^2

a = b + 1

c = 19 2^10

x = 0

For[i = 1, i ≤ m, 
      i = i + 1, 
xsave = x; 
x  =  
        Mod[a x + c, m]; 
If[x == xsave, 
        Print["match"],   z = 1]]
Print ["done"]

x =.

ran[
        x_] := 
(y =  
            Mod[4336 x  + 19456, 31320375];)

ran[y]

y

ran[y]

y

\(\(\(
\)\( (*"random"\ 3, 4, 5, 6, 
      7*) \)\(
\)\(\(Exper3[
        p_]\)\(:=\)\((
For[i = 1, 
          i ≤ 5, \(i++\), 
xx[i - 1] = 0]; 

        For[i = 1, 
          i ≤ 100000, \(i++\), 
ran[
            y]; 
j = \ 
            Floor[5\ y/m] + 3; 
xx[j - 3] = 
            xx[j - 3] + 1]; 

        N[\((xx[0] - 20000)\)^2 + \((xx[1] - 20000)\)^2 + \((xx[2] - 
                    20000)\)^2 + 
\((xx[3] - 
                    20000)\)^2 + \((xx[4] - 20000)\)^2]/
          20000)\)\(
\)\)\)\)

Exper3[1]

Exper3[1]

Exper3[1]

Exper3[1]

Exper3[1]