Steve Jackson Games - Site Navigation
Home General Info Follow Us Search Illuminator Store Forums What's New Other Games Ogre GURPS Munchkin Our Games: Home

Go Back   Steve Jackson Games Forums > Roleplaying > GURPS

Reply
 
Thread Tools Display Modes
Old 07-12-2018, 07:31 PM   #1
hal
 
Join Date: Aug 2004
Location: Buffalo, New York
Default Math Problem and GURPS CYBERPUNK

Hello Folks,
Got a problem I'm trying to resolve, and figure that someone else with better math skills (which isn't too hard to do these days!) than I - might point me in the right direction.

In GURPS CYBERPUNK, there is a page that lists the number of comm lines available for a randomly generated node. In essence, it boils down to something along the lines of:

Roll a 1-5, get a specific result
Roll a 6, roll 3d6, total, and roll again on the table.

Statistically speaking the odds of rolling 6 sixes in a row are rather low. Problem is, I can't use an "if/then" decision structure to determine how many dice to roll in an application that I am using. I only get ONE shot at determining how many comm lines are available - since I can't use any recursive loops or any if/then decision making.

Ultimately, a roll of a 1 to a 5 will give a known effect and there are no recursive rolling involved.

So, for example: If a 1 is rolled, we have 1 comm line, A 2 is rolled, we have 2 comm lines. A 3 or 4 is rolled, we roll 1d6, and a 5 means roll 2d6.

In effect, these are essentially "constants".

What is variable however, is when a 6 gets rolled, we roll 3d6, add any previous total to the value.

So, in theory?

A roll of a 6 the first time results in rolling 3d6 plus the results of a second roll of 1 to 5. Only with a roll of a 6, do we have 6d6 and the result of a third die.

How do I go about calculating the odds of what the rolls will be?

Let's say for the sake of argument, that if we roll 2 6's in a row, the odds will be, that the next roll will be a 1-5 (or an 83% chance that we don't have to go into another loop.

Odds technically are:

5/6 chance we never entered the loop in the first place. That is the GREATEST probabilty statistically speaking.

a 1/6 chance that we do enter the loop. Of that 1/6th possibility, we have a 5/6 chance we don't run into a second loop, and only a 1/6 of 1/6 chance, that we will enter into the loop.

If that happens, we have a 5/6 chance of that 1/36 chance, that we don't enter a third loop, but only a 1 in 6 chance of a 1/36 chance we enter into a fourth loop.


Ultimately, what I want to do, is figure out what the odds are of rolling any specific result.

In other words:

1, 2, 1d6, 1d6, 2d6 take up 83% chance of all the probabilities. Then a 3d6+1, 3d6+2, 4d6, 4d6, 5d6 would be the next possibilities (a roll of a 6 followed by a roll of a 1-5.

See my drift?

That is what is making my head ache. This app I'm using? I can tell it to roll 1d13 if I wanted to. I could tell it to roll 1d216 and get a number from 1 to 216.

How do I go about determining the overall odds of each type of result - which are predicated on the fact that the first die roll counts (ie the first 1d6 roll, and only on a 6, will there be a second 1d6 roll, and only on a 6, will there be a third 1d6 roll, etc.

Part of me wants to give up on this puzzle, and part of me wants to try and sit down and use an excel spreadsheet to carefully construct a tree of results.

I'm figuring some math guru might be able to do that with a simple math formula. :)
hal is online now   Reply With Quote
Old 07-13-2018, 12:39 AM   #2
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Math Problem and GURPS CYBERPUNK

It would help to know what the limits of the programming language you're using are. This is an ideal place where you could use a DO WHILE loop, but if the language doesn't support IF THEN it probably doesn't support DO WHILE.

As for probability, this is a sum of an infinite series so you can never get it "correct" without doing some sort of recursive loop. The best you can do is decide how many dice you're going to go down the rabbit hole:


1 = 1/6
2 = 1/6
3 = 1/6
4 = 1/6
5 = 1/6
6+1 = 1/6 * 1/6 = 1/36
6+2 = 1/36
6+3 = 1/36
6+4 = 1/36
6+5 = 1/36
6+6+1 = 1/36 * 1/6 = 1/216
6+6+2 = 1/216
6+6+3 = 1/216
6+6+4 = 1/216
6+6+5 = 1/216
6+6+6+1 = 1/216 * 1/6 = 1/1296
6+6+6+2 = 1/1296
6+6+6+3 = 1/1296
6+6+6+4 = 1/1296
6+6+6+5 = 1/1296
6+6+6+6+1 = 1/1296 * 1/6 = 1/7776
6+6+6+6+2 = 1/7776
6+6+6+6+3 = 1/7776
6+6+6+6+4 = 1/7776
6+6+6+6+5 = 1/7776
6+6+6+6+6+1 = 1/7776 * 1/6 = 1/46656
6+6+6+6+6+2 = 1/46656
6+6+6+6+6+3 = 1/46656
6+6+6+6+6+4 = 1/46656
6+6+6+6+6+5 = 1/46656
6+6+6+6+6+6+1 = 1/46656 * 1/6 = 1/279936
6+6+6+6+6+6+2 = 1/279936
6+6+6+6+6+6+3 = 1/279936
6+6+6+6+6+6+4 = 1/279936
6+6+6+6+6+6+5 = 1/279936
etc, etc, etc


Assuming you wanted to go out to 6d6 here's the result table:
Code:
          1 = 1/6     = 7776/46656 -> 1
          2 = 1/6     = 7776/46656 -> 2
          3 = 1/6     = 7776/46656 -> 1d6
          4 = 1/6     = 7776/46656 -> 1d6
          5 = 1/6     = 7776/46656 -> 2d6
        6+1 = 1/36    = 1296/46656 -> 3d6+1
        6+2 = 1/36    = 1296/46656 -> 3d6+2
        6+3 = 1/36    = 1296/46656 -> 4d6
        6+4 = 1/36    = 1296/46656 -> 4d6
        6+5 = 1/36    = 1296/46656 -> 5d6
      6+6+1 = 1/216   = 216/46656  -> 6d6+1
      6+6+2 = 1/216   = 216/46656  -> 6d6+2
      6+6+3 = 1/216   = 216/46656  -> 7d6
      6+6+4 = 1/216   = 216/46656  -> 7d6
      6+6+5 = 1/216   = 216/46656  -> 8d6
    6+6+6+1 = 1/1296  = 36/46656   -> 9d6+1
    6+6+6+2 = 1/1296  = 36/46656   -> 9d6+2
    6+6+6+3 = 1/1296  = 36/46656   -> 10d6
    6+6+6+4 = 1/1296  = 36/46656   -> 10d6
    6+6+6+5 = 1/1296  = 36/46656   -> 11d6
  6+6+6+6+1 = 1/7776  = 6/46656    -> 12d6+1
  6+6+6+6+2 = 1/7776  = 6/46656    -> 12d6+2
  6+6+6+6+3 = 1/7776  = 6/46656    -> 13d6
  6+6+6+6+4 = 1/7776  = 6/46656    -> 13d6
  6+6+6+6+5 = 1/7776  = 6/46656    -> 14d6
6+6+6+6+6+1 = 1/46656 = 1/46656    -> 15d6+1
6+6+6+6+6+2 = 1/46656 = 1/46656    -> 15d6+2
6+6+6+6+6+3 = 1/46656 = 1/46656    -> 16d6
6+6+6+6+6+4 = 1/46656 = 1/46656    -> 16d6
6+6+6+6+6+5 = 1/46656 = 1/46656    -> 17d6
6+6+6+6+6+6 = 1/46656 = 1/46656    -> 18d6+1
And here's 5d6:
Code:
        1 = 1/6    = 1296/7776 -> 1
        2 = 1/6    = 1296/7776 -> 2
        3 = 1/6    = 1296/7776 -> 1d6
        4 = 1/6    = 1296/7776 -> 1d6
        5 = 1/6    = 1296/7776 -> 2d6
      6+1 = 1/36   = 216/7776  -> 3d6+1
      6+2 = 1/36   = 216/7776  -> 3d6+2
      6+3 = 1/36   = 216/7776  -> 4d6
      6+4 = 1/36   = 216/7776  -> 4d6
      6+5 = 1/36   = 216/7776  -> 5d6
    6+6+1 = 1/216  = 36/7776   -> 6d6+1
    6+6+2 = 1/216  = 36/7776   -> 6d6+2
    6+6+3 = 1/216  = 36/7776   -> 7d6
    6+6+4 = 1/216  = 36/7776   -> 7d6
    6+6+5 = 1/216  = 36/7776   -> 8d6
  6+6+6+1 = 1/1296 = 6/7776    -> 9d6+1
  6+6+6+2 = 1/1296 = 6/7776    -> 9d6+2
  6+6+6+3 = 1/1296 = 6/7776    -> 10d6
  6+6+6+4 = 1/1296 = 6/7776    -> 10d6
  6+6+6+5 = 1/1296 = 6/7776    -> 11d6
6+6+6+6+1 = 1/7776 = 1/7776    -> 12d6+1
6+6+6+6+2 = 1/7776 = 1/7776    -> 12d6+2
6+6+6+6+3 = 1/7776 = 1/7776    -> 13d6
6+6+6+6+4 = 1/7776 = 1/7776    -> 13d6
6+6+6+6+5 = 1/7776 = 1/7776    -> 14d6
6+6+6+6+6 = 1/7776 = 1/7776    -> 15d+1
And 4d6:
Code:
      1 = 1/6    = 216/1296 -> 1
      2 = 1/6    = 216/1296 -> 2
      3 = 1/6    = 216/1296 -> 1d6
      4 = 1/6    = 216/1296 -> 1d6
      5 = 1/6    = 216/1296 -> 2d6
    6+1 = 1/36   = 36/1296  -> 3d6+1
    6+2 = 1/36   = 36/1296  -> 3d6+2
    6+3 = 1/36   = 36/1296  -> 4d6
    6+4 = 1/36   = 36/1296  -> 4d6
    6+5 = 1/36   = 36/1296  -> 5d6
  6+6+1 = 1/216  = 6/1296   -> 6d6+1
  6+6+2 = 1/216  = 6/1296   -> 6d6+2
  6+6+3 = 1/216  = 6/1296   -> 7d6
  6+6+4 = 1/216  = 6/1296   -> 7d6
  6+6+5 = 1/216  = 6/1296   -> 8d6
6+6+6+1 = 1/1296 = 1/1296   -> 9d6+1
6+6+6+2 = 1/1296 = 1/1296   -> 9d6+2
6+6+6+3 = 1/1296 = 1/1296   -> 10d6
6+6+6+4 = 1/1296 = 1/1296   -> 10d6
6+6+6+5 = 1/1296 = 1/1296   -> 11d6
6+6+6+6 = 1/1296 = 1/1296   -> 12d6+1
And 3d6 (which is probably the smallest number you'd want to go to if you want to be semi-accurate).
Code:
    1 = 1/6   = 36/216 -> 1
    2 = 1/6   = 36/216 -> 2
    3 = 1/6   = 36/216 -> 1d6
    4 = 1/6   = 36/216 -> 1d6
    5 = 1/6   = 36/216 -> 2d6
  6+1 = 1/36  = 6/216  -> 3d6+1
  6+2 = 1/36  = 6/216  -> 3d6+2
  6+3 = 1/36  = 6/216  -> 4d6
  6+4 = 1/36  = 6/216  -> 4d6
  6+5 = 1/36  = 6/216  -> 5d6
6+6+1 = 1/216 = 1/216  -> 6d6+1
6+6+2 = 1/216 = 1/216  -> 6d6+2
6+6+3 = 1/216 = 1/216  -> 7d6
6+6+4 = 1/216 = 1/216  -> 7d6
6+6+5 = 1/216 = 1/216  -> 8d6
6+6+6 = 1/216 = 1/216  -> 9d6+1
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.

Last edited by ericbsmith; 07-13-2018 at 12:33 PM.
ericbsmith is offline   Reply With Quote
Old 07-13-2018, 01:28 AM   #3
scc
 
Join Date: Mar 2013
Default Re: Math Problem and GURPS CYBERPUNK

How can the language handle determining what the result is without if/then? Without that no logic can be applied to solve this problem.
scc is offline   Reply With Quote
Old 07-13-2018, 01:57 AM   #4
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Math Problem and GURPS CYBERPUNK

Quote:
Originally Posted by scc View Post
How can the language handle determining what the result is without if/then? Without that no logic can be applied to solve this problem.
My guess is that it's some sort of a die roller app where you can roll an n-sided die and assign a different result to each facing of the die, with that being about the maximum extent of it's parsing capabilities.
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.
ericbsmith is offline   Reply With Quote
Old 07-13-2018, 07:04 AM   #5
hal
 
Join Date: Aug 2004
Location: Buffalo, New York
Default Re: Math Problem and GURPS CYBERPUNK

Quote:
Originally Posted by ericbsmith View Post
My guess is that it's some sort of a die roller app where you can roll an n-sided die and assign a different result to each facing of the die, with that being about the maximum extent of it's parsing capabilities.
Exactly correct - a die rolling app that lets you construct tables ahead of time, and assign a specific result to each possibility of a die roll.

So, for example, if I were to try and construct that table, using 1/46656 as possible results, I'd be rolling 1d46656 - and on a roll of a 1, get a given result, on a roll of a 2 get a different result, etc.

Now, something that has a 1 in 6 chance of success normally - would need to be factored in terms of 46656, which would be 7776. I would need to set it up such that for results of say, 7777 to 15553 would get one of the more likely results (ie, that 1 in 6 chance result).

So it largely looks like I will have to construct the odds table much like ericbsmith constructed (nicely done by the by!) and then factor things out such that they are all in terms of the lowest common denominator. Doable, but largely by grunt work rather than some magic formula. *rueful grin*

Thanks guys, I really appreciate you weighing in on this.

For what it is worth - the actual app is Fantasy Grounds. One of the problems with allowing any kind of pseudo programming logic in a Virtual Table Top application, is the fact that if the programmers aren't careful, the user of their application can set up what is known as an infinite loop situation with if/then or do while loops. The people designing Fantasy Grounds are actively soliciting "Wish list" ideas or functionalities for their application - but that takes time, and ultimately, money (Make any application significantly better than it once was, and sooner or later you have to force the customer to pay for an upgrade to support all of the time you spent programming!)

The trick is - to work within the limitations and enjoy what is possible.

For instance - suppose I wanted to run a sandbox functionality for a GURPS CYBERPUNK campaign. Further suppose, I wanted to be able to generate a random "Node" for a net runner to be able to grab a Cyberdeck, load up some cyberdeck software, and jump directly into the net?

How many people who own GURPS CYBERPUNK, have ever actually RUN such a campaign? As it turns out, with Fantasy Grounds - that is indeed possible and has been done with both the original GURPS CYBERPUNK netrunning rules, and the PYRAMID version of the net running rules. The original rules set was less ambiguous than the Pyramid version - but it was possible.

The trick? Since FG has limited space for either of Skills or Spells (was never designed for use with GURPS CYBERPUNK per se - the trick was to treat each deck program as a spell. Then, when the player uses a single program, he uses it at full skill. If he uses two of them at the same time, the player accepts a skill penalty (that shows up in the die rolling) when rolling against both programs at the same time (ie roll for the first program with the modifier, roll for the second program with the modifier, and compare the results against the GM's hidden die roll.)

In other words, all of this is done as easily as clicking on a button in either the player's interface on his own personal computer at home, and the GM's clicking on a button on his computer - etc.

My next trick for the random Node creation, would be to set up some standard "Defenses" for computers depending upon their security node value (there being public, normal, and secure) as well as the complexity value of a given computer type. So if I create 6 standard defenses, each involving 8 complexity types (from say, 2 on up to 9 - I'd have essentially 24 tables to roll against - each with 6 possibile standard defenses.

BOOM - no die rolling at the table and spending the next half hour constructing a random node. Roll against ONE set up, which determines ALL aspects of a node with but a single press of a single button. Then, I'd simply roll against an NPC with the standard defenses written in as "spells" (treated as ICE programs) and the player sees at most, a minute's lag time while the GM sets up everything he needs to know about this "random" node.

All that remains would be the "imagery" of the actual net run itself. So, if the Environmental module is set for a 1940's Gangster environment. The watchdog would be a little bitty dog for a skill 12 Watchdog program, or a MASSIVE Rotwiller (Sp?) for a skill 18 version. If we're talking about some nasty anti-intruder type of program, it might have an 18" tall version of that monster for a low skill one, or a towering Wilt Chamberlin type for a skill 16 version - etc.

The trick is - to preserve the free will for the player to go where he wants, when he wants, as he wants - and FG could handle that if the GM preps ahead of time.

So, while I might have a single table that determines how many comm lines there are for any given node - which is recursive in the original tables, I can't do that with the FG tables. If on the other hand, my recursive seeming table generated ahead of time has say, 100 elements (much like a table rolling against 1d100) - then I can create said table, and roll 1d 46656 and have it generate a number between 1 to 46656 and presto, done.

Again, thanks guys. :)
hal is online now   Reply With Quote
Old 07-13-2018, 07:28 AM   #6
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Math Problem and GURPS CYBERPUNK

Quote:
Originally Posted by hal View Post
So it largely looks like I will have to construct the odds table much like ericbsmith constructed (nicely done by the by!) and then factor things out such that they are all in terms of the lowest common denominator. Doable, but largely by grunt work rather than some magic formula. *rueful grin*
Spreadsheets man. That's how I pumped out the results that I gave you in ten minutes instead of three hours. You could probably write a computer script to do it as well, but I like spreadsheets because you can see what's going on and tweak it until I get the output I want.
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.
ericbsmith is offline   Reply With Quote
Old 07-13-2018, 08:30 AM   #7
hal
 
Join Date: Aug 2004
Location: Buffalo, New York
Default Re: Math Problem and GURPS CYBERPUNK

Quote:
Originally Posted by ericbsmith View Post
Spreadsheets man. That's how I pumped out the results that I gave you in ten minutes instead of three hours. You could probably write a computer script to do it as well, but I like spreadsheets because you can see what's going on and tweak it until I get the output I want.
What is even more useful about spreadsheets? If I can get the table set up in Excel the way I want it to be in FG, I can use a utility someone designed (a script) that allows me to copy and paste the information into FG in the blink of an eye.

Eventually, if I finish the project any time soon, I'll list the results here in case anyone else ever wishes to do the same for a GURPS CYBEPRUNK run in FG or even perhaps D20 (I don't know how that works, and hope that it might be similar to FG).

Hmm, I might even try to copy and paste what you did into a spreadsheet and then start to assign values based on that.
hal is online now   Reply With Quote
Old 07-13-2018, 09:14 PM   #8
whswhs
 
Join Date: Jun 2005
Location: Lawrence, KS
Default Re: Math Problem and GURPS CYBERPUNK

Forgive me for going all "pure math" on you, but I feel like you guys have done this the hard way.

Here's how I would do it. First, I note that every possible series of rolls ends in a 1, 2, 3, 4, or 5; if you get a 6 you don't stop rolling. So there are five possible ends, and their mean value is (1+2+3+4+5)/5 = 15/5 =3.

Now, 5/6 of the time, that's all you get. But 1/6 of the time you get to add 3d6. And 1/36 of the time you get to add another 3d6, and 1/216 of the time you get to add ANOTHER 3d6, and so on. The expected value of 3d6 is 10.5. And you multiply that by 1/6 + 1/36 +1/216 + ..., which is a simple geometric infinite series, whose sum is (first term)/(1 - ratio) = (1/6)/(1 - 1/6) = (1/6)/(5/6) = 1/5. So the exploding dice add up to an expected 10.5/5 = 2.1. That gives you a sum of 3 + 2.1 = 5.1.

That's an exact result, not an estimate from a simulation; it includes the summed effect of every possible outcome. A lot of "exploding dice" procedures turn out to have such neat results, once you define the underlying recursive process as an infinite series. Of course if you're more comfortable with spreadsheets, they'll give you a close approximation, but I like to do the actual computation if I can; I feel like I understand it better. And I think it took me less about the same 10 minutes, but that included typing this comment, which is where I worked out the actual numerical result for the series. So I suppose really it's about equally hard either way. . . .
__________________
Bill Stoddard

I don't think we're in Oz any more.

Last edited by whswhs; 07-13-2018 at 09:25 PM.
whswhs is offline   Reply With Quote
Old 07-13-2018, 11:22 PM   #9
ericbsmith
 
ericbsmith's Avatar
 
Join Date: Aug 2004
Location: Binghamton, NY, USA. Near the river Styx in the 5th Circle.
Default Re: Math Problem and GURPS CYBERPUNK

Quote:
Originally Posted by whswhs View Post
Forgive me for going all "pure math" on you, but I feel like you guys have done this the hard way.

<SNIP>

That gives you a sum of 3 + 2.1 = 5.1.
OK Bill, you've calculated the mean - the average - value. However I think you missed what the problem he was trying to solve was. He doesn't need to know what the mean value is, he needs to know what the probability of rolling any given result is so he can simulate the roll using a programming language that doesn't allow recursive loops, if then, or other useful features.

In fact, it looks like the only feature it really has is that it can roll an n-sided die and then you can assign any outcome you want to each face of the die. Knowing that the average is 5.1 does bupkis for telling us what the likelihood of rolling 6+6+6+4 is, or 6+6+2, or any other result that is possible for that matter. Or how to pull that result out of an arbitrarily large n-sided die.
__________________
Eric B. Smith GURPS Data File Coordinator
GURPSLand
I shall pull the pin from this healing grenade and...
Kaboom-baya.

Last edited by ericbsmith; 07-13-2018 at 11:39 PM.
ericbsmith is offline   Reply With Quote
Old 07-13-2018, 11:37 PM   #10
scc
 
Join Date: Mar 2013
Default Re: Math Problem and GURPS CYBERPUNK

I'd say you best bet might be to throw five dice, with instructions to players to ignore all but the first unless the first is a six. In case the first is a 6, sum the next three and then have the final die roll on the same table as the first (Or is that not possible?). If the final die is a six either use the result of the highest in the middle or is there an option to re-roll?
scc is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Fnords are Off
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:50 AM.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2024, vBulletin Solutions, Inc.