Math problem

Recommended Videos

Wickedshot

New member
Jul 11, 2006
45
0
0
I was thinking about a system of character customization that would allow for a lot of options but also make each option comparable, and allow for character development and a level of simplicity involving small numbers. The reasons behind wanting such a system are complex and not the issue of this thread.

What I came up with was using 6 fairly typical different attributes:
Strength (STR)
Dexterity (DEX)
Constitution (CON)
Willpower (WIL)
Intelligence (INT)
Charisma (CHA)
on a scale of 1 to 10.

Then I wanted to have them all start at 5, so:
STR5 DEX5 CON5 WIL5 INT5 CHA5
and then allow people to train up a skill someway to increase it by 1 while allowing another skill to decrease by 1, so for instance you could train your Willpower up and set your Intelligence as least important and after your training end up with:
STR5 DEX5 CON5 WIL6 INT4 CHA5
(this system is similar to Ultima Onlines stat system but with a hard lower limit that matches the higher limit)

Now, in this system 1 more point of WIL would be made to have comparable value to 1 more point of INT, and same for any attribute comparisons, which ideally would allow for many interesting combinations. How each of these attributes could be made to have interesting ingame effects and consequences is something I've put a fair bit of thought into and is very interesting in and of itself, and presents the problem of how these attributes could be made balanced with one another. But the balancing of the attributes is not the math problem which caused me to post after a night of pondering.

The problem I'm seeking a solution to is how many different options are there? Of secondary importance is if there is a nice tidy formula for the answer and if so what is it?

It's simple to show the max it can be, there are certainly no more than 1 million, since each of the six attributes has at most 10 choices, and 10 to the power of 6 is 1 million. But with the restriction that they all start at 5 and increasing one also decreases another it removes a lot of the million choices.

The simplest way to present the restriction is that the attributes must add to 30 and each attribute is between 1 and 10.

And there's definitely atleast 2100 choices, since you can ignore 3 attributes to allow them to compensate for whatever you do with the other 3 you pay attention to, and allow the 3 attributes you pay attention to to range from 1 to 10, 1 to 10, and 1 to 7, 700 choices, in 3 different ways (3 possibilities of which one you make the max of 7), making 2100. There are certainly more than 2100 though, since each of these 2100 choices gives varying wiggle room for the ignored 3 attributes.

The brute force method using a program would be to just output the 1 million options and remove any where the 6 attributes don't add to exactly 30. Not very neat but it'd get the job done.

Another brute force method would be to start each attributes at 1 and then distribute 24 points amoung them (similar to point-buy in DnD), of which there are 6 to the power of 24 possible ways. Needless to say this number is much larger than 1 million since it ignores the max of 10 for any given attribute, I mention it only since the concept could be useful in a tidy formula. But after you had this giant number you could remove any choices where any attribute exceeds 10.

Anyways, I'm interested to read anyones thoughts on a the answer (or a smaller lower and upper limit than 2100 and 1,000,000 respectively) or a tidy formula that gives the answer (or barring a formula, any work done towards a formula).
 

Aries_Split

New member
May 12, 2008
2,097
0
0
fish food carl said:
No. Stop it."Hooray!" Cry the badge needers, "we have found something to get replies!"

First it was controversial topics, then religion and now mathematics. Just stop. Please.
What? I actually like this idea, but I have no idea what your talking about carl.

As for the OP, I like how the system counterbalances itself, such as one point of constitution would decrease dexterity by one point, because it increases the size of your body. The same with charisma and then willpower.
 

Wickedshot

New member
Jul 11, 2006
45
0
0
fullmetalangel said:
i haven't read all of what you said but you know, this already exists more or less... it's called the D20 system >____>
I am very familiar with the D20 system and I'm guessing that's reflected in the bulk of the names chosen for the attributes and even the number of attributes (other influences are Elder Scrolls and Ultima series), the restrictions on the attributes in relation to each other and how that decides the number of options is what interests me. The reasons I'd like such a system and the precise details, while also interesting to me, are not the purpose of this thread heh.

Edit Added:
For a ballpark figure, I'm guessing there's around 30 thousand possibilities, given that out of the 1 million choices (without the add-to-30 restriction) there are likely 2 out of 60 where the attributes add to 30 (since the distribution is like a bell curve and 30 being in the middle around doubles the number of groups of 6 attributes that add to it).
 

Saskwach

New member
Nov 4, 2007
2,321
0
0
I'd love to help, but I only crack open my old maths textbooks in cases of dire emergency - when I'm studying. And make no mistake: this question would require either a) a good mathematician to whom probability is no longer even a skill, but a habit, or b) an average mathematician with a textbook in front of him.
 

Wickedshot

New member
Jul 11, 2006
45
0
0
Saskwach said:
I'd love to help, but I only crack open my old maths textbooks in cases of dire emergency - when I'm studying. And make no mistake: this question would require either a) a good mathematician to whom probability is no longer even a skill, but a habit, or b) an average mathematician with a textbook in front of him.
I certainly appreciate that you understand what I'm asking for and the point of my thread, sincere thanks.

To add to your list, c) a non-lazy programmer who's willing to make a short program to find the answer through a brute force method. I'm almost that, except I am lazy.
 
Feb 13, 2008
19,429
0
0
fish food carl said:
The idea is OK, but there has been a spate of mathematics problems recently and I think people should find something new to post about, or do a forum search. I meant no offence to the OP, but it would seem that math related puzzles are the new popular topic.
C'mon Carl, it's a treat for us math spods. How many times has "Religion is Bad", "Best Quotes Ever" or "This Game Sux" been repeated?

I know the innumerate can't really join in, but I can't really join in on the PS2/3 conversations. Let us be nerds in peace. :)
 
Feb 13, 2008
19,429
0
0
fullmetalangel said:
Yeah I figured, but I'm almost certain there is already a D20 variant very much like this (as far as I know what you're talking about, which seems to be, adding a point somewhere detracts from something else in a logical manner). I'll see if I can find it.
Method V in character creation I believe.
 

qbert4ever

New member
Dec 14, 2007
798
0
0
Let's see here. *mutters to self* ten times six, plus ten, to the power of te... no, six, plus probability, times itself, divided by the number of salmon that swim upstream in three different rivers, plus the speed of sound.....

Screw it. I don't have enough paper for this. I'm going to watch some porn. You're on your own.
 

Geoffrey42

New member
Aug 22, 2006
862
0
0
With the assumption that '0' would never be a valid value for any of the character stats, I get ~217 (+-5) possible combinations of integers between 1-10 where 6 of them add to 30. So, the tricky part. Typically, if we have 6 things, the possible permutations would be 6!. But, in this case, the balanced case (5,5,5,5,5,5) should not count 6! times, because it only happens once. So, what's the rule here? What's the formula to know how many permutations there are of the (9,9,5,5,2,2) case versus the (10,8,6,3,2,1) case?

Note that what I did assumes that +1 to one attribute does not always result in -1 to the same attribute (not pure dichotomies), as you seemed to be implying that there would be a priority system as to where points came from when you built them up for something else.
 
Feb 13, 2008
19,429
0
0
As for the problem (6 stats with 1-10 totalling 30), I'd think the best way of doing it would be to work out the standard deviation of the set and then find out how many elements hit the mean of 30.

Lot harder than it looks at first...

Ok, Fibonacci sequence should hold, so..

If the stats were 6 points, 1 combination. 7 points would be 6 combinations. 8 points would be (3/1/1/1/1/1(6), 2/2/1/1/1/1(5+4+3+2+1)) ) 21 combinations...(seems to be following a set order)
9 points would be (4/1/1/1/1/1(6), 3/2/1/1/1/1(10+8+6+4+2) 2/2/2/1/1/1 (19)= 55
10 points would be (5/1/1/1/1/1(6), 4/2 (30) 3/3(15) 3/2/2(57)) = 108

And I'm sure you can work it out from there. :)
 

sawyer776

New member
Nov 2, 2008
4
0
0
Basically, my work finds the probability that the sum of six random numbers on the interval 1-10 sums to 30, then multiplies it by the number of possible combinations of those six random numbers to find the total number of combinations which sum to 30.

X= uniformly distributed random variable, interval 1-10, integers only
Mean(X) = 5.5
SD(X) = 2.9

Y = the sum of 6 X random variables, independent
Mean(Y) = 6*Mean(X) = 33
SD(Y) = sqrrt(6)*SD(X) = 7.04

P(Y=30) = normalcdf((29.5-Mean(Y))/SD(Y), (30.5-Mean(Y))/SD(Y)) = .05

About 5% of all randomly generated sums of 6 uniformly distributed random variables on the interval 1-10 sum to 30

.05 * 10^6 = 51,740

Of course, this is an approximation, but a good approximation. Finding the exact number can only be done by brute force, a project which I don't have the patience for, and my calculator has neither the memory nor processor power for.
 

Wickedshot

New member
Jul 11, 2006
45
0
0
Geoffrey42, are you saying 6!*217=6*5*4*3*2*217=720*217=5040+7200+144000=156,240?
156,240 is more than i guessed but is within the range of 2100 and 1 million, interesting.

The_root_of_all_evil, my math is a bit rusty and I can't even remember what Fibonacci numbers are for heh. Could you clarify?

sawyer776, that's awesome work, my really rough estimate of 30,000 doesn't seem too bad now, 51,740 sounds like a good approximation

Good to see replies about the problem, thanks.

I'd like to sum up the problem more mathematically, just to clarify:
6 integer variables a,b,c,d,e,f, where 1<=a,b,c,d,e,f<=10 and a+b+c+d+e+f=30
 
Feb 13, 2008
19,429
0
0
Doh...sussed it, I think...

If 6 stats add up to 30, then work it using increasing number of stats = statx5 points.

1 stat would have 1 combination of 5.
2 stats would have 9 combinations to make 10.
3 stats would have (locking first dice)
Lock at 10, 4 combos
Lock at 9, 5 combos
8/6, 7/7, 6/8, 5/9, 4/10
3 only has 9 because you can't use 11 as a number. Same with 2/8 and 1/7.
So, 4+5+6+7+8+9+10+9+8+7 : 73 ways to make 3 stats = 15
Brute Force on 4 stats to gain 20 gives
64 combos on 10
81 combos on 9
....ack...this is going up exponentially...Hrrrm...back to the drawing board.

By the looks of it, we're heading towards 9^5-C, where C is the combinations that would require 10+. (59,049, which would tally with the rest of the numbers so far.)

Fibonacci sequence [http://en.wikipedia.org/wiki/Fibonacci_number] : Recurrence Relation except that it's bounded by a forced choice (1-10).
 

Wickedshot

New member
Jul 11, 2006
45
0
0
Ya, it's a fairly complicated problem, a lot of it seems like the solution is going to be nice and tidy, and then it starts breaking into several differently exponentiating (not a word? heh) problems.

About the +1/-1 mechanic and even the start at 5/5/5/5/5/5, that's more for how it'd play out in a game for changing attributes, and making a character average in every way to start, respectively. As to the underlying problem the +1/-1 mechanic is an example of a balanced change that respects the rules, and the 5/5/5/5/5/5 is just one example of a set of attributes that conforms to the example of what a proper possible combination is.
 
Feb 13, 2008
19,429
0
0
However, from an RP POV, you're going to have a bunch of average spods, because no-one in their right mind would risk a 10 stat unless they're a non-combatant.
 

Wickedshot

New member
Jul 11, 2006
45
0
0
Hard to say, would depend a lot on how things were done and people's preference. If anything my guess would be that most people would min-max their attributes and specialize. Like someone who likes mages would make a INT10, WIL10, DEX7 and rest 1's so they could move around quickly and blast heh.

I think it'd be a really interesting system, and would allow for around 50 thousand unique attribute setups. Though I think to properly discuss it would require a whole new thread and I'm more interested in the mathematical part of it at the moment since it has a clear identifiable solution somewhere that can be proven heh.
 
Feb 13, 2008
19,429
0
0
Well...your answer is going to be 9^5 - (all permutations that require 10+ in a stat), but as we're looking at level 13 of the Pascal Triangle for that...it'd need some serious computational crunching.

And seriously, try playing any RPG with a 1 in any stat, because with a STR 1, you're not going to be able to carry anything.
 

vede

New member
Dec 4, 2007
859
0
0
Ack! Since I didn't reinstall a hot copy of XP, I haven't reinstalled Microsoft Visual C++ Express Edition 2008 Extra-word Extra-word Extra-word Long-name!

I'm lazy, but not too lazy to write up a program to do this. However, I am too lazy to reinstall any of my compilers right now...
 

Anarchemitis

New member
Dec 23, 2007
9,100
0
0
...

This is why I get scared of the word "Stat" implied in a video game; some people fervently examine them like it was some branch of theoretical Arithmetic.[/hyperbole]