Picking pairs of objects from a list of 6

  • Context: Undergrad 
  • Thread starter Thread starter jimmycricket
  • Start date Start date
  • Tags Tags
    List
Click For Summary

Discussion Overview

The discussion revolves around finding combinations of pairs from a list of six letters (a, b, c, d, e, f). Participants explore methods to generate all possible pairings and later clarify the request for sets of unique pairs.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant seeks an algorithm to find all pairings of two letters from a list of six, noting difficulties with repeated combinations.
  • A proposed method involves looping through the list with indices to generate pairs, but the explanation is technical and assumes programming knowledge.
  • Another participant requests a more detailed, non-programming explanation of the pairing process.
  • A later post clarifies the original question, asking for sets of three unique pairs from the list, providing examples of such sets.

Areas of Agreement / Disagreement

Participants do not appear to agree on the method of explanation, as some require more detailed, non-technical descriptions while others provide programming-oriented solutions. The initial question about pairings evolves into a request for unique sets of pairs, indicating a shift in focus without consensus on the original method.

Contextual Notes

The discussion includes assumptions about programming knowledge and does not resolve the complexities of generating unique sets of pairs versus simple pairings.

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/
 
Physics 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))
 

Similar threads

Replies
35
Views
8K
  • · Replies 3 ·
Replies
3
Views
20K
  • · Replies 35 ·
2
Replies
35
Views
9K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
1K
Replies
7
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 54 ·
2
Replies
54
Views
6K