0
$\begingroup$

I have a set N of length len of different items, and I need to find number of possible ways I can permute them.

The problem is, I also have n conditions each of which specifies that item n(i) from set N must appear before every item in the set A(i).

Where A is a subset of the set {N - n(i)}, and n(i) belongs to N.

EDIT:

Thanks to @ChasBrown, I've clarified my question with proper notations.

I have a set N={1,2,...,k} where $k$ = 'len'; and $A⊂N$; and I want to know the number of permutations $p$ of $N$ where, for all $x∈N−A,y∈A$, $p(x)

  • 0
    This is going to depend heavily on the specific values of the $n(i)$ and $A(i)$. For some choices of $n(i)$ and $A(i)$, for instance, there are no such permutations.2017-01-06
  • 0
    Your notation is a bit confusing. Do you mean you have a set $N = \{1, 2, ..., k\}$ where $k$ = 'len'; and $A \subset N$; and you want to know the number of permutations $p$ of $N$ where, for all $x \in N - A, y \in A$, $p(x)2017-01-06
  • 0
    @ChasBrown Yes, exactly that.. sorry, I'm not from a mathematics background.2017-01-06
  • 0
    @ChasBrown, I find *your* notation a bit confusing as well. Does $p(x)$ signify the position (index) of $x$ within permutation $p$? One possible interpretation of the original question is that there is a subset $A \subset N$ and the permutations of $N$ which are of interest are only those in which *every* element of $A$ comes later than *every* element of $N-A$. But of course that's trivially $|A|!\times|N-A|!$2017-01-06
  • 0
    @Wildcard: I normally consider a permutation $p$ of $N$ to be a bijective function $p : N \rightarrow N$. I think the OP (who is coming from a programming background) is actually thinking of *strings* $\{(i, p(i)) : i \in N\}$.2017-01-06

1 Answers 1

1

Let $B = N - A$. Suppose there are $k$ elements in $N$ and $a$ elements in $A$; then there are $b = k-a$ elements in $B$.

Then you can think of this as: take any permutation of the elements of $B$ alone, and then append any permutation of the elements of $A$ alone; this gives you a permutation of the type you want. There are then $b! \cdot a!$ permutations in total.