-1
$\begingroup$

I have this question from here: Link for the exercise

It is the question number 4a. I am also aware that a question was posted on MSE about the exact same exercise over here How many ternary strings of length 4 have exactly one 1?

But my solution is different from both of them. I reason in such way: once there is a $1$ in the string, there are $2^3$ possibilities for the rest of the string. Now, in both answers, the reasoning goes on counting only the positions of where $1$ can go, yet I reason that it's important to see where the other letters go. As for example: $0123$ and $0132$ are different words and should be taken into account as two separate cases. Thus I reasoned I should count the total number of string not equal to $2^3 * 4$ or $2^3 *3$ but to $2^3 * 4!$.

Am I wrong or correct?

  • 2
    You are wrong: the $2^3$ covers all the possibilities for the non-$1$ digits (and $3$ is not a ternary digit). Incidentally, your linked exercise also looks wrong (there are four not three positions that the $1$ can be in) while the linked MSE answer looks correct2017-01-24

2 Answers 2

1

You are incorrect. You are right that if you have 4 different objects, then they can be ordered in 4! ways, but many strings have duplicate objects (e.g. 2 2's), and then you don't get as many possibilities, e.g. there are only 4 ways to shuffle 1222. In fact, with ternary strings, you can't even have 4 different objects!

0

The linked answer is

Answer: Ternary strings have symbols 0, 1, and 2. If there is exactly one 1, then there are 3 positions the one can be in and 2*2*2 ways to fill the other 3 blanks with a 0 or a 2. So the answer is 3*2*2*2 = 24.

If you have strings of length $4$ then there $4$ (not $3$) positions where you can put the $1$. Let $X$ be a positions filled with $0$ or $2$.

$1XXX\rightarrow 2^3 \ \text{ways}$

$X1XX\rightarrow 2^3 \ \text{ways}$

$XX1X\rightarrow 2^3 \ \text{ways}$

$XXX1\rightarrow 2^3 \ \text{ways}$

In total there are $4\cdot 2^3=2^5=32$ ternary strings of length $4$.