Welcome
Topic Name : Mid-Square Random Number Generation
Presented By
Md: Arman Hossain
OUTLINE
 Introduction
 Mid-square Method
 Example of Mid-square
 Departures of Mid-square Method
 Applications of Random Numbers
 References
INTRODUCTION
Mid-square method was invented by John von Neumann, and was described at a conference in 1949.
In mathematics, the mid-square method is a method of generating pseudorandom numbers. In practice it is
not a good method since its period is usually very short.
Mid-square Method
1. Starting with n digit number
2. Squaring it
3. For 8 digit : Remove two lower and higher order digit
4. For 7 digit : Remove one lower and two higher order digit
5. Taking n digits in the middle as the next number
6. Repeat from number no. 2.
Example of Mid-square
For an example, we are using 4 digit which is called seed number, we are showing generate 5 random number
here,
5673
1. (5673)2 = 32 1829 29 = 1829
2. (1829)2 = 3 3452 41 = 3452
3. (3452)2 = 11916304 = 9163
4. (9163)2 = 83960569 = 9605
5. (9605)2 = 92256025 = 2560
Remove two
higher order digit
Remove two
lower order digit
Next seed
number
Square seed
number
Remove one
higher order digit
Remove two
lower order digit
Departures of Mid-square Method
Converge on a constant :
 2500
(2500)2 = 6 2500 00 = 2500 This will repeated.
 2504
(2504)2 = 6 2700 16 = 2700
(2700)2 = 7 2900 00 = 2900
(2900)2 = 8 4100 00 = 4100
.
.
(2100)2 = 4 4100 00 = 4100 This will repeated also.
There more constant number like this.
seed
seed
Applications of Random Numbers
 Simulation : when a computer is being used to simulate natural phenomena, random numbers are
required to make things realistic. Simulation covers many fields, from the study of nuclear physics to
operations research.
 Sampling : It is often impractical to examine all possible cases, but a random sample will provide
insight into what constitutes “typical behavior”.
 Numerical analysis : Ingenious techniques for solving complicated numerical problems have been
devised using random numbers.
 Computer programming: Random values make a good source of data for testing the effectiveness of
computer algorithm.
 Decision making : There are reports that many executives make their decisions by flipping a coin or
by throwing darts, etc. It is also rumored that some college professors prepare their grades on such a
basis. Sometimes it is important to make a completely "unbiased decision; this ability is occasionally
useful in computer algorithms, for example in situations where a fixed decision made each time would
cause the algorithm to run more slowly. Randomness is also an essential part of optimal strategies in
the theory of games.
 Recreation : Rolling dice, shuffling decks of cards, spinning roulette wheels, etc., are fascinating
pastimes for just about everybody. These traditional uses of random numbers have suggested the name
"Monte Carlo method," a general term used to describe any algorithm that employs random numbers.
THANK YOU

Midsquare method- simulation system

  • 1.
  • 2.
    Topic Name :Mid-Square Random Number Generation Presented By Md: Arman Hossain
  • 3.
    OUTLINE  Introduction  Mid-squareMethod  Example of Mid-square  Departures of Mid-square Method  Applications of Random Numbers  References
  • 4.
    INTRODUCTION Mid-square method wasinvented by John von Neumann, and was described at a conference in 1949. In mathematics, the mid-square method is a method of generating pseudorandom numbers. In practice it is not a good method since its period is usually very short.
  • 5.
    Mid-square Method 1. Startingwith n digit number 2. Squaring it 3. For 8 digit : Remove two lower and higher order digit 4. For 7 digit : Remove one lower and two higher order digit 5. Taking n digits in the middle as the next number 6. Repeat from number no. 2.
  • 6.
    Example of Mid-square Foran example, we are using 4 digit which is called seed number, we are showing generate 5 random number here, 5673 1. (5673)2 = 32 1829 29 = 1829 2. (1829)2 = 3 3452 41 = 3452 3. (3452)2 = 11916304 = 9163 4. (9163)2 = 83960569 = 9605 5. (9605)2 = 92256025 = 2560 Remove two higher order digit Remove two lower order digit Next seed number Square seed number Remove one higher order digit Remove two lower order digit
  • 7.
    Departures of Mid-squareMethod Converge on a constant :  2500 (2500)2 = 6 2500 00 = 2500 This will repeated.  2504 (2504)2 = 6 2700 16 = 2700 (2700)2 = 7 2900 00 = 2900 (2900)2 = 8 4100 00 = 4100 . . (2100)2 = 4 4100 00 = 4100 This will repeated also. There more constant number like this. seed seed
  • 8.
    Applications of RandomNumbers  Simulation : when a computer is being used to simulate natural phenomena, random numbers are required to make things realistic. Simulation covers many fields, from the study of nuclear physics to operations research.  Sampling : It is often impractical to examine all possible cases, but a random sample will provide insight into what constitutes “typical behavior”.  Numerical analysis : Ingenious techniques for solving complicated numerical problems have been devised using random numbers.  Computer programming: Random values make a good source of data for testing the effectiveness of computer algorithm.  Decision making : There are reports that many executives make their decisions by flipping a coin or by throwing darts, etc. It is also rumored that some college professors prepare their grades on such a basis. Sometimes it is important to make a completely "unbiased decision; this ability is occasionally useful in computer algorithms, for example in situations where a fixed decision made each time would cause the algorithm to run more slowly. Randomness is also an essential part of optimal strategies in the theory of games.  Recreation : Rolling dice, shuffling decks of cards, spinning roulette wheels, etc., are fascinating pastimes for just about everybody. These traditional uses of random numbers have suggested the name "Monte Carlo method," a general term used to describe any algorithm that employs random numbers.
  • 9.