Picking pairs of objects from a list of 6

  • Thread starter jimmycricket
  • Start date
  • Tags
    List
In summary, to find all 15 pairings of two letters from a list of arbitrary length, you can use a loop from x = 1 to N-1 and a nested loop from y = x+1 to N, where N is the number of members in the list. This will generate all possible combinations of pairs. To find all sets consisting of 3 unique pairs from the list, you can use a similar loop structure, but with a limit of N-2 for the outer loop and N-1 for the inner loop. This will generate all possible combinations of three pairs from the list.
  • #1
jimmycricket
116
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
  • #2
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] ]
 
  • #3
i don't follow that. Please note I don't know programming i need a more wordy answer please
 
  • #4
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)
 
  • #5
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))
 

FAQ: Picking pairs of objects from a list of 6

How many ways can you pick pairs of objects from a list of 6?

There are 15 ways to pick pairs of objects from a list of 6. This can be calculated using the combination formula nCr = n!/(r!(n-r)!), where n is the total number of objects and r is the number of objects being chosen at a time. In this case, n = 6 and r = 2, so the formula becomes 6C2 = 6!/(2!(6-2)!) = 15.

What is the probability of picking two specific objects from a list of 6?

The probability of picking two specific objects from a list of 6 depends on the total number of objects in the list and the number of objects being chosen at a time. In this case, the probability can be calculated using the formula P = (1/n)(1/(n-1)), where n is the total number of objects. So for a list of 6 objects, the probability would be (1/6)(1/5) = 1/30.

Can you pick more than two objects at a time from a list of 6?

Yes, you can pick more than two objects at a time from a list of 6. The number of objects that can be chosen at a time is called the sample size. In this case, the sample size is 2, but it can be increased or decreased depending on the specific scenario.

How does the number of objects in the list affect the number of possible pairs?

The number of objects in the list directly affects the number of possible pairs that can be chosen. The larger the number of objects, the more possible combinations there are. For example, if the list had 10 objects instead of 6, there would be 45 possible pairs instead of 15.

What is the difference between picking pairs with and without replacement?

Picking pairs with replacement means that an object can be chosen more than once, while picking pairs without replacement means that an object can only be chosen once. In the case of picking pairs from a list of 6 objects, the number of possible pairs with replacement would be 36, while the number of possible pairs without replacement would be 15.

Back
Top