Not a fibonacci series

Dan Coutu coutu at snowy-owl.com
Wed Feb 25 21:03:44 EST 2004


Greg Rundlett wrote:

> If I have four options:
> a)
> b)
> c)
> d)
> and none are mutually exclusive, then there are 15 possible 
> combinations.  Assigning a value to each:
> a = 1, b=2, c=4, d=8, the unique combination can be assigned a code by 
> summing the values
> No. 	Combination
> 	Code
> 1
> 	a 	1
> 2
> 	b 	2
> 3
> 	c 	4
> 4
> 	d 	8
> 5
> 	a, b 	3
> 6
> 	a, c 	5
> 7
> 	a, d 	9
> 8
> 	b, c 	6
> 9
> 	b, d 	10
> 10
> 	c, d 	12
> 11
> 	a, b, c 	7
> 12
> 	a, b, d 	11
> 13
> 	a, c, d 	13
> 14
> 	b, c, d 	14
> 15
> 	a, b, c, d 	15
>
>
>
> What is this type of problem referred to?  I know it's not a fibonacci 
> series.  Anyone know of good examples of processing this info 
> programmatically?
>
> You may ask:  What the hell is a fibonacci series?  
> http://www.textism.com/bucket/fib.html
>
> Thanks,
> Greg

What you're talking about here is a combination problem. Generally 
permutations and combinations
are studied at the same time in Math courses. If I recall correctly the 
key difference is that
permutations see the position in a sequence as consequential. So a,c,d 
is not the same as
c,d,a.  In a combination, on the other hand, the order does not matter. 
So your example
above is clearly a combination.

A pointer to more detail on the math behind the scenes is:
http://engineering.uow.edu.au/Courses/Stats/File2417.html

Hope this helps!

Dan




More information about the gnhlug-discuss mailing list