How many different ways can I choose ? elements out of ??

tim.allan.london

New member
Joined
Apr 24, 2020
Messages
4
I am trying to calculate the possible configurations of k pixels ON in an array of m pixels.

Can anyone help me find a way to approach this question?
 
Have you heard of combinations? See here:


"n choose r" is also called the binomial coefficient, and is written in various ways, including [MATH]_nC_r[/MATH].
 
I am trying to calculate the possible configurations of k pixels ON in an array of m pixels.
Can anyone help me find a way to approach this question?
One of the best ways ti understand this is to experiment with the concept.
Luckily there is a free online utility for this.
Suppose that we want to choose (select, use, turn-on ,etc) 18 of 100 pixels: SEE HERE
The answer is
30664510802988208300
.
Using that web-utility one can change the numbers to explore different number combinations.
But to answer your question:
N choose K is \(\dbinom{N}{K}=\dfrac{N!}{K!(N-K)!} \)
 
One of the best ways ti understand this is to experiment with the concept.
Luckily there is a free online utility for this.
Suppose that we want to choose (select, use, turn-on ,etc) 18 of 100 pixels: SEE HERE
The answer is
30664510802988208300
.
Using that web-utility one can change the numbers to explore different number combinations.
But to answer your question:
N choose K is \(\dbinom{N}{K}=\dfrac{N!}{K!(N-K)!} \)

Thanks pka - that's such a handy tool! I've looked at Wolfram before and it seems to be a wonderful resource. And the formula:

N choose K is \(\dbinom{N}{K}=\dfrac{N!}{K!(N-K)!} \) is enough easy enough to plug into a Python script, along with some code to calculate factorials.
 
Last edited:
Have you heard of combinations? See here:


"n choose r" is also called the binomial coefficient, and is written in various ways, including [MATH]_nC_r[/MATH].

Thank you to Dr.Petrson - your link to Combinations and Permutations was just what I needed to understand my question and the answers given!
 
Top