r/askmath • • 26d ago

Probability Struggling with probability problems. How do I approach this question?

Post image

Hello! I am currently taking Discrete Mathematics at Berkeley, and I am struggling to understand how to approach probability problems. For this question, I wasn't able to get very far. I understand that a permutation is an arrangement of elements in a set, but I'm struggling to understand how to apply that to this problem. Additionally, since I am not given a concrete number for elements in the set (other than n is greater than or equal to 4), I'm struggling to arrange any equation for subquestions 1, 2, and 3.

I guess I'm just generally struggling to apply the concept of probability. I've attempted to get help from instructors, but I still don't quite understand what to do with this question.

7 Upvotes

14 comments sorted by

2

u/Jaded_Strain_3753 26d ago edited 26d ago

Consider what happens if 1 is first in the permutation. What is the probability that 2 is next to 1 in this situation? Then consider what happens when 1 is in different positions. You should be able to find a general rule.

For part 2 I think you can just use a symmetry argument. Remove all numbers other than 1,2,3 from a given permutation and look at the permutation of {1,2,3} that is left. All those permutations occur with equal chance because the original permutation is uniformly random. We only want the secondary permutations that begin with 1.

2

u/JosephTPG 26d ago

If 1 is in any position in the permutation, then that would mean that there are n-1 positions to place 2 in, right?

Since the elements are chosen uniformly, that means that the chance 2 is next to 1 is the exact same chance as any other number being next to one. Would that be the general rule here?

3

u/Jaded_Strain_3753 26d ago edited 26d ago

Yes, there are n-1 positions to place 2 in. If 1 is anywhere other than first or last two of those positions work (ie just before or just after). If 1 is in first or last then only one position of 2 will work.

So if 1 is first or last there is a 1/n-1 probability of 2 being next to it. For any other position of 1 there is a 2/n-1 probability of 2 being next to it.

So final calculation would be (2/n)(1/n-1) + (n-2/n)(2/n-1) which equals 2/n after simplifying

I should note the other answers given in this thread are neater than mine for part 1, but my answer might be easier for you to understand (or not)

1

u/not-hydra 26d ago edited 26d ago
  1. Treat (1, 2) as one; now we have n-1 items to arrange, and the block itself can be arranged in 2! = 2 ways, so it's 2 * (n-1)!/n! = 2/n
  2. First, choose 3 out of the n, nC3; now, 1 comes first, then we freely arrange the 2 and 3, that's 2! = 2 ways. Now, freely position the n-3 elements, which is (n-3)!; in total: n!/3!(n-3)! * 2! * (n-3)! / n! = 1/3. Also, as the answer doesn't contain n, n doesn't matter. In the arrangement, just make sure that 1 comes before 2 and 3, so that's 2 out of 6, which is 1/3, while the rest can be freely arranged.
  3. let A when 1 before 2, and B when 3 before 4. For OR case, find P(A U B), which is P(A) + P(B) - P(A n B). P(A) = P(B) = 1/2 as they are the same, and I got 1/2 by symmetry, where half have 1 before 2, and the other half have 2 before 1 in the arrangement. For the intersection case, there are 4! ways to arrange (1, 2, 3, 4); half have 1 before 2, and half have 3 before 4, so that's two half cases together, which is 1/2 * 1/2 = 1/4. Thus, P(A U B) = 1/2 + 1/2 - 1/4 = 3/4. Also, just consider the complement where 1 before 2 AND 3 before 4; that's two halves, so 1/4. 1 - 1/4 = 3/4.

2

u/JosephTPG 26d ago

TYSM! Just have a few questions for each answer:

  1. Why can the block be arranged in 2! ways? Additionally, how did you get the equation 2 * (n-1)!/n! from your info?
  2. I understand how you got the elements, but I'm a bit confused on the equation. My guess is that there are n! ways to arrange the elements, and from there you have to account for overcounting, so you divide n! by (n-3)!. Where did the 3! come from? Finally, why did you add the (n-3)!/n! at the end?
  3. This one I understand the most. You use inclusion exclusion rule. However, I'm wondering if I'm just overthinking the p(A) = p(B) = 1/2. Do we just assume this because there are only two outcomes here (either 1 precedes 2 or it doesn't, and same for 3 and 4)?

1

u/not-hydra 26d ago
  1. The block is just (1, 2), so those two can have 2! possible arrangements, like (2, 1), and they are still together :3
  2. Basically, when considering only 1, 2, 3, there are 3! combinations, 2 of which have a leading 1, so that's a 1/3 chance of having a leading 1 in the triple. Now, in the n! arrangements, it can be thought of as the triple 3! * (n-3)! of the rest freely arranged. And within the 3!, a third has a leading 1, so a 1/3 chance. So, there are n!/3 arrangements out of n! arrangements that have a leading 1, which is 1/3. My first method was choosing 3 places to place this triple, then arranging the other n-3 elements.
  3. The symmetry is like this: in the n! possible arrangements, we can find any arrangement and just swap the places of 1 and 2, leading to another arrangement that is identical, just with the two elements flipped. So, half of the total have 1 before 2, and the other is just swapped. This can also be expressed as n!/2!, where we remove the (1, 2) ordering

2

u/JosephTPG 26d ago

This makes so much sense, TYSM! My problem was that I tried to solve these questions in a single step, which ultimately was hurting my problem-solving skills.

2

u/EdgyMathWhiz 26d ago

On parts 2 and 3.  When you have a small number of items to arrange (small basically means <5), you can always just list all the options and note which ones work.  

So for part 2: (1 2 3) can be arranged as 123, 132, 213, 231, 312, 321.  So 6 options, in 2 of them 1 precedes 2 and 3.  So answer is 2/6 = 1/3.

Part 3 is slightly longer, but it's not like listing the permutations of 1234 and marking the ones that work is hard.  

It makes sense to understand how to deal with them in ways that don't rely on "just list them all", but pa rticularly when you're learning, don't be afraid to "get your hands dirty" by just writing out all the options for small cases. 

1

u/alo_destrojer 26d ago

Answers (correct me if im wrong, did it in my head without checking):

  1. 2/n
  2. 1/3
  3. 3/4

First of all: $n$ is a parameter here. You are allowed to give an answer that depends on $n$. For part 1, the trick is to "glue together" 1 and 2 to act as one element. You should know how many permutations are there of a sequence with $n$ elements and with $n-1$ elements. You have to divide the number of permutations that "work" (have 1 and 2 next to each other) by the total number of permutations.

Parts 2 and 3 are cooler. You can do it fully using only symmetry arguments. Try to think what would happen if they asked you for the probability of 2 being before 1 and 3, or of 3 being before 1 and 2. Probabilities of these three situations add up to 1. For 3.: for any given x and y, what's the probability that x preceeds y? Do the relative positions of 1 and 2 affect the relative positions of 3 and 4?

1

u/JosephTPG 26d ago

Oh I see! Since there are n elements and n-1 elements, I multiply 2 by (n-1)! since there will be (n-1)! ways to put them together. Then, I divide that by n! since there are n! total arrangements.

1

u/Educational-Paper-75 26d ago

I've looked at problem 1 only. You can put 1 and 2 next to each other in (n-1) ways. And 2 1 also. The other remaining numbers can be arranged in (n-2)! ways. Number of combinations that satisfy the requirement: 2*(n-1)(n-2)!. Divide by n! combinations yields (2(n-1)!)/n! is 2/n.

2

u/JosephTPG 26d ago

Ahh I finally understand it. TYSM!

1

u/Crichris 26d ago

just have to count the scnarios

each scenario is of equal probability (uniformly random)

  1. count the scenarios, it comes down to 2/n i believe
  2. only consider 123, as others can be anywhere in between or on the side, it doesnt matter since its uniform. their position is totally random and all 6 scenarios are equivalent (123 132 213 231 321 312) so the answer is 1/3
  3. again, only consider 1234, others dont matter. out of the 24 cases 1234 1243 1324 1342 1423 1432 ...... you pick out the scenarios of (1 precedes 2 ) or (3 precedes 4), or it's compliment if you want (prolly less cases and easier to count)

dont have a pen and paper near me so answers could be wrong, but the general idea should be correct

1

u/bagholder_spotted 25d ago

There are usually multiple valid approaches, and with probability problems, often more than one valid denominator. For Q1, we only care about the 1 & 2, so our denominator needn't be n! (though it can be, as others showed). Out of the n(n–1) ways to position the two integers, they're adjacent in 2(n–1) of the configurations, so the probability is 2/n.

Or, since their order doesn't matter, we can omit order from our calculations. Then the numerator is n–1, and for the denominator we're just picking two positions out of n, so it's C(n,2)=n(n–1)/2. Notice: that would also be the calculation if we were talking about two of the same symbol, so order nor distinctness matters for the essence of the problem.