Test three randomly selected blocks of a program
up vote
1
down vote
favorite
There is one error in one of five blocks of a program. To find the error, we test three randomly selected
blocks. Let $𝑋$ be the number of errors in these three blocks. Compute $E(X)$ and $Var(X)$.
That's what i've tried:
$p = 0.6$
$n = 1$
$E(X) = ncdot p = 1cdot (0.6) = 0.6$
$Var(X) = n cdot pcdot q = 1cdot (0.6)cdot (0.4) = 0.24$
If we were using $n = 2$ with success probability of $0.6$ we would have:
$P(X = 0) = 0.16$
$P(X = 1) = 0.48$
$P(X = 2) = 0.36$
$p = 0.6$
$n = 2$
$E(X) = 2cdot (0.6) = 1.2$
$Var(X) = 2cdot (0.6)cdot (0.4) = 0.48$
probability probability-distributions variance
add a comment |
up vote
1
down vote
favorite
There is one error in one of five blocks of a program. To find the error, we test three randomly selected
blocks. Let $𝑋$ be the number of errors in these three blocks. Compute $E(X)$ and $Var(X)$.
That's what i've tried:
$p = 0.6$
$n = 1$
$E(X) = ncdot p = 1cdot (0.6) = 0.6$
$Var(X) = n cdot pcdot q = 1cdot (0.6)cdot (0.4) = 0.24$
If we were using $n = 2$ with success probability of $0.6$ we would have:
$P(X = 0) = 0.16$
$P(X = 1) = 0.48$
$P(X = 2) = 0.36$
$p = 0.6$
$n = 2$
$E(X) = 2cdot (0.6) = 1.2$
$Var(X) = 2cdot (0.6)cdot (0.4) = 0.48$
probability probability-distributions variance
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
There is one error in one of five blocks of a program. To find the error, we test three randomly selected
blocks. Let $𝑋$ be the number of errors in these three blocks. Compute $E(X)$ and $Var(X)$.
That's what i've tried:
$p = 0.6$
$n = 1$
$E(X) = ncdot p = 1cdot (0.6) = 0.6$
$Var(X) = n cdot pcdot q = 1cdot (0.6)cdot (0.4) = 0.24$
If we were using $n = 2$ with success probability of $0.6$ we would have:
$P(X = 0) = 0.16$
$P(X = 1) = 0.48$
$P(X = 2) = 0.36$
$p = 0.6$
$n = 2$
$E(X) = 2cdot (0.6) = 1.2$
$Var(X) = 2cdot (0.6)cdot (0.4) = 0.48$
probability probability-distributions variance
There is one error in one of five blocks of a program. To find the error, we test three randomly selected
blocks. Let $𝑋$ be the number of errors in these three blocks. Compute $E(X)$ and $Var(X)$.
That's what i've tried:
$p = 0.6$
$n = 1$
$E(X) = ncdot p = 1cdot (0.6) = 0.6$
$Var(X) = n cdot pcdot q = 1cdot (0.6)cdot (0.4) = 0.24$
If we were using $n = 2$ with success probability of $0.6$ we would have:
$P(X = 0) = 0.16$
$P(X = 1) = 0.48$
$P(X = 2) = 0.36$
$p = 0.6$
$n = 2$
$E(X) = 2cdot (0.6) = 1.2$
$Var(X) = 2cdot (0.6)cdot (0.4) = 0.48$
probability probability-distributions variance
probability probability-distributions variance
edited Nov 21 at 12:44
David K
51.7k340114
51.7k340114
asked Nov 20 at 18:06
sarah
61
61
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56
add a comment |
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
Since there is one error in the 5 blocks of code, $X in {0,1}$, where $X=0$ if all 3 blocks of code being tested are correct.
Assuming the error is equally likely to be in any of the 5 blocks of code, the probability of drawing three correct blocks of code is $frac{4}{5} times frac{3}{4} times frac{2}{3} = frac{2}{5}$, i.e. $P(X=0) = frac{2}{5}$ and $P(X=1)=frac{3}{5}$.
$mathbb{E}[X] = 0 times frac{2}{5} + 1 times frac{3}{5} = frac{3}{5}$.
$mathbb{E}[X^2] = 0^2 times frac{2}{5} + 1^2 times frac{3}{5} = frac{3}{5}$.
$Var(X) = mathbb{E}[X^2] - mathbb{E}[X]^2 = frac{3}{5}-left( frac{3}{5} right)^2 = frac{6}{25}$.
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
Since there is one error in the 5 blocks of code, $X in {0,1}$, where $X=0$ if all 3 blocks of code being tested are correct.
Assuming the error is equally likely to be in any of the 5 blocks of code, the probability of drawing three correct blocks of code is $frac{4}{5} times frac{3}{4} times frac{2}{3} = frac{2}{5}$, i.e. $P(X=0) = frac{2}{5}$ and $P(X=1)=frac{3}{5}$.
$mathbb{E}[X] = 0 times frac{2}{5} + 1 times frac{3}{5} = frac{3}{5}$.
$mathbb{E}[X^2] = 0^2 times frac{2}{5} + 1^2 times frac{3}{5} = frac{3}{5}$.
$Var(X) = mathbb{E}[X^2] - mathbb{E}[X]^2 = frac{3}{5}-left( frac{3}{5} right)^2 = frac{6}{25}$.
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
add a comment |
up vote
0
down vote
Since there is one error in the 5 blocks of code, $X in {0,1}$, where $X=0$ if all 3 blocks of code being tested are correct.
Assuming the error is equally likely to be in any of the 5 blocks of code, the probability of drawing three correct blocks of code is $frac{4}{5} times frac{3}{4} times frac{2}{3} = frac{2}{5}$, i.e. $P(X=0) = frac{2}{5}$ and $P(X=1)=frac{3}{5}$.
$mathbb{E}[X] = 0 times frac{2}{5} + 1 times frac{3}{5} = frac{3}{5}$.
$mathbb{E}[X^2] = 0^2 times frac{2}{5} + 1^2 times frac{3}{5} = frac{3}{5}$.
$Var(X) = mathbb{E}[X^2] - mathbb{E}[X]^2 = frac{3}{5}-left( frac{3}{5} right)^2 = frac{6}{25}$.
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
add a comment |
up vote
0
down vote
up vote
0
down vote
Since there is one error in the 5 blocks of code, $X in {0,1}$, where $X=0$ if all 3 blocks of code being tested are correct.
Assuming the error is equally likely to be in any of the 5 blocks of code, the probability of drawing three correct blocks of code is $frac{4}{5} times frac{3}{4} times frac{2}{3} = frac{2}{5}$, i.e. $P(X=0) = frac{2}{5}$ and $P(X=1)=frac{3}{5}$.
$mathbb{E}[X] = 0 times frac{2}{5} + 1 times frac{3}{5} = frac{3}{5}$.
$mathbb{E}[X^2] = 0^2 times frac{2}{5} + 1^2 times frac{3}{5} = frac{3}{5}$.
$Var(X) = mathbb{E}[X^2] - mathbb{E}[X]^2 = frac{3}{5}-left( frac{3}{5} right)^2 = frac{6}{25}$.
Since there is one error in the 5 blocks of code, $X in {0,1}$, where $X=0$ if all 3 blocks of code being tested are correct.
Assuming the error is equally likely to be in any of the 5 blocks of code, the probability of drawing three correct blocks of code is $frac{4}{5} times frac{3}{4} times frac{2}{3} = frac{2}{5}$, i.e. $P(X=0) = frac{2}{5}$ and $P(X=1)=frac{3}{5}$.
$mathbb{E}[X] = 0 times frac{2}{5} + 1 times frac{3}{5} = frac{3}{5}$.
$mathbb{E}[X^2] = 0^2 times frac{2}{5} + 1^2 times frac{3}{5} = frac{3}{5}$.
$Var(X) = mathbb{E}[X^2] - mathbb{E}[X]^2 = frac{3}{5}-left( frac{3}{5} right)^2 = frac{6}{25}$.
answered Nov 21 at 5:54
Aditya Dua
6208
6208
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
add a comment |
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
This confirms that the methods and results in the question were correct for the one-error case.
– David K
Nov 21 at 6:53
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3006679%2ftest-three-randomly-selected-blocks-of-a-program%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Can we assume that the second error can occur in the same block as the first error, and that the probability of this happening is $frac15$? If so, the calculations all look fine to me.
– David K
Nov 21 at 6:56