Combination without repetition

araujo.guntin

New member
Joined
Apr 20, 2022
Messages
2
Hi...

This is a real problem in my work.

I have 8 fields

FIELD_A,
FIELD_B,
FIELD_C,
FIELD_D,
FIELD_E,
FIELD_F,
FIELD_G,
FIELD_H

I need to combine 4 of them; how many combinations should I have?

For example:
(FIELD_A AND FIELD_B AND FIELD_C AND FIELD_C) //combination 1
(FIELD_B AND FIELD_C AND FIELD_C AND FIELD_D)//combination 2
...

I've tried the combination without repetition formula but it doesn't work for me.

C = !n/r!(n-r)!
n = 8
r = 4
then C = 840

It doesn't make sense to me. What I'm doing wrong?

I appreciate any help.

Thanks
 
Hi...

This is a real problem in my work.

I have 8 fields

FIELD_A,
FIELD_B,
FIELD_C,
FIELD_D,
FIELD_E,
FIELD_F,
FIELD_G,
FIELD_H

I need to combine 4 of them; how many combinations should I have?

For example:
(FIELD_A AND FIELD_B AND FIELD_C AND FIELD_C) //combination 1
(FIELD_B AND FIELD_C AND FIELD_C AND FIELD_D)//combination 2
...

I've tried the combination without repetition formula but it doesn't work for me.

C = !n/r!(n-r)!
n = 8
r = 4
then C = 840

It doesn't make sense to me. What I'm doing wrong?

I appreciate any help.

Thanks
You might want to try your calculation again. [math]{8 \choose 4}=70[/math]
 
Hi everyone,
Thanks BigBeachBanana... I got my error. You answered my question.
Thanks Dr. Peterson... I'm sorry, I made a mistake in the FIELD_C twice. So, the example should be
(FIELD_A AND FIELD_B AND FIELD_C AND FIELD_D) //combination 1
(FIELD_B AND FIELD_C AND FIELD_D AND FIELD_E)//combination 2

The problem I was facing is:
I have 8 fields of personal data, for example, first name, last name, email, Date of Birth, etc. then I need to find, through a SQL query, the records which combination of 4 is matching.
I need to take care of the performance of the query, then I like to know how many combinations would take.
Thanks,
everyone
 
Top