List all pairs of permutations with repetition with the given conditions

Click For Summary

Homework Help Overview

The discussion revolves around finding pairs of sequences of natural numbers that satisfy specific summation conditions. The sequences are defined within the constraints of a set based on a constant K and a variable S, where the sequences must meet the criteria of equal sums and a combined total. The problem involves permutations and the efficiency of generating valid pairs.

Discussion Character

  • Exploratory, Assumption checking, Problem interpretation

Approaches and Questions Raised

  • Participants discuss the need for specific values of K and S to clarify the problem. There are inquiries about the range of S and whether a general formula for generating lists is feasible. Some participants express concerns about the efficiency of current methods for generating valid pairs of sequences.

Discussion Status

The conversation is ongoing, with participants exploring the implications of different values for K and S. There is a recognition of the challenges in generating lists efficiently, and some guidance has been offered regarding the need for clarity in notation and problem constraints.

Contextual Notes

There are discussions about the notation used for sequences, with some participants finding it confusing. The original poster has indicated a desire to generate lists for smaller values of S, suggesting that the problem may become computationally intensive for larger values.

Robin04
Messages
259
Reaction score
16
Homework Statement
List all pair of permutations with repetition with given condition, conditions are elaborated below
Relevant Equations
-
Let us consider two sequences:
$$n_k \in \Omega,\,k=1,2,...K,$$
$$m_k \in \Omega,\,k=1,2,...K,$$
where $$\Omega:=\{n\in\mathbb{N}|\,n\leq K\}.$$
Let us define
$$\sigma_n:=\sum_{k=1}^K k\, n_k,\,\sigma_m:=\sum_{k=1}^K k\,m_k$$
The task is to find all possible ##(n_k,\,m_k)## pairs such that
$$\sigma_n=\sigma_m$$
and
$$\sigma_n+\sigma_m=2S,$$
where ##S\in \mathbb{N}^+##

For example for ##K=2,S=1##, only one pair is possible:
$$n_k=1,0$$
$$m_k=1,0$$
For ##K=2,S=2##:
First pair:
$$n_k=2, 0$$
$$m_k=2,0$$
Second pair:
$$n_k=2, 0$$
$$m_k=0,1$$
Third pair:
$$n_k=0,1$$
$$m_k=2,0$$
Fourth pair:
$$n_k=0,1$$
$$m_k=0,1$$

So far, I have only written a program that lists all possible sequences from ##\Omega##, and than checks each one against the other if they match the given conditions. It is really slow, and I wonder whether it is possible to list them more efficiently.
 
Physics news on Phys.org
Shouldn't the problem statement specify values for K and S? Otherwise, how do you know what list to make?
 
FactChecker said:
Shouldn't the problem statement specify values for K and S? Otherwise, how do you know what list to make?
Yes, ##K## is a constant and ##S## runs from 1 to K.
 
Robin04 said:
Yes, ##K## is a constant and ##S## runs from 1 to K.
So are you being asked for lists from S= 1 to 5 or lists from S= 1 to ##10^{100}##? It seems to make a difference.
Or are you being asked for a formula for generating any lists required?
 
FactChecker said:
So are you being asked for lists from S= 1 to 5 or lists from S= 1 to ##10^{100}##? It seems to make a difference.
Or are you being asked for a formula for generating any lists required?
Seeking for a general formula might sound too optimistic to me. I only need to generate lists for small values of S, let's say up to 10-20. If no explicit formula could be given, I would already be satisfied with a more efficient algorithm to generate the lists. My current code, for S = 5, has to check around 8000 possible lists against each other, which takes around a minute, but for S = 6, this increases to around 100000 lists, haven't waited til its termination yet.
 
I find your notation confusing. Sometimes you use nk for an element of a sequence and sometimes for a whole sequence. In the latter usage, the subscript k is meaningless. Maybe write (nk) to denote a sequence.

The thread title mentions permutations, but I see nothing related to those in the description.

I don't get what is so interesting about pairs of such sequences. If AS,K is the set of all sequences conforming to the given S, K, isn't it then just a matter of listing all unordered pairs of elements of A?
 

Similar threads

  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
16
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K