Re: Balancing randomness

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 27975
interpreted = N
texte = >I've posted the three methods along with the code used to generate each >at http://toastdesign.com/randomI belive your first results are based on a bad formula:[math]pick=[format .0f][math]pick=(([random]/100)*4)+1[/math][/format][/math]The part [random]/100)*4)+1 does not do what I think you expect it to do.If [random] is from 1-12 (12 figures) your formula will result in 1 If [random] is from 13-37 (25 figures) your formula will result in 2 If [random] is from 38-61 (24 figures) your formula will result in 3 If [random] is from 62-87 (26 figures) your formula will result in 4 If [random] is from 88-100 (13 figures) your formula will result in 5which is pretty much the same as what you see in your random table:1 = 128 (12.8%) 2 = 239 (23.9%) 3 = 255 (25.5%) 4 = 258 (25.8%) 5 = 120 (12%)As far as I can see [random] works as advertised, try to loop all 100 numbers instead of 5:[loop start=1&end=100] [math show=f]total[index]=0[/math] [/loop][!]Set your endpoint here[/!] [math show=f]endPoint=1[/math][loop start=1&end=[endPoint]] [math show=f]pick=[format .0f][random][/format][/math] [math show=f]total[pick]=[interpret][total[pick]][/interpret]+1[/math] [/loop]

[loop start=1&end=100] [index] = [interpret][total[index]][/interpret] ([math][interpret][total[index]][/interpret]/[endPoint]*100[/math]%)
[/loop] ************************************************************* Christer Olsson Stora Nygatan 21 Phone +46 40 791 50 Ljusa Idéer AB S-211 37 Malmoe Fax +46 40 97 99 77 Sweden http://www.ljusaideer.se------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Associated Messages, from the most recent to the oldest:

    
  1. Re: Balancing randomness (Rob Marquardt 2000)
  2. Re: Balancing randomness (Peter Ostry 2000)
  3. Re: SOLUTION.... Re: Balancing randomness (Rob Marquardt 2000)
  4. Re: Balancing randomness (Christer Olsson 2000)
  5. Re: SOLUTION.... Re: Balancing randomness (Kenneth Grome 2000)
  6. Re: SOLUTION.... Re: Balancing randomness (Rob Marquardt 2000)
  7. SOLUTION.... Re: Balancing randomness (Joseph D'Andrea 2000)
  8. Re[2]: Balancing randomness (Kenneth Grome 2000)
  9. Re: Balancing randomness (Joseph D'Andrea 2000)
  10. Re: Balancing randomness (John Butler 2000)
  11. Re[2]: Balancing randomness (Joseph D'Andrea 2000)
  12. Re: Balancing randomness (Miguel Castaneda 2000)
  13. Re: Balancing randomness (Rob Marquardt 2000)
  14. Re: Balancing randomness (Joseph D'Andrea 2000)
  15. Re[2]: Balancing randomness (jpeacock@univpress.com 2000)
  16. Re[2]: Balancing randomness (jpeacock@univpress.com 2000)
  17. Re: Balancing randomness (Peter Ostry 2000)
  18. Re: Balancing randomness (Rob Marquardt 2000)
  19. Re: Balancing randomness (Joseph D'Andrea 2000)
  20. Re: Balancing randomness (jpeacock@univpress.com 2000)
  21. Balancing randomness (Rob Marquardt 2000)
>I've posted the three methods along with the code used to generate each >at http://toastdesign.com/randomI belive your first results are based on a bad formula:[math]pick=[format .0f][math]pick=(([random]/100)*4)+1[/math][/format][/math]The part [random]/100)*4)+1 does not do what I think you expect it to do.If [random] is from 1-12 (12 figures) your formula will result in 1 If [random] is from 13-37 (25 figures) your formula will result in 2 If [random] is from 38-61 (24 figures) your formula will result in 3 If [random] is from 62-87 (26 figures) your formula will result in 4 If [random] is from 88-100 (13 figures) your formula will result in 5which is pretty much the same as what you see in your random table:1 = 128 (12.8%) 2 = 239 (23.9%) 3 = 255 (25.5%) 4 = 258 (25.8%) 5 = 120 (12%)As far as I can see [random] works as advertised, try to loop all 100 numbers instead of 5:[loop start=1&end=100] [math show=f]total[index]=0[/math] [/loop][!]Set your endpoint here[/!] [math show=f]endPoint=1[/math][loop start=1&end=[endPoint]] [math show=f]pick=[format .0f][random][/format][/math] [math show=f]total[pick]=[interpret][total[pick]][/interpret]+1[/math] [/loop]

[loop start=1&end=100] [index] = [interpret][total[index]][/interpret] ([math][interpret][total[index]][/interpret]/[endPoint]*100[/math]%)
[/loop] ************************************************************* Christer Olsson Stora Nygatan 21 Phone +46 40 791 50 Ljusa Idéer AB S-211 37 Malmoe Fax +46 40 97 99 77 Sweden http://www.ljusaideer.se------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Christer Olsson

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

WebDelivery: One step closer !! (1997) [WebDNA] Not even sure what to ask for help on. . . :( (2008) Webcatalog server support (1997) Database access (2003) Where's Cart Created ? (1997) Which GUI HTML editors work with WC ? (1997) Who is doing sign-ups-got it (1998) Protecting Realms (1998) Document Contains No Data! (1997) Firesite and [referrer] atg broke (1997) [Announce]: Web server security and password protection (1997) Formating found categories (1997) Searching the same field with 2 form variables. (2000) Sorry WebDNA server not running ????? (2002) [OT] Bookmarking code (2003) WC2.0 Memory Requirements (1997) [Shownext] (1997) [WebDNA] Is [math] on a number with too many digits the only (2011) [OT] Happy Turkey Day! (2003) Bug alert! (1997)