←back to thread

362 points misonic | 3 comments | | HN request time: 0.539s | source
1. hi_hi ◴[] No.42475626[source]
I feel very dumb. There is an example on that page with 4 nodes (a,b,c,d) and it shows a total of 24 possible combinations.

What is the generalised formula for calculating this, given the number of nodes but also edges need to be considered.

It doesn't appear to be explained in the article. I think it may be a factorial?

replies(2): >>42479890 #>>42489842 #
2. throwameme ◴[] No.42479890[source]
i think one could use a binomial coefficient to do this or nested binomials

like (n choose 4)

maybe multiply the binomial by 2 because each edge can be present or absence in vertices

3. TrueDuality ◴[] No.42489842[source]
Combinatorial can be quickly calculated primarily using factorials. 4 possible options, each where you're picking all 4 exactly once is 4!. The reasoning is pretty intuitive, when you start selecting there are four options, when you go to pick the next one there are 3 left in the pool, then 2, and finally 1. This turns into 4 * 3 * 2 * 1 = 24.

This site seems to have a pretty good overview of them if you'd like to become more familiar: https://www.geeksforgeeks.org/mathematics-combinatorics-basi...