27 ms·
An interest question is given a random real number x in [0-4] range say, what is the probability there will be a fraction of quality > 3 (for approximating x) f
by quickthrower2 4y ago
An interest question is given a random real number x in [0-4] range say, what is the probability there will be a fraction of quality > 3 (for approximating x) for denominators < n.
(restricting n to make the problem easier to say 2048)
Might be a fun programming project (or interview question ha ha) to monte carlo this.
- jakear 4y agoLittle toy questions like this might make a good use case for the replit app. Might try this at the bar tonight.
- jakear 4y agoAround 3% of Math.random’s numbers are similarly efficiently and accurately representable as small fractions. https://replit.com/@JacksonKearl1/Nodejs https://replit.com/@JacksonKearl1/Nodejs
- eru 4y agoTo properly answer this, you'd need a healthy dose of math. Once you apply all the math, your resulting code is probably relatively simple. But justifying why the simple and short code is justified is a bit more complicated. A simple example: we have no way to uniformly sample a real number from a range in our computers. Our computers can not represent arbitrary real numbers. So we need to sample some kind of proxy, and justify that we are getting the same answer as if sampling properly. Or more formally: we need to estimate the error that our choice of proxy introduces, and justify that estimation.