01-03-2020, 09:48 PM
Hi All,
I ran into magic squares (Matlab has a magic() built in function) and a curiosity light bulb went on in my bain, askin the following question:
"Can we use (large) magic squares to generate random numbers?"
I did a limit test (100 by 100 magic square matrix) and then manipulated the numbers:
1. Divide each element by the row/colum sum.
2. Discard the first few decimal digits using something like:
x = 100*x - fix(100*x) = frac(100*x)
I got 10,000 random numbers which may not be a whole lot of PC applications.
Any better approach to generate (and re-generate) batches of random numbers from magic squares?
Namir
I ran into magic squares (Matlab has a magic() built in function) and a curiosity light bulb went on in my bain, askin the following question:
"Can we use (large) magic squares to generate random numbers?"
I did a limit test (100 by 100 magic square matrix) and then manipulated the numbers:
1. Divide each element by the row/colum sum.
2. Discard the first few decimal digits using something like:
x = 100*x - fix(100*x) = frac(100*x)
I got 10,000 random numbers which may not be a whole lot of PC applications.
Any better approach to generate (and re-generate) batches of random numbers from magic squares?
Namir