Does this equation have a name?

  • Thread starter Thread starter gamow99
  • Start date Start date
AI Thread Summary
The discussion centers on determining the number of unique combinations of sentences to check for contradictions in a logic calculator. The initial equation proposed, (n - 1) + (n - 2) + (n - 3), is deemed insufficient for accurately calculating combinations. The concept of "n choose k" is introduced, leading to the formula for combinations, which simplifies to n(n-1)/2 for choosing 2 items from n. This approach ensures that combinations are not repeated, optimizing the efficiency of the logic calculator. The conversation highlights the importance of using combinatorial mathematics to streamline the evaluation process.
gamow99
Messages
71
Reaction score
2
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

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.
 
Mathematics news on Phys.org
In probability, it looks like it would be written as 4 choose 2, meaning that you have 4 sentences and choose 2 of them. The equation gives the number of unique results (ab is the same as ba). Google "Combination".
 
Hey, computer scientist here. Cool project you're working on. I stumbled across this pattern while messing around with tabular K-map simplification (boolean logic):

You have 4 variables (but this can be generalized to n variables) and are trying to find the total number of associative expressions such that AB = BA. (Looping through for A AND B as well as B AND A would be inefficient)

This problem is analogous to finding the number of lines between a given number of points (see below). The formula is
$$
\frac{n^2-n}{2}
$$

Send me a PM: I'd like to take a closer look at your logic calculator.

attachment.php?attachmentid=72797&stc=1&d=1410029342.png


attachment.php?attachmentid=72798&stc=1&d=1410029342.png

*plus sign changed to minus sign as per jz92's post
 

Attachments

  • 3case.png
    3case.png
    2.9 KB · Views: 567
  • 4case.png
    4case.png
    4.2 KB · Views: 528
Last edited:
The general equation for evaluating the number of unique combinations when you select k items from a set of n items is:

$$
\frac{n!}{(n-k)!*k!}
$$

n choose 2 is
$$
\frac{n!}{(n-2)!*2!}
$$
Simplified, it is:
$$
\frac{n^2-n}{2}
$$

Comparing each combination of 2, where there are 4 sentences, comes out to a total of (16-4)/2, or 6 comparisons. This, of course, requires that the loops are set up in a way that you never test the same combination twice.
 
Last edited:
Suppose ,instead of the usual x,y coordinate system with an I basis vector along the x -axis and a corresponding j basis vector along the y-axis we instead have a different pair of basis vectors ,call them e and f along their respective axes. I have seen that this is an important subject in maths My question is what physical applications does such a model apply to? I am asking here because I have devoted quite a lot of time in the past to understanding convectors and the dual...
Thread 'Imaginary Pythagorus'
I posted this in the Lame Math thread, but it's got me thinking. Is there any validity to this? Or is it really just a mathematical trick? Naively, I see that i2 + plus 12 does equal zero2. But does this have a meaning? I know one can treat the imaginary number line as just another axis like the reals, but does that mean this does represent a triangle in the complex plane with a hypotenuse of length zero? Ibix offered a rendering of the diagram using what I assume is matrix* notation...
Back
Top