I'm trying to figure out how many times my computer will have to loop through an array. I'm building a logic calculator so it's checking contradictions. If there are four sentences, a b c d, then one has to check the following combinations to see if there is a contradiction(adsbygoogle = window.adsbygoogle || []).push({});

ab

ac

ad

bc

bd

cd

The equation seems to be, let n = the number of sentences:

(n - 1) + (n - 2) + (n - 3)

But that's not a good equation because it does not inform us how many things to add together.

If there are six sentences then the equation would be

(n - 1) + (n - 2) + (n - 3) + (n - 4) + (n - 5)

There has to be a better way to write that equation.

**Physics Forums - The Fusion of Science and Community**

# Does this equation have a name?

Know someone interested in this topic? Share a link to this question via email,
Google+,
Twitter, or
Facebook

Have something to add?

- Similar discussions for: Does this equation have a name?

Loading...

**Physics Forums - The Fusion of Science and Community**