Picking pairs of objects from a list of 6

  • Thread starter Thread starter jimmycricket
  • Start date Start date
  • Tags Tags
    List
Click For Summary
To find all unique sets of three pairs from the list (a, b, c, d, e, f), a systematic approach is needed. The discussion initially focused on generating all possible pairings of two letters, which can be achieved through nested loops that iterate through the list. However, the main inquiry shifted to creating combinations of three unique pairs, requiring a method to ensure that no elements are repeated across pairs. This can be accomplished by using combinations to select pairs and then filtering those combinations to ensure uniqueness. The final goal is to generate sets like ((a,b),(c,d),(e,f)) and ((a,c),(b,e),(d,f)), ensuring all pairs are distinct within each set.
jimmycricket
Messages
115
Reaction score
2
Given a list (a,b,c,d,e,f) What method can I use to quickly find all 15 pairings of two letters. I can do it without using a specific decision procedure throughout but sometimes combinations get repeated and its hard to check quickly which ones have already been. Essentially I would like an algorithm to find every combination of pairs in a set of arbitrary length/
 
Mathematics news on Phys.org
jimmycricket said:
Given a list (a,b,c,d,e,f) What method can I use to quickly find all 15 pairings of two letters. I can do it without using a specific decision procedure throughout but sometimes combinations get repeated and its hard to check quickly which ones have already been. Essentially I would like an algorithm to find every combination of pairs in a set of arbitrary length/

Loop from x = 1 to N-1

[ Loop from y= x+1 to N

pair = list[x], list [y] ]
 
i don't follow that. Please note I don't know programming i need a more wordy answer please
 
jimmycricket said:
i don't follow that. Please note I don't know programming i need a more wordy answer please

list (1..N) => list = (a, b, c, d, e, f); N = number of members in the list; in this case, N = 6

The loops above, look like:

x=1, y = 2, 3, 4, 5, 6: pairs = (a,b), (a,c), (a,d), (a,e), (a,f)
x=2, y = 3, 4, 5, 6: pairs = (b, c), (b,d), (b,e), (b,f)
x=3, y = 4, 5, 6: pairs = (c,d), (c,e), (c,f)
x=4, y=5, 6,: pairs = (d,e), (d,f)
x=5, y = 6: pairs = (e,f)
 
I've just realized i have not asked the question i meant to ask sorry. What I meant was the find all the sets consisting of 3 uniques pairs from (a,b,c,d,e,f) so e.g. one will be
((a,b),(c,d),(e,f)) and another would be ((a,c),(b,e),(d,f))
 
Here is a little puzzle from the book 100 Geometric Games by Pierre Berloquin. The side of a small square is one meter long and the side of a larger square one and a half meters long. One vertex of the large square is at the center of the small square. The side of the large square cuts two sides of the small square into one- third parts and two-thirds parts. What is the area where the squares overlap?

Similar threads

  • · Replies 35 ·
2
Replies
35
Views
7K
  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
2K
  • · Replies 54 ·
2
Replies
54
Views
6K
  • · Replies 65 ·
3
Replies
65
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
8
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 44 ·
2
Replies
44
Views
5K