is this correct :
given 8 buttons, user can press 1 or 2 or...8
sum of
8 : 1
7 : 8
6 : 8*7*6*5*4*3
5 : 8*7*6*5*4
4 : 8*7*6*5
3 : 8 * 7 *6
2 : 8 *7
1 : 8
8842 ?
Printable View
is this correct :
given 8 buttons, user can press 1 or 2 or...8
sum of
8 : 1
7 : 8
6 : 8*7*6*5*4*3
5 : 8*7*6*5*4
4 : 8*7*6*5
3 : 8 * 7 *6
2 : 8 *7
1 : 8
8842 ?
You didn't really ask a complete question. You'll have to be clearer. For what it's worth,
1 + 8 + 8*7*6*5*4*3 + 8*7*6*5*4 + 8*7*6*5 + 8 * 7 *6 + 8 *7 + 8
= 28,969
yeah it's 28,969
Actually, it's 256
8 : 1
7 : 8
6 : (8 * 7) / 2 = 28
5 : (8 * 7 * 6) / (3 * 2) = 56
4 : (8 * 7 * 6 * 5) / (4 * 3 * 2) = 70
3 : (8 * 7 * 6) / (3 * 2) = 56
2 : (8 * 7) / 2 = 28
1 : 8
0 : 1
1 + 8 + 28 + 56 + 70 + 56 + 28 + 8 + 1 = 256
Ah! So perhaps they were asking how many ways a user can toggle up to 8 buttons. Using the binomial coefficients works, but it's needlessly overcomplicated. For each button, you can choose to toggle it or not. That gives 8 independent choices between 2 alternatives, so there are 2^8 = 256 outcomes. This reasoning generalizes to give the identity
sum_k=0^n of (n choose k) = 2^n
This is also the number of subsets of a set of size n.
I don't get post #4 where is the divs ( \ ) from ?
The division reflects the number of ways to choose the same set of buttons. Choosing button 1 with button 2 is the same as choosing button 2 with button 1. The product (8 * 7 for choosing two buttons) counts both options, so we must divide by 2 to find the total number of unique combinations. The equations I posted are partially reduced equations of the 'choose' function (n choose k), which jemidiah referenced. In fact, the entirety of my post is the sum (n = 8) in the identity he posted. I was not intentionally using binomial coefficients, rather I was showing the flaw in your original logic where you had left out the necessary division.
What I posted as
6 : (8 * 7) / 2 = 28
could also be shown as
6 : (8*7*6*5*4*3) / (6*5*4*3*2*1) = 28
which has as its numerator the product you gave in your original post. The denominator is 6! (six factorial).
order of press does not matter
buttons pressed : options
1 : 8
2 : buttons not pressed options : 6 : 8*7*6*5*4*3
3 : so on
4
5
6
7
8 : 1
it's like post 1 where is the overlap in the buttons pressed
There are 8*7/2 = 28 ways for 2 buttons to be pressed, not 8*7*6*5*4*3:
12; 13; 14; 15; 16; 17; 18
23; 24; 25; 26; 27; 28
34; 35; 36; 37; 38
45; 46; 47; 48
56; 57; 58
67; 68
78
[On a more interesting note, this ennumeration forms a triangle. Indeed, 28 is the 7th triangular number, T_n. Relevant identities: T_n = 1 + 2 + ... + n = n*(n+1)/2 = (n+1 choose 2).]