New OOTS products from CafePress
New OOTS t-shirts, ornaments, mugs, bags, and more
Results 1 to 28 of 28
  1. - Top - End - #1
    Bugbear in the Playground
     
    DruidGuy

    Join Date
    Oct 2008

    Default Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Assuming that I want to represent a random number at the table that sits between 1 and an arbitrary upper bound, inclusively, what is the best way to do it that doesn't involve a computer or calculator?

    I don't think that dice will cut it, because I can't think of any combination of dice that could be used to represent 1 in 37 or 1 in 19 chance.

    Does anyone have any good ideas?

  2. - Top - End - #2
    Titan in the Playground
    Join Date
    Jul 2010
    Location
    Kitchener/Waterloo
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Cards are a decent way. So it rolling a d% or several and just re-rolling when you get too high.
    Lord Raziere herd I like Blasphemy, so Urpriest Exalted as a Malefactor

    Meet My Monstrous Guide to Monsters. Everything you absolutely need to know about Monsters and never thought you needed to ask.
    Quote Originally Posted by Mithril Leaf View Post
    One of the unwritten rules of Giantitp is that Urpriest is always right.
    Trophy!
    Spoiler
    Show


    original Urpriest (by Andraste)

  3. - Top - End - #3
    Library Lovers Contest Winner
     
    Duke of URL's Avatar

    Join Date
    Dec 2006
    Location
    Maryland, USA
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    The simplest way would, of course, be a computer.

    For low enough numbers (like 19), roll the next highest-sized die, ignoring out-of-range results. (E.g., roll 1d20, ignoring any 20s.)

    Failing that, I would roll Nd10, with N being log10 of your target number, rounded up; reading the dice similarly to percentile dice. This is the same as above, really, just using an arbitrary decimal bound instead of normal d%. Take 10N divided by your target number, rounded down. Divide your die roll result by this to get your random value. If the result is out of range, re-roll.

    Example:

    Target = 37
    N = 2
    102 / 37 = 2

    {table]Die Roll|Random Result
    01 | 1
    14 | 7
    50 | 25
    74 | 37
    75+ | re-roll, ignoring results > 74[/table]
    Last edited by Duke of URL; 2010-09-28 at 02:31 PM.


    My Homebrew
    Gronk by dallas-dakota

  4. - Top - End - #4
    Titan in the Playground
    Join Date
    Jun 2006
    Location
    Fairfield, CA
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    I don't think that dice will cut it, because I can't think of any combination of dice that could be used to represent 1 in 37 or 1 in 19 chance.

    Does anyone have any good ideas?
    1/37: 1d150, reroll 149 and 150.
    1/19: 1d100, reroll 96, 97, 98, 99, and 100.

  5. - Top - End - #5
    Troll in the Playground
     
    Ernir's Avatar

    Join Date
    Jan 2009
    Location
    Iceland
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Numbered cards, say from 1-100 (or however many you need). Keep them ordered, and when one of those stupid 1-in-prime-number-above-3 chances comes up, take out as many as you need, shuffle, and draw.

    Have someone re-order them while they are waiting their turn in combat.
    Last edited by Ernir; 2010-09-28 at 02:28 PM.
    Halfling healer avatar by Akrim.elf.

    My sarcasm is never blue.

    Personal stuff: The Diablo 2 game (DMing), BBCode syntax highlighter for KDE
    CharOp: Lists of Necessary Magic Items
    Homebrew: My proudest achievement, a translation of vancian spellcasting to psionic mechanics. Other brew can be found in my Homebrewer's Extended Signature.

  6. - Top - End - #6
    Ogre in the Playground
     
    Imp

    Join Date
    Mar 2008
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    You need geometry and dice manufacturing nerds, not math nerds. That said, with the standard D&D dice (multiple d4s, d6s, d8s, d10s + percentiles, d12s and d20s), I usually do the following if I need to roll XY, where X is the tens digit and Y is the ones digit.

    I take a bright colored dA, where A is as close to X as possible while A>X, and use it to represent my tens digit. If the dA rolls above X, I re-roll it.

    Then I take a different bright-colored dB, where B is as close to Y as possible while B>Y, and use it to represent my ones digit. If the dB rolls above Y, I re-roll it.
    Quote Originally Posted by The Giant
    I want tools to use in the game, not a blank check to do what I want. I can already do what I want.

  7. - Top - End - #7
    Titan in the Playground
    Join Date
    Aug 2007
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    Assuming that I want to represent a random number at the table that sits between 1 and an arbitrary upper bound, inclusively, what is the best way to do it that doesn't involve a computer or calculator?

    I don't think that dice will cut it, because I can't think of any combination of dice that could be used to represent 1 in 37 or 1 in 19 chance.

    Does anyone have any good ideas?
    1 in 37: 1d4 for first digit, 4 => 0. 1d10 for second digit. Re-roll on 38 and 39 (5% chance of reroll)
    1 in 19: 1d20, re-roll 20. 5% chance of re-roll.
    General: It may help to get dice numbered starting at 0. Round up whatever you want, pick the right dice (usually including 1 or more d10s), then re-roll if the answer is invalid.
    So you never have to interrupt a game to look up a rule again:
    My 3.5e Rules Cheat Sheets: Normal, With Consolidated Skill System
    TOGC's 3.5e Spell/etc Cards: rpgnow / drivethru rpg
    Utilities: Magic Item Shop Generator (Req. MS Excel), Balanced Low Magic Item System
    Printable Cardstock Dungeon Tiles and other terrain stuff (100 MB)

  8. - Top - End - #8
    Firbolg in the Playground
     
    Kobold

    Join Date
    Sep 2007
    Location
    Earth... sort of.
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    Assuming that I want to represent a random number at the table that sits between 1 and an arbitrary upper bound, inclusively, what is the best way to do it that doesn't involve a computer or calculator?

    I don't think that dice will cut it, because I can't think of any combination of dice that could be used to represent 1 in 37 or 1 in 19 chance.

    Does anyone have any good ideas?
    I must ask:

    WHY?
    Avatar by K penguin. Sash by Damned1rishman.
    MOVIE NIGHTS AND LETS PLAYS LIVESTREAMED

  9. - Top - End - #9
    Ettin in the Playground
     
    dsmiles's Avatar

    Join Date
    Jul 2009
    Location
    In the T.A.R.D.I.S.
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by shadow_archmagi View Post
    I must ask:

    WHY?
    Why ask why? Try Bud Dry.
    Quote Originally Posted by The Doctor
    People assume that time is a strict progression of cause-to-effect, but actually from a non-linear, non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stuff.
    Awesomesauce Doctor WhOotS-atar by Ceika!

  10. - Top - End - #10
    Titan in the Playground
     
    Kurald Galain's Avatar

    Join Date
    Jun 2007

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Last edited by Kurald Galain; 2010-09-28 at 02:47 PM.
    Guide to the Magus, the Pathfinder Gish class.

    "I would really like to see a game made by Obryn, Kurald Galain, and Knaight from these forums. I'm not joking one bit. I would buy the hell out of that." -- ChubbyRain
    Crystal Shard Studios - Freeware games designed by Kurald and others!

  11. - Top - End - #11
    Bugbear in the Playground
     
    DruidGuy

    Join Date
    Oct 2008

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Duke of URL View Post
    The simplest way would, of course, be a computer.

    For low enough numbers (like 19), roll the next highest-sized die, ignoring out-of-range results. (E.g., roll 1d20, ignoring any 20s.)

    Failing that, I would roll Nd10, with N being log10 of your target number, rounded up; reading the dice similarly to percentile dice. This is the same as above, really, just using an arbitrary decimal bound instead of normal d%. Take 10N divided by your target number, rounded down. Divide your die roll result by this to get your random value. If the result is out of range, re-roll.

    Example:

    Target = 37
    N = 2
    102 / 37 = 2

    {table]Die Roll|Random Result
    01 | 1
    14 | 7
    50 | 25
    74 | 37
    75+ | re-roll, ignoring results > 74[/table]

    That will do nicely. Thank you very much.

  12. - Top - End - #12
    Barbarian in the Playground
    Join Date
    Jun 2009
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    The general method: generate a large random number (say, 5d10 read as a value from 0 to 99999), divide by 37 (or whatever), and use the remainder. That won't give a perfectly even distribution, but then neither do physical dice (cue Lou Zocchi spiel here). Of course, I guess some people would find that hard without a calculator.

    In many cases, you can also roll a slightly higher number that's more convenient, and re-roll if the result is too high. E.g., for d37, roll d4 and d10 to get a value from 0 to 39, then reroll if that's out of range.
    Last edited by Skorj; 2010-09-28 at 03:00 PM.

  13. - Top - End - #13
    Ogre in the Playground
    Join Date
    Sep 2008

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Some wargames use "chits" -- similar to the card idea, but much smaller (typically a die-cut playing piece with a number or code on it describing the result). It actually works pretty well, and is great if you want to generate several random numbers with no duplicates.

  14. - Top - End - #14
    Titan in the Playground
     
    Keld Denar's Avatar

    Join Date
    Feb 2006
    Location
    Seattle, WA
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Yea, if a calculator was allowed, I wrote a script for my TI-83 that uses the RANDINT function and a simple while loop to roll XdY dice, where X and Y were any positive interger.

    With small odd numbers, its pretty easy. As someone said, just roll the next larger die size and reroll any numbers higher than your target. This is the easiest way to arbitrate Mirror Images. You have a 1 in X chance of hitting the real wizard, where X is the number of images plus one. If there are 7 images, thats a 1 in 8 chance, or 1d8 (hit on a 1). If one image gets popped, you now have 6 images, for a 1 in 7 chance. Thats just 1d8, rerolling 8s, and hitting the wizard on a 1.

    Simple simple. You might have to roll a LOT for numbers that are just above the threshold, given standard probability distributions (like rolling a d31 with a percentile), but you'll eventually get there and its about as unbiased as you can physically get unless you fix the dice.
    Quote Originally Posted by Fax Celestis View Post
    AILHAY THULUCAY! AILHAY THULUCAY! AILHAY THULUCAY!
    _________________________________
    A beholder’s favorite foods include small live mammals, exotic mushrooms and other fungi, gnomes, beef, pork, colorful leafy vegetables, leaves, flower petals, insects, and birds.

  15. - Top - End - #15
    Barbarian in the Playground
     
    The Mentalist's Avatar

    Join Date
    Jan 2009
    Location
    Georgia + Inner World
    Gender
    Male2Female

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    http://www.random.org/integers/

    If you have internet at the table that's useful.

    Edit: Re-read and no computers... Drat.
    Last edited by The Mentalist; 2010-09-28 at 11:09 PM.
    Having trouble writing up hard stat blocks but I'm doing a lot of sharing ideas and soft mechanics lately.

  16. - Top - End - #16
    Bugbear in the Playground
     
    PirateGirl

    Join Date
    Sep 2010

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    You desire a random integer from 1 to K.

    Choose a larger upper bound N that you can simulate (for example a d20 and a d100 for 2000).

    Also figure out the largest multiple of K which is less or equal to N. Call it M.

    Draw X from 1 to N. If X<=M, you're done. If X>M, redraw X, and repeat.
    Last edited by ffone; 2010-09-28 at 10:30 PM.

  17. - Top - End - #17
    Ettin in the Playground
     
    Kobold

    Join Date
    May 2005
    Location
    Somerville, MA
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    I vote for rolling something above what's needed and rerolling if you go over. It's usually quicker than dividing.

    Modular arithmetic can work too, but I've only seen it for low values. It still works higher up. Let's say you need 1d31. Roll 1d100 (or 2d10 as the case may be). If your value is above 31, subtract 31 and check again. Then repeat. You'll have to drop any values above 93 though (since there are 3 complete 31s in 1-100) or your roll will favor 1-7 as they can appear a 4th time each.

    I'm still not sure when you'd ever need 1d31 though.
    If you like what I have to say, please check out my GMing Blog where I discuss writing and roleplaying in greater depth.

  18. - Top - End - #18
    Bugbear in the Playground
     
    Peregrine's Avatar

    Join Date
    Feb 2005
    Location
    Western Australia
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Lots of people are suggesting numbered cards. This would seem to me to be completely missing the part where you need an arbitrary upper bound. Say you need a random number on [1,1000] -- what, you have 1000 cards? And then what about smaller numbers? Draw from the 1000-card deck and discard invalid results? Divide to get close to the valid range?

    This has all been suggested for dice, which are much less unwieldly. Duke of URL got the simplest solution(s) in one go. To recap without the reference to logs and exponents: If it fits within a nice easy bound like [1,20], roll the d20 and drop out-of-bound rolls. Otherwise:
    1. Pick the nice round decimal number, like 100 or 1000 or 10000, that fits your desired range inside it.
    2. Roll enough d10s to get that range -- two for 100, three for 1000, and so on.
    3. If your upper bound is more than half the size of this nice round decimal number (e.g. [1,87] simulated with d100), just discard any rolls that are out of range.*
    4. If not -- that is, if your upper bound would go into the nice round decimal number two, or three, or however many times -- divide by that number. [1,31] would go into d100 three times, so we divide by three and discard any result of 32 or 33.

    * This might get inconvenient with using d1000 to simulate [1,501], but hey, if you don't want to use a computer, then "inconvenient" is pretty much the name of the game.

    EricGrau and ffone pretty much suggested the same thing, with the minor added complication/convenience of not being restricted to round decimal values. A few other people had very similar variations.

    (Edited to add: Valadil's method with modular arithmetic, or subtraction instead of division, is probably the easiest of all. Same system, no division.)

    Quote Originally Posted by Fax Celestis View Post
    1/37: 1d150, reroll 149 and 150.
    You have a d150?

    Quote Originally Posted by GoodbyeSoberDay View Post
    You need geometry and dice manufacturing nerds, not math nerds.
    Geometry ⊂ maths. And I'm not sure how dice manufacture would help, except inasmuch as dice manufacturers are geometry/maths nerds.
    Last edited by Peregrine; 2010-09-28 at 11:20 PM.
    I support paladins and the alignment system.

    My Homebrew Gaming Stuff (not updated lately) - My Campaign (ended)
    Homebrew licence:
    Spoiler
    Show
    All my homebrew stuff is released under the Open Game License, except where based on non-OGC work or otherwise stated. For Section 15:

    <name of homebrew here> Copyright <year first posted>, T. Pederick

  19. - Top - End - #19
    Titan in the Playground
    Join Date
    Jun 2006
    Location
    Fairfield, CA
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Peregrine View Post
    You have a d150?
    No, but I can simulate one rather easily with dice.

  20. - Top - End - #20
    Ettin in the Playground
     
    dsmiles's Avatar

    Join Date
    Jul 2009
    Location
    In the T.A.R.D.I.S.
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Peregrine View Post
    You have a d150?
    I wish I did. But I do have the essential dice: d2, d3, d4, d6, d8, d10, d12, d20, d30, d100 (Zoccihedron, I just like saying Zoccihedron ), Doubling Cube, etc.

    Zoccihedron.
    Quote Originally Posted by The Doctor
    People assume that time is a strict progression of cause-to-effect, but actually from a non-linear, non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stuff.
    Awesomesauce Doctor WhOotS-atar by Ceika!

  21. - Top - End - #21
    Titan in the Playground
     
    Kurald Galain's Avatar

    Join Date
    Jun 2007

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Peregrine View Post
    * This might get inconvenient with using d1000 to simulate [1,501], but hey, if you don't want to use a computer, then "inconvenient" is pretty much the name of the game.
    For [1,501], you roll 1d6 and 2d10 to get the three digits. That's less rerolls than 3d10 gives you.
    Guide to the Magus, the Pathfinder Gish class.

    "I would really like to see a game made by Obryn, Kurald Galain, and Knaight from these forums. I'm not joking one bit. I would buy the hell out of that." -- ChubbyRain
    Crystal Shard Studios - Freeware games designed by Kurald and others!

  22. - Top - End - #22
    Titan in the Playground
     
    Tyndmyr's Avatar

    Join Date
    Aug 2009
    Location
    Maryland
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    Assuming that I want to represent a random number at the table that sits between 1 and an arbitrary upper bound, inclusively, what is the best way to do it that doesn't involve a computer or calculator?

    I don't think that dice will cut it, because I can't think of any combination of dice that could be used to represent 1 in 37 or 1 in 19 chance.

    Does anyone have any good ideas?
    Dice work quite well. Use the next size of die above the desired number(d20 for 1 in 19). Any result above the upper bound is rerolled. Done deal.

  23. - Top - End - #23
    Bugbear in the Playground
     
    DruidGuy

    Join Date
    Oct 2008

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Tyndmyr View Post
    Dice work quite well. Use the next size of die above the desired number(d20 for 1 in 19). Any result above the upper bound is rerolled. Done deal.
    That works great until I need a number between 1 and 7,000,000,000,001: that's a lot of potential re-rolls. I think that modulus division is probably going to work best for me, since I have a knack for doing modulus in my head.

    Thanks for the ideas, everyone.

  24. - Top - End - #24
    Barbarian in the Playground
    Join Date
    Jun 2009
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    .... I think that modulus division is probably going to work best for me, since I have a knack for doing modulus in my head.

    Thanks for the ideas, everyone.
    Well, you did ask for the math geeks.

  25. - Top - End - #25
    Ettin in the Playground
     
    dsmiles's Avatar

    Join Date
    Jul 2009
    Location
    In the T.A.R.D.I.S.
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Have you even considered numbered scraps of paper in a hat?
    Quote Originally Posted by The Doctor
    People assume that time is a strict progression of cause-to-effect, but actually from a non-linear, non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stuff.
    Awesomesauce Doctor WhOotS-atar by Ceika!

  26. - Top - End - #26
    Titan in the Playground
     
    Tyndmyr's Avatar

    Join Date
    Aug 2009
    Location
    Maryland
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by subject42 View Post
    That works great until I need a number between 1 and 7,000,000,000,001: that's a lot of potential re-rolls. I think that modulus division is probably going to work best for me, since I have a knack for doing modulus in my head.

    Thanks for the ideas, everyone.
    If you need numbers between 1 and 7,000,000,000,001, I would honestly suggest that perhaps your gaming system has too fine-grained detail.

    However, if you just want the number, grab some D100s. You'll need six of them and a D10. Roll in order to determine the digits, since you essentially have a D 10,000,000,000,000. About 3/10ths of the time, you'll have to reroll the first die(no need to reroll the rest). No biggie.

  27. - Top - End - #27
    Ettin in the Playground
     
    dsmiles's Avatar

    Join Date
    Jul 2009
    Location
    In the T.A.R.D.I.S.
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Quote Originally Posted by Tyndmyr View Post
    If you need numbers between 1 and 7,000,000,000,001, I would honestly suggest that perhaps your gaming system has too fine-grained detail.
    Maybe they're playing FATAL?
    Quote Originally Posted by The Doctor
    People assume that time is a strict progression of cause-to-effect, but actually from a non-linear, non-subjective viewpoint - it's more like a big ball of wibbly wobbly... time-y wimey... stuff.
    Awesomesauce Doctor WhOotS-atar by Ceika!

  28. - Top - End - #28
    Banned
     
    Snake-Aes's Avatar

    Join Date
    Sep 2006
    Location
    R'lyeh
    Gender
    Male

    Default Re: Calling all math nerds: How to Determine Arbitrary Random Numbers?

    Browsers should run this fine:
    Code:
    javascript: alert(Math.floor(Math.random()*1000000000000));

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •