- #1
roam
- 1,271
- 12
- TL;DR Summary
- Is there a way to generate two random numbers such that their ratio simulates the behavior of an irrational number?
I am trying to write an algorithm that generates two random numbers in a given interval such that their ratio is an irrational number. I understand that all numbers stored on a computer are rational, so it is not possible to have a truly irrational number in a simulation. So, instead I am looking for an algorithm that generates two numbers whose ratio simply has a very long repeat period (it appears to be irrational during the simulation). How would such an algorithm look like (e.g., in Matlab)?
Any suggestions would be greatly appreciated.
P.S. I am simulating a physical situation where the ratio of the period of two waves is not rational (or rather, it has a very long repeat period), hence the resultant wave does not appear to be periodic.
Any suggestions would be greatly appreciated.
P.S. I am simulating a physical situation where the ratio of the period of two waves is not rational (or rather, it has a very long repeat period), hence the resultant wave does not appear to be periodic.