Лабораторная работа: Исследование статистических характеристик случайной последовательности
Dim reg, regt As String
Dim xi(6), yi(100000), p(2), p0, p1, p2 As Integer
Dim xe As Double
n = CInt(tn.Text)
m = CInt(tm.Text)
q = CInt(tq.Text)
For i = 0 To (n - 1)
reg = reg & CStr(tx(i).Text)
Next
mg = q ^ n - 1
list.AddItem ("M=q^n-1 = " & mg)
list.AddItem ("")
For i = 1 To mg
yi(i) = Right(reg, 1)
r = CInt(Mid(reg, m, 1)) + CInt(Right(reg, 1))
If r >= q Then
r = r - q
Else
End If
If r = 0 Then p0 = p0 + 1
If r = 1 Then p1 = p1 + 1
If r = 2 Then p2 = p2 + 1
regt = reg
reg = CStr(r) & Mid(regt, 1, (n - 1))
list.AddItem ("Генератор=" & reg)
list.AddItem ("Число=" & yi(i))
list.AddItem ("R=" & r)
Next
list.AddItem ("")