Message Boards Message Boards

0
|
12817 Views
|
5 Replies
|
5 Total Likes
View groups...
Share
Share this post:

How to make a list of the possible pairs of 4 objects from a set of 6?

Example: set of 6 objects =( a, b, c, d, e, f)
2 possible pair coming from 4 objects from the set: ab, ec .
No repetitions allowed.
ab and ba have to be considered as different pairs

Thanks in advance!
regards
lorenzo

POSTED BY: Lorenzo Galante
5 Replies
POSTED BY: Henrik Schachner

Thankyou Henrik. But I expected only 360 pairs. Your computation gives me too many pairs. bye lorenzo

POSTED BY: Lorenzo Galante

Hi Lorenzo,

my code gives exactly 180 pairs (of pairs)! That is because e.g. {{a,b},{c,d}} and {{c,d},{a,b}} are considered identical - in contrast to Davids solution. It depends on what you want.

Cheers Henrik

POSTED BY: Henrik Schachner

Thanks a lot! regards lorenzo

POSTED BY: Lorenzo Galante
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract