Can we use magic squares as random number generators?
|
01-03-2020, 09:48 PM
(This post was last modified: 01-03-2020 09:49 PM by Namir.)
Post: #1
|
|||
|
|||
Can we use magic squares as random number generators?
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 |
|||
01-06-2020, 09:14 AM
Post: #2
|
|||
|
|||
RE: Can we use magic squares as random number generators?
Namir,
If you have a good random number generator to create your magic square and use the right method, it could work. Otherwise, I would be very worried. (See there). |
|||
01-06-2020, 03:24 PM
Post: #3
|
|||
|
|||
RE: Can we use magic squares as random number generators?
Made me think back to when I wanted to generate a series of random numbers back in 1977 with my HP-67 (have no idea how I was separated away from that beautifully done device). In radian mode, I took the sine of a seed number (incremented up by 1 for each new random number), and did away with the first 6 digits with my program. Seemed fine for my needs (was simulating baseball games for a simulated season!)
|
|||
01-07-2020, 01:07 PM
Post: #4
|
|||
|
|||
RE: Can we use magic squares as random number generators?
(01-06-2020 03:24 PM)lrdheat Wrote: Made me think back to when I wanted to generate a series of random numbers back in 1977 with my HP-67 (have no idea how I was separated away from that beautifully done device). In radian mode, I took the sine of a seed number (incremented up by 1 for each new random number), and did away with the first 6 digits with my program. Seemed fine for my needs (was simulating baseball games for a simulated season!) Discarding the first few digits after the decimal seems to work fine in general, because the digits that remain are more or less noise! I was able to develop a Matlab random number generator (luck had something to do with it). But once I ported it to Excel VBA the random generator did not give very good results. My conclusion is that the software's basic math oprations and functions have something to do with it. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)