How many ways to multiply n matrices? Say I have 4 matrices A,B,C,D I can multiply them like this
((AB)C)D = (A(BC))D = (AB)(CD) = A((BC)D) = A(B(CD))
So, how many ways can n matrices be multiplied?
I thought it should be C(n+1,n) Because there are n matrices and we are putting the brackets in n+1 boxes then I realised that multiple brackets can reside in the same box.
I found another answer (1/n)C(2(n-1),n-1) however I dont know how this works. Can somebody explain this solution if it is correct?
 A: We see in OPs example all $5$ different ways to multiply four matrices according to the associative law. This corresponds to the Catalan number
$$C_3=\frac{1}{4}\binom{6}{3}=5$$.
We write these $5$ variants explicitely with dots and obtain
\begin{align*}
  &(((A \cdot B)\cdot C)\cdot D)\\
  &((A\cdot (B\cdot C))\cdot D)\\
  &((A\cdot B)\cdot (C\cdot D))\\
  &(A\cdot ((B\cdot C)\cdot D))\\
  &(A\cdot (B\cdot (C\cdot D)))\\
  \end{align*}

We can bijectively transform this represention into strings of valid pairs of open and closed parentheses. We do so by skipping the matrices and all open parentheses and replacing the dots with opening parentheses.
\begin{align*}
  &(\ )\ (\ )\ (\ )\\
  &(\ (\ )\ )\ (\ )\\
  &(\ )\ (\ (\ )\ )\\
  &(\ (\ )\ (\ )\ )\\
  &(\ (\ (\ )\ )\ )\\
  \end{align*}
In general we consider strings of length $2n$ consisting of $n$ open and $n$ closed parentheses. Valid sequences can be characterized, that parsing a string from left to right, starting with $0$ from the beginning and adding $1$ when reading an open parenthesis and subtracting $1$ when reading a closed parenthesis we always get a non-negative number. At the end we get $0$.
Now let's count the number $C_n$ of all valid sequences of length $2n$. The number of all sequences is
  \begin{align*}
  \binom{2n}{n}
  \end{align*}
A bad sequence contains $n$ open and $n$ closed parentheses, but reaches the value $-1$ at a certain step for the first time during parsing. When we have reached the value $-1$ we have parsed precisely one closing parentheses more than open parentheses.
We now reverse from that point on all parentheses, i.e. we exchange all open with closed parentheses and vice-versa. This results in a sequence  with  two more closed parentheses than open parentheses. So we have a total of $n+1$ closed parentheses and $n-1$ open parentheses.
It follows, the number of bad sequences is
  \begin{align*}
  \binom{2n}{n+1}
  \end{align*}

$$ $$

We conclude the number $C_n$ of all valid sequences of length $2n$ is
  \begin{align*}
  C_n=\binom{2n}{n}-\binom{2n}{n+1}=\frac{1}{n+1}\binom{2n}{n}\qquad \qquad n\geq 1
  \end{align*}

In OPs example $n\geq 2$ matrices imply $n-1$ dots for multiplication. These dots can be substituted with $n-1$ open parentheses giving $C_{n-1}=\frac{1}{n}\binom{2(n-1)}{n-1}$ different valid arrangements.
A: If number of matrices are let us assume $M$.
 Then number of ways to Multiply $M$ Matrices are = 
$$[(2N)!/(N+1)!N! ]$$
                                           Where $N=M-1$
For example if I have $3$ matrices $A,B,C$
 We can multiply these $3$ by $2$ ways $(AB)C$ and $A(BC)$
Here $M$ $=$ $3$
          Take $N$ $=$ $M$$-$$1$
$N$ $=$ $2$
        Then the number of ways to multiply these $3$ are $=$ $[(2*2)!/(2+1)!*2!]$
$Ans = 2$
