Intereting Posts

If I have three points, is there an easy way to tell if they are collinear?
How to obtain a Lie group from a Lie algebra
How to prove that $\int_{0}^{\infty}\sin{x}\arctan{\frac{1}{x}}\,\mathrm dx=\frac{\pi }{2} \big(\frac{e-1}e\big)$
Ways to prove $\displaystyle \int_0^\pi dx \dfrac{\sin^2(n x)}{\sin^2 x} = n\pi$
The $L^1$ convergence of $f(x – a_n) \to f(x)$
Applications of the Isomorphism theorems
Power of 2 & 5 in product of consecutive numbers
Proof for a summation-procedure using the matrix of Eulerian numbers?
What is the significance of reversing the polarity of the negative eigenvalues of a symmetric matrix?
Solve equations $\sqrt{t +9} – \sqrt{t} = 1$
variance of multivariate normal
Lucas Theorem but without prime numbers
A curious equation containing an integral $\int_0^{\pi/4}\arctan\left(\tan^x\theta\right)d\theta=\frac{\ln2\cdot\ln x}{16}$
natural solutions for $9m+9n=mn$ and $9m+9n=2m^2n^2$
Show that $\int_0^1 f^2(x)dx\geq 3$, if $f:\to \mathbb{R}$ is an integrable function s.t. $\int_0^1 f(x)dx=\int_0^1 xf(x)dx=1$

How can we make $4$ letter words using $4$ letters (A,B,C,D) which satisfy following condition:

- The word cant starts or ends with A.
- A letter can be repeated more than once.
- Same letters can not seat together.

Example:

- BADC (correct)
- BCDC (correct)
- ABCD (incorrect)
- BCDA (incorrect)
- BCCD (incorrect)

As A is not allowed at first position, the four positions of the word can be arranged in $3\cdot3\cdot3\cdot3=81$ ways.

- How many ways to arrange people on a bench so that no woman sits next to another woman?
- Equivalence Relation On A Set Of Ordered-Pairs
- Combinatorics Pigeonhole problem
- Use PIE to count the number of $6$-multisets of $$ in which no digit occurs more than twice.
- Discrete Math - Hasse Diagrams
- Evaluate $\binom{n}{0}+\binom{n}{2}+\binom{n}{4}+…+\binom{n}{2k}$

Out of this, there will be $21$ cases where A will be at last position.

I have got those $21$ cases manually.

But I am looking for a formula or method which can be used for any $N$ and $R$.

Any help will be appreciated.

- Number of a certain type of permutations
- Transfer Matrix Method to determine the generating function
- How to determine which amounts of postage can be formed by using just 4 cent and 11 cent stamps?
- How many different ways can a number N be expressed as a sum of K different positive integers?
- Applying derangement principle to drunken postman problem.
- Recurrence with varying coefficient
- Permutations on word $MISSISSIPPI$.
- Least Impossible Subset Sum
- How to calculate equivalence relations
- Show that if $g \circ f$ is injective, then so is $f$.

You didn’t say what $N$ and $R$ are; I’ll assume you mean $N$-letter words using $R$ letters of which one can’t start or end the word. (Four-letter words are bad, anyway.)

First disregard the special role of A. Let $a(N,R)$ be the number of admissible words in which the first and last letters are identical, and let $b(N,R)$ be the number of admissible words in which the first and last letters are different. Then

\begin{align}

a(N+1,R)&=b(N,R)\;,\\

b(N+1,R)&=(R-1)a(N,R)+(R-2)b(N,R)\;,

\end{align}

or

$$

\pmatrix{a\\b}\to\pmatrix{0&1\\R-1&R-2}\pmatrix{a\\b}\;.

$$

In your case, with $R=4$, we have

\begin{array}{c|cc}

N&a&b\\\hline

1&4&0\\

2&0&12\\

3&12&24\\

4&24&84\\

5&84&240

\end{array}

Now of the words counted by $a(N,R)$, we have to exclude $1$ in $R$ because they start and end with the wrong letter, and of the words counted by $b(N,R)$ we have to exclude $2$ in $R$ because they start or end with the wrong letter, so the number you want is

$$

\frac{R-1}Ra(N,R)+\frac{R-2}Rb(N,R)=\frac{b(N+1,R)}R\;,

$$

which in your case is $\frac{240}4=60$.

The first and last letter cannot be $A$, so both must be one of $B,C,D$. $3^2$ ways to select them.

- If they are the same letter ($3$ of those ways), then the middle two letters can be selected in $3\times 2$ ways (selecting from three remaining letters with no repetition).
- If they are different letters ($3^2-3$ of those ways), then if the second letter is:
- the same as the last, then there are three options for the third place.
- one of the two other letters, then there are two options for the third place.

$$3\times(3\times 2)+(3^2-3)\times(1\times 3+2\times 2)$$

Consider permutations without $A$ and with $A$

Without $A$, easy to get $3\cdot2\cdot2\cdot2 = 24$

Now A can be at position $2$ or $3$, giving rise to $2\times(3\cdot1\cdot3\cdot2) =36$

so valid permutations = $60$

The first position can be filled in 3 ways (because A is not a valid option)

The second position can be filled by 3 ways (because the letter in the first cannot repeat)

Let’s us take two cases:

Case-I- The second position is filled with A

Then the third position can be filled by 3 ways and the fourth can be filled by 2 ways

Case-II The second position is not filled with A (There are two such choices)

Let us again take two cases

Case-II (a): The third position is filled with A

Then there are three choices for the fourth position.

Case II (b) The third position is not filled with A (There are two such choices)

Then there are two choices to fill the fourth position.

The total number of possible ways are

$3\times (3\times 2 + 2 (3+2\times 2 ) ) =60$

In order to get the number of ways end with A, you have 3 ways to start, one way to end and there are two cases for the third position.

(1) If the third letter is the same as the first letter, then we have three ways left for the second letter. This gives you $3\times3\times1\times1=9$ ways.

(2) If the third letter is different from the first letter, then we have two ways for the third letter and two ways for the second letter. This gives you $3\times2\times2\times1=12$ ways.

In total, there are 21 ways which end with A.

Let $n$ be the size of the word and $r$ the number of letters.

Let $f(n)$ be the number of solutions where the word does not start with A, but is allowed to end with that letter. It is easy to see that

$$f(n) = (r-1)^n$$

Let $g(n)$ be the desired number of solutions, where the word neither starts nor ends with A.

$f(n) – g(n)$ counts the number of solutions where the word ends with A. Note that this is exactly $g(n-1)$ for $n \geq 2$, and 0 for $n = 1$. That is,

$$g(n) = f(n) – g(n-1)$$

$$g(n) = \sum_{k=1}^n (-1)^{n-k}f(k)$$

$$g(n) = \frac{(r-1)^{n+1} + (-1)^{n+1}(r-1)}{r}$$

This is the number of circular arrangements of $n+1$ letters with no adjacent repetitions where assignment at position 0 is fixed to the letter A.

Plugging $n = r = 4$, we get $g(n) = 60$, as others have explained for this specific case.

- Another Watered Down Version of Dirichlet's Theorem
- Where DCT does not hold but Vitali convergence theorem does
- Matrix multiplication using Galois field
- multiplicative group of infinite fields
- Calculate the slope of a line passing through the intersection of two lines
- Normal approximation of tail probability in binomial distribution
- Evaluating $\int_0^1 \frac{x \arctan x \log \left( 1-x^2\right)}{1+x^2}dx$
- How prove this mathematical analysis by zorich from page 233
- A curious equation containing an integral $\int_0^{\pi/4}\arctan\left(\tan^x\theta\right)d\theta=\frac{\ln2\cdot\ln x}{16}$
- Proving that the limit of a sequence is $> 0$
- Solution of a 2nd order differential equation
- Why $I = $ is a $1$-manifold and $I^2$ not?
- Intermediate field between $F$ and $F(x)$
- Area formula for cyclic pentagon?
- Proof of Cartesian product intersection