Let X be the number of people that separate A and B The question is :
Six people, including A and B, stand randomly in a line. Let X be the number of people
that separate A and B, we have to calculate ,P(x), P(0) , p(1)...p(4)
solution: for P(1)
The total number of people including A and B is 6. Those 6 can be arranged in 6! ways = 720 ways.
P(1):So we need 1 human to be between A and B. So we need to choose 1 people out of 4(6-2, without A and B) ; because we excluded A and B. Therefore, the number of ordered ways to choose 1 people out of 4 is 4P1=4 ways.
If we consider A, B and the one human between them as one entity, we need to see how we can arrange this entity along with the 3 remaining people. Therefore, they can be arranged in 4! = 24 ways. One last thing, the A and B can also be interchanged as B and A. Therefore, A and B can be arranged in 2 ways. We can conclude from all of this that the number of ordered ways we can place 1 human between X and Y is $4\cdot24\cdot2 = 192$ ways.
and the probability for that is $192/6! =  4/15$
is my approach to the question correct?

Your approach is correct.
Here is an alternative route.
We start with $6$ open spots and will select $2$ of them for placing $A$ and $B$ (no matter in what order). There are $\binom62=15$ equiprobable ways to select $2$ of these spots and exactly $4$ of these pairs will have exactly one spot in between.
So the probability that $A$ and $B$ will have exactly one person in between is $\frac{4}{15}$.
You could take advantage of this to find the other probabilities.
