Hello I've got some problems and I don't know if my solutions are correct:
Given a Text with two letters $A$ and $B$ and the the probability of occurrence of letter $A$ is $p_a$ and $B$ is $p_b$, the probabilities are independent of the preceding and succeeding letters. The text contains $n_A$ times letter $A$ and $n_B$ times letter $B$.
1.) The text is expressed as sequence $S=(a_1, ...,a_N)$ $a_j \in \{A,B\}$ and $N=n_A+n_B$. Calculate the probability $Pr(S)$.
Solution: The number of possibilities are $\frac{N!}{n_A! * n_B!}$ but I'm not sure how the probability is calculated. There are two possibilities for each position some kind of binomial distribution?
2.) Now we are only interested in the number of times the individual letter occurs in the text. How many sequences of length $N$ exist in which letter $A$ occurs $n_A$ times? What is the probability $Pr(n_A)$ of $n_A$ occurrences of letter $A$?
Solution: How many sequences: $N \choose n_a$ Probability: $Pr(n_A)= {N \choose n_a}*p_A^{n_A}*p_B^{n_B}$
Now a text with three letter is considered
3.) Express $p_c$ as a function of $p_a$ and $p_b$. Express $n_C$ in terms of $n_A, n_B$ and $N$. Calculate the probability $Pr(S)$ with $S=(a_1, ...,a_N)$ $a_j \in \{A,B,C\}$.
Solution: $p_c=1-p_A-p_B$ and $n_C=N-n_A-n_B$ and the probability is some kind of multinomial distribution? But is $Pr(S) = Pr(n_A,n_B, n_C)$?
4.) Now we are again not interested in the position but only the number of occurrences of each of the three letters. How many sequences $S=(a_1, ...,a_N)$ do exist in which $A$ occurs $n_A$ times B $n_B$? What is the probability $Pr(n_A,n_B)$ of observing a text of length $N$ with $n_A$ occurrences of letter A and $n_B$ occurences of letter B? Are $n_A$ and $n_B$ i.i.d.? Hint: consider the number of sequences with $n_A$ out of $N$ letters being $A$, then $n_B$ out of $N-n_A$ letters being $B$ and $n_C$ out of $N-n_A-n_B$ letters being $C$.
Solution: I have no idea, moreover I'm confused if the preceding answers are correct.
I hope somebody can help me.
1) You're on the right track, but you can't just count the number of possibilities as they are not all equally likely. Consider an example sequence $S=ABBABA$, with $p_A=\frac{1}{4}$ and $p_B=\frac{3}{4}$. What is the probability of seeing this sequence? Well each letter is independent of the previous letters and the following letters, so $P(S)=\frac{1}{4}\cdot \frac{3}{4}\cdot \frac{3}{4}\cdot \frac{1}{4}\cdot \frac{2}{3}\cdot \frac{1}{4}$. How many times does $\frac{1}{4}$ (i.e., $p_A$) show up in this product, and how many times for $\frac{3}{4}$ ($p_B$)? Can you write it in terms of $n_A$ and $n_B$? (You've actually already solved this in answering question 2).)
2) You got it.
3) See the solution to question 1). This should be straightforward now.
4) Now you need multinomials. You have $N$ items and want $n_A$ of them to be $A$'s, $n_B$ to be $B$'s, and $n_C$ to be $C$'s. You could first choose which ones are $A$'s and consider the others to be "empty." There are $\binom{N}{n_A}$ ways to do this. Now for each choice of where the $A$'s go, how many choices are there for where the $B$'s and $C$'s go? Well there are $N-n_A$ spots left, and $n_B$ need to be $B$'s, so $\binom{N-n_A}{n_B}$. So the total number of strings is $\binom{N}{n_A}\cdot \binom{N-n_A}{n_B}$. If you write this out in terms of factorials, you'll find it equals $\frac{N!}{n_A!n_B!n_C!}$, which is a multinomial coefficient. You know the probability of each such string from question 3), so just multiply like you did to get the answer to question 2).
Hope this helps. Let me know if you still have questions.