1
$\begingroup$

A code of 4 characters is generated. The characters are taken from the set $\left\{0,1,2...9,A,B...F\right\}$. What is the probability that:

1.The code is made-up only by distinct letters. For this point I just that the probability is the product $\frac{6}{16}\cdot \frac{5}{16}\cdot \frac{4}{16}\cdot \frac{3}{16}$ as those are the probabilities that you have a letter in your code, and once you get one, you cannot choose it again. Is this an appropiate solution?

The tricky part comes at the second part of this problem. It asks me to calculate the probability that the code contains the number 2 at least once. I don't know how to approach this. Another point asks me to calculate the probability that the letter E appears exactly twice in the code. Would this probability be the product $\frac{1}{16}\cdot \frac{1}{16}\cdot \frac{15}{16}\cdot \frac{15}{16}$ ?

This isn't homework, I just have an upcoming probability exam and I want to see how these type of exercises are being solved. Could someone help me a bit with this?

  • 1
    Please think about changing the title to something more informative2017-01-29

2 Answers 2

1

There are $16$ characters including the $10$ digits and $6$ letters

First Part of your question

Number of ways $4$ characters can be selected
$=\dbinom{16}{4}=1820$

Number of ways $4$ characters can be selected where each character is an alphabet
$=\dbinom{6}{4}=15$

Required probability
$=\dfrac{15}{1820}=\dfrac{3}{364}$

Alternate Solution

P(first letter is alphabet):$\dfrac{6}{16}$

P(second letter is alphabet):$\dfrac{5}{15}$

P(third letter is alphabet):$\dfrac{4}{14}$

P(fourth letter is alphabet):$\dfrac{3}{14}$

Required probability: $\dfrac{6}{16}\times \dfrac{5}{15} \times \dfrac{4}{14} \times \dfrac{3}{13}=\dfrac{3}{364}$

Second Part of your question

Number of ways $4$ characters can be selected
$=\dbinom{16}{4}=1820$

Number of ways $4$ characters can be selected which must not contain any $2$
$=\dbinom{15}{4}=1365$

So, Number of ways $4$ characters can be selected which must contain at least one $2$
$=1820-1365=455$

Required probability
$=\dfrac{455}{1820}=\dfrac{1}{4}$

Alternate Solution

P(any first letter except $2$):$\dfrac{15}{16}$

P(any second letter except $2$):$\dfrac{14}{16}$

P(any third letter except $2$):$\dfrac{12}{16}$

P(any fourth letter except $2$):$\dfrac{12}{16}$

Therefore, required probability

$=1-\dfrac{15}{16}\times \dfrac{14}{15} \times \dfrac{13}{14} \times \dfrac{12}{13}=\dfrac{1}{4}$

  • 1
    Thanks for the detailed response! I just have a small question. Isn't the last line of your answer supposed to be $\frac{455}{1820}$? Or am I missing something?2017-01-29
  • 1
    you are right, i corrected it. also give two solutions for both2017-01-29
  • 0
    I don't quite understand at your last solution, why is the P(Any second letter without 2) $\frac{14}{16}$? What am I missing?2017-01-29
  • 0
    in first pick, we selected any of the 15 non-2 characters. in second pick, we selected any of the remaining 14 non-2 characters. so on.2017-01-29
  • 0
    I edit your answer to make it clear. If you don't like you can revert my changes.2017-01-29
  • 0
    no, with your edit, it looks better.thanks2017-01-29
  • 0
    Mine pleasure :-)2017-01-29
1

Your Part 1 have some mistake. It should be -

$\frac{6}{16}\cdot \frac{5}{15}\cdot \frac{4}{14}\cdot \frac{3}{13}$

Part 2 -

We should have at least one time 2. It means we can have two times 2 or three times or four times.

Sum of all probabilities = 1

So atleast one time 2 = 1 - Case with no 2

$= 1 - \frac{\binom {15}{4}}{\binom {16}{4}}$

  • 0
    Oh thank you, seems like I messed up the first part somehow. What if I had to calculate the probability that I have 2 exactly two times? Would that be the product $\frac{1}{16}\cdot \frac{1}{16}\cdot \frac{15}{16}\cdot \frac{15}{16}$?2017-01-29
  • 1
    Yes it is but multiply your answer with $\binom 42$ as you can have two times 2 at any two places.2017-01-29