The two most common type of errors made by programmers are syntax errors and errors in logic. For a simple language such as BASIC the number of such errors is usually small. Let X denote the number of syntax errors and Y the number of errors in logic made on the first run of a BASIC program. Assume that the joint density for (X,Y) is as shown in table 2:
x/y
0
1
2
3
0
.400
.100
.020
.005
1
.300
.040
.010
.004
2
.040
.010
.009
.003
3
.009
.008
.007
.003
4
.008
.007
.005
.002
5
.005
.002
.002
.001
a. Find the probability that a randomly selected program will have neither of these types of error.
b. Find the probability that a randomly selected program will contain at least one syntax error and at most one error of logic.
c. Find the marginal densities for X and Y
d. Find the probability that a randomly selected program contains at least two syntax errors.
e. Find the probability that a randomly selected program contains one or two errors in logic.
a. probability that randomly selected probability will have neither of these types of probability probability of X is equal to zero and y is equal to 0.4
b. P=0.1+0.02+0.005+0.04+0.01+0.004=0.179
c.
d. P=0.02+0.01+0.009+0.007+0.005+0.002+0.005+0.004+0.003+0.003+0.002+0.001=0.071
e. P=0.3+0.04+0.01+0.004+0.04+0.01+0.009+0.003=0.416
Comments
Leave a comment