root/hodgestar/PythonCode/SmallScripts/bentleysaxe.py
| Revision 375, 219 bytes (checked in by simon, 4 years ago) | |
|---|---|
|
|
| Line | |
|---|---|
| 1 | from random import random |
| 2 | |
| 3 | def dscRand(iN): |
| 4 | fMax = 1.0 |
| 5 | for i in range(iN,0,-1): |
| 6 | fMax = fMax*random()**(1.0/i) |
| 7 | yield fMax |
| 8 | |
| 9 | def ascRand(iN): |
| 10 | for f in dscRand(iN): |
| 11 | yield 1.0 - f |
Note: See TracBrowser
for help on using the browser.
