Skip to main content
Statistics LibreTexts

5.3: Problems on Conditional Independence

  • Page ID
    10873
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    Exercise \(\PageIndex{1}\)

    Suppose \(\{A., B\}\) ci \(|C\) and \(\{A, B\}\) ci \(|C^c\), \(P(C) = 0.7\), and

    \(P(A|C) = 0.4\), \(P(B|C) = 0.6\), \(P(A|C^c) = 0.3\), \(P(B|C^c) = 0.2\)

    Show whether or not the pair \(\{A., B\}\) is independent.

    Answer

    \(P(A) = P(A|C) P(C) + P(A|C^c)P(C^c)\), \(P(B) = P(B|C)P(C)\) + P(B|C^c) P(C^c)\), and

    \(P(AB) = P(A|C) P(B|C) P(C) + P(A|C^c) P(B|C^c) P(B|C^c)P(C^c)\)

    PA = 0.4*0.7 + 0.3*0.3
    PA =  0.3700
    PB = 0.6*0.7 + 0.2*0.3
    PB =  0.4800
    PA*PB
    ans = 0.1776
    PAB = 0.4*0.6*0.7 + 0.3*0.2*0.3
    PAB = 0.1860       % PAB not equal PA*PB;  not independent

    Exercise \(\PageIndex{2}\)

    Suppose \(\{A_1, A_2, A_3\}\) ci \(|C\) and ci \(|C^c\), with \(P(C) = 0.4\), and

    \(P(A_i|C) = 0.90, 0.85, 0.80\) \(P(A_i|C^c) = 0.20, 0.15, 0.20\) for \(i = 1, 2, 3\), respectively

    Determine the posterior odds \(P(C|A_1A_2^cA_3)/P(C^c|A_1A_2^cA_3)\).

    Answer

    \(\dfrac{P(C|A_1A_2^cA_3)}{P(C^c|A_1A_2^cA_3)} = \dfrac{P(C)}{P(C^c)} \cdot \dfrac{P(A_1C) P(A_2^c|C) P(A_3|C)}{P(A_1|C^c) P(A_2^c|C^c) P(A_3|C^c)}\)

    \(=\dfrac{0.4}{0.6} \cdot \dfrac{0.9 \cdot 0.15 \cdot 0.80}{0.20 \cdot 0.85 \cdot 0.20} = \dfrac{108}{51} = 2.12\)

    Exercise \(\PageIndex{3}\)

    Five world class sprinters are entered in a 200 meter dash. Each has a good chance to break the current track record. There is a thirty percent chance a late cold front will move in, bringing conditions that adversely affect the runners. Otherwise, conditions are expected to be favorable for an outstanding race. Their respective probabilities of breaking the record are:

    • Good weather (no front): 0.75, 0.80, 0.65, 0.70, 0.85
    • Poor weather (front in): 0.60, 0.65, 0.50, 0.55, 0.70

    The performances are (conditionally) independent, given good weather, and also, given poor weather. What is the probability that three or more will break the track record?

    Hint. If \(B_3\) is the event of three or more, \(P(B_3) = P(B_3|W) P(W) + P(B_3|W^c) P(W^c)\).

    Answer
    PW = 0.01*[75 80 65 70 85];
    PWc = 0.01*[60 65 50 55 70];
    P = ckn(PW,3)*0.7 + ckn(PWc,3)*0.3
    P =  0.8353

    Exercise \(\PageIndex{4}\)

    A device has five sensors connected to an alarm system. The alarm is given if three or more of the sensors trigger a switch. If a dangerous condition is present, each of the switches has high (but not unit) probability of activating; if the dangerous condition does not exist, each of the switches has low (but not zero) probability of activating (falsely). Suppose \(D =\) the event of the dangerous condition and \(A =\) the event the alarm is activated. Proper operation consists of \(AD \bigvee A^cD^c\). Suppose \(E_i =\) the event the \(i\)th unit is activated. Since the switches operate independently, we suppose

    \(\{E_1, E_2, E_3, E_4, E_5\}\) ci \(|D\) and ci \(|D^c\)

    Assume the conditional probabilities of the \(E_1\), given \(D\), are 0.91, 0.93, 0.96, 0.87, 0.97, and given \(D^c\), are 0.03, 0.02, 0.07, 0.04, 0.01, respectively. If \(P(D) = 0.02\), what is the probability the alarm system acts properly? Suggestion. Use the conditional independence and the procedure ckn.

    Answer
    P1 = 0.01*[91 93 96 87 97];
    P2 = 0.01*[3 2 7 4 1];
    P  = ckn(P1,3)*0.02 + (1 - ckn(P2,3))*0.98
    P =  0.9997

    Exercise \(\PageIndex{5}\)

    Seven students plan to complete a term paper over the Thanksgiving recess. They work independently; however, the likelihood of completion depends upon the weather. If the weather is very pleasant, they are more likely to engage in outdoor activities and put off work on the paper. Let \(E_i\) be the event the \(i\)th student completes his or her paper, \(A_k\) be the event that \(k\) or more complete during the recess, and W be the event the weather is highly conducive to outdoor activity. It is reasonable to suppose \(\{E_i: 1 \le i \le 7\}\) and ci \(|W^c\). Suppose

    \(P(E_i|W) = 0.4, 0.5, 0.3, 0.7, 0.5, 0.6, 0.2\)

    \(P(E_i|W^c) = 0.7, 0.8, 0.5, 0.9, 0.7, 0.8, 0.5\)

    respectively, and \(P(W) = 0.8\). Determine the probability \(P(A_4)\) that four our more complete their papers and \(P(A_5)\) that five or more finish.

    Answer
    PW = 0.1*[4 5 3 7 5 6 2];
    PWc = 0.1*[7 8 5 9 7 8 5];
    PA4 = ckn(PW,4)*0.8 + ckn(PWc,4)*0.2
    PA4 =  0.4993
    PA5 = ckn(PW,5)*0.8 + ckn(PWc,5)*0.2
    PA5 =  0.2482

    Exercise \(\PageIndex{6}\)

    A manufacturer claims to have improved the reliability of his product. Formerly, the product had probability 0.65 of operating 1000 hours without failure. The manufacturer claims this probability is now 0.80. A sample of size 20 is tested. Determine the odds favoring the new probability for various numbers of surviving units under the assumption the prior odds are 1 to 1. How many survivors would be required to make the claim creditable?

    Answer

    Let \(E_1\) be the event the probability is 0.80 and \(E_2\) be the event the probability is 0.65. Assume \(P(E_1)/P(E_2) = 1\).

    \(\dfrac{P(E_1 |S_n = k)}{P(E_2|S_n = k)} = \dfrac{P(E_1)}{P(E_2)} \cdot \dfrac{P(S_n = k| E_1)}{P(S_n = k|E_2)}\)

    k = 1:20;
    odds = ibinom(20,0.80,k)./ibinom(20,0.65,k);
    disp([k;odds]')
    - - - - - - - - - - - -
       13.0000    0.2958
       14.0000    0.6372
       15.0000    1.3723   % Need at least 15 or 16 successes
       16.0000    2.9558
       17.0000    6.3663
       18.0000   13.7121
       19.0000   29.5337
       20.0000   63.6111

    Exercise \(\PageIndex{7}\)

    A real estate agent in a neighborhood heavily populated by affluent professional persons is working with a customer. The agent is trying to assess the likelihood the customer will actually buy. His experience indicates the following: if H is the event the customer buys, S is the event the customer is a professional with good income, and E is the event the customer drives a prestigious car, then

    \(P(S) = 0.7\) \(P(S|H) = 0.90\) \(P(S|H^c) = 0.2\) \(P(E|S) = 0.95\) \(P(E|S^c) = 0.25\)

    Since buying a house and owning a prestigious car are not related for a given owner, it seems reasonable to suppose \(P(E|HS) = P(E|H^cS)\) and \(P(E|HS^c) = P(E|H^cS^c)\). The customer drives a Cadillac. What are the odds he will buy a house?

    Answer

    Assumptions amount to \(\{H, E\}\) ci \(|S\) and ci \(|S^c\).

    \(\dfrac{P(H|S)}{P(H^c|S)} = \dfrac{P(H) P(S|H)}{P(H^c) P(S|H^c)}\)

    \(P(S) = P(H) P(S|H) + [1 - P(H)] P(S|H^c)\) which implies

    \(P(H) = \dfrac{P(S) - P(S|H^c)}{P(S|H) - P(S|H^c)} = 5/7\) so that \(\dfrac{P(H|S)}{P(H^c|S)} = \dfrac{5}{2} \cdot \dfrac{0.9}{0.2} = \dfrac{45}{4}\)

    Exercise \(\PageIndex{8}\)

    In deciding whether or not to drill an oil well in a certain location, a company undertakes a geophysical survey. On the basis of past experience, the decision makers feel the odds are about four to one favoring success. Various other probabilities can be assigned on the basis of past experience. Let

    • \(H\) be the event that a well would be successful
    • \(S\) be the event the geological conditions are favorable
    • \(E\) be the event the results of the geophysical survey are positive

    The initial, or prior, odds are \(P(H)/P(H^c) = 4\). Previous experience indicates

    \(P(S|H) = 0.9\) \(P(S|H^c) = 0.20\) \(P(E|S) = 0.95\) \(P(E|S^c) = 0.10\)

    Make reasonable assumptions based on the fact that the result of the geophysical survey depends upon the geological formations and not on the presence or absence of oil. The result of the survey is favorable. Determine the posterior odds \(P(H|E)/P(H^c|E)\).

    Answer

    \(\dfrac{P(H|E)}{P(H^c|E)} = \dfrac{P(H)}{P(H^c)} \cdot \dfrac{P(S|H) P(E|S) + P(S^c|H) P(E|S^c)}{P(S|H^c) P(E|S) + P(S^c|H^c) P(E|S^c)}\)

    \(= 4 \cdot \dfrac{0.90 \cdot 0.95 + 0.10 \cdot 0.10}{0.20 \cdot 0.95 + 0.80 \cdot 0.10} = 12.8148\)

    Exercise \(\PageIndex{9}\)

    A software firm is planning to deliver a custom package. Past experience indicates the odds are at least four to one that it will pass customer acceptance tests. As a check, the program is subjected to two different benchmark runs. Both are successful. Given the following data, what are the odds favoring successful operation in practice? Let

    • \(H\) be the event the performance is satisfactory
    • \(S\) be the event the system satisfies customer acceptance tests
    • \(E_1\) be the event the first benchmark tests are satisfactory.
    • \(E_2\) be the event the second benchmark test is ok.

    Under the usual conditions, we may assume \(\{H, E_1, E_2\}\) ci \(|S\) and ci \(|S^c\). Reliability data show

    \(P(H|S) = 0.95\), \(P(H|S^c) = 0.45\)

    \(P(E_1|S) = 0.90\) \(P(E_1|S^c) = 0.25\) \(P(E_2|S) = 0.95\) \(P(E_2|S^c) = 0.20\)

    Determine the posterior odds \(P(H|E_1E_2)/P(H^c|E_1E_2)\).

    Answer

    \(\dfrac{P(H|E_1 E_2)}{P(H^c|E_1E_2)} = \dfrac{P(HE_1E_2S) + P(HE_1E_2S^c)}{P(H^cE_1E_2 S) + P(H^cE_1E_2S^c)}\)

    \(= \dfrac{P(S) P(H|S) P(E_1|S) P(E_2|S) + P(S^c) P(H|S^c) P(E_1|S^c) P(E_2|S^c)}{P(S) P(H^c|S) P(E_1|S) P(E_2|S) + P(S^c) P(H^c|S^c) P(E_1|S^c) P(E_2|S^c)}\)

    \(= \dfrac{0.80 \cdot 0.95 \cdot 0.90 \cdot 0.95 + 0.20 \cdot 0.45 \cdot 0.25 \cdot 0.20}{0.80 \cdot 0.05 \cdot 0.90 \cdot 0.95 + 0.20 \cdot 0.55 \cdot 0.25 \cdot 0.20} = 16.64811\)

    Exercise \(\PageIndex{10}\)

    A research group is contemplating purchase of a new software package to perform some specialized calculations. The systems manager decides to do two sets of diagnostic tests for significant bugs that might hamper operation in the intended application. The tests are carried out in an operationally independent manner. The following analysis of the results is made.

    • \(H\) = the event the program is satisfactory for the intended application
    • \(S\) = the event the program is free of significant bugs
    • \(E_1\) = the event the first diagnostic tests are satisfactory
    • \(E_2\) = the event the second diagnostic tests are satisfactory

    Since the tests are for the presence of bugs, and are operationally independent, it seems reasonable to assume \(\{H, E_1, E_2\}\) ci \(|S\) and \(\{H, E_1, E_2\}\) ci \(|S^c\). Because of the reliability of the software company, the manager thinks \(P(S) = 0.85\). Also, experience suggests

    \(P(H|S) = 0.95\) \(P(E_1|S) = 0.90\) \(P(E_2|S) = 0.95\)
    \(P(H|S^c) = 0.30\) \(P(E_1|S^c) = 0.20\) \(P(E_2|S^c) = 0.25\)

    Determine the posterior odds favoring \(H\) if results of both diagnostic tests are satisfactory.

    Answer

    \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1 E_2)} = \dfrac{P(HE_1E_2S) + P(HE_1E_2S^c)}{P(H^cE_1E_2S) + P(H^cE_1E_2S^c)}\)

    \(P(HE_1E_2S) = P(S) P(H|S) P(E_1|SH) P(E_2|SHE_1) = P(S) P(H|S) P(E_1|S) P(E_2|S)\)

    with similar expressions for the other terms.

    \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1E_2)} = \dfrac{0.85 \cdot 0.95 \cdot 0.90 \cdot 0.95 + 0.15 \cdot 0.30 \cdot 0.25 \cdot 0.20}{0.85 \cdot 0.05 \cdot 0.90 \cdot 0.95 + 0.15 \cdot 0.70 \cdot 0.25 \cdot 0.20} = 16.6555\)

    Exercise \(\PageIndex{11}\)

    A company is considering a new product now undergoing field testing. Let

    • \(H\) be the event the product is introduced and successful
    • \(S\) be the event the R&D group produces a product with the desired characteristics.
    • \(E\) be the event the testing program indicates the product is satisfactory

    The company assumes \(P(S) = 0.9\) and the conditional probabilities

    \(P(H|S) = 0.90\) \(P(H|S^c) = 0.10\) \(P(E|S) = 0.95\) \(P(E|S^c) = 0.15\)

    Since the testing of the merchandise is not affected by market success or failure, it seems reasonable to suppose \(\{H, E\}\) ci \(|S\) and ci \(|S^c\). The field tests are favorable. Determine \(P(H|E)/P(H^c|E)\).

    Answer

    \(\dfrac{P(H|E)}{P(H^c |E)} = \dfrac{P(S) P(H|S) P(E|S) + P(S^c) P(H|S^c) P(E|S^c)}{P(S) P(H^c|S) P(E|S) + P(S^c) P(H^c|S^c) P(E|S^c)}\)

    \(= \dfrac{0.90 \cdot 0.90 \cdot 0.95 + 0.10 \cdot 0.10 \cdot 0.15}{0.90 \cdot 0.10 \cdot 0.95 + 0.10 \cdot 0.90 \cdot 0.15} = 7.7879\)

    Exercise \(\PageIndex{12}\)

    Martha is wondering if she will get a five percent annual raise at the end of the fiscal year. She understands this is more likely if the company's net profits increase by ten percent or more. These will be influenced by company sales volume. Let

    • \(H\) = the event she will get the raise
    • \(S\) = the event company profits increase by ten percent or more
    • \(E\) = the event sales volume is up by fifteen percent or more

    Since the prospect of a raise depends upon profits, not directly on sales, she supposes \(\{H, E\}\) ci \(|S\) and \(\{H, E\}\) ci \(|S^c\). She thinks the prior odds favoring suitable profit increase is about three to one. Also, it seems reasonable to suppose

    \(P(H|S) = 0.80\) \(P(H|S^c) = 0.10\) \(P(E|S) = 0.95\) \(P(E|S^c) = 0.10\)

    End of the year records show that sales increased by eighteen percent. What is the probability Martha will get her raise?

    Answer

    \(\dfrac{P(H|E)}{P(H^c |E)} = \dfrac{P(S) P(H|S) P(E|S) + P(S^c) P(H|S^c) P(E|S^c)}{P(S) P(H^c|S) P(E|S) + P(S^c) P(H^c|S^c) P(E|S^c)}\)

    \(= \dfrac{0.75 \cdot 0.80 \cdot 0.95 + 0.25 \cdot 0.10 \cdot 0.10}{0.75 \cdot 0.20 \cdot 0.95 + 0.25 \cdot 0.90 \cdot 0.10} = 3.4697\)

    Exercise \(\PageIndex{13}\)

    A physician thinks the odds are about 2 to 1 that a patient has a certain disease. He seeks the “independent” advice of three specialists. Let \(H\) be the event the disease is present, and \(A, B, C\)be the events the respective consultants agree this is the case. The physician decides to go with the majority. Since the advisers act in an operationally independent manner, it seems reasonable to suppose \(\{A, B, C\}\) ci \(|H\) and ci \(|H^c\). Experience indicates

    \(P(A|H) = 0.8\), \(P(B|H) = 0.7\), \(P(C|H) - 0.75\)

    \(P(A^c|H^c) = 0.85\), \(P(B^c|H^c) = 0.8\), \(P(C^c|H^c) = 0.7\)

    What is the probability of the right decision (i.e., he treats the disease if two or more think it is present, and does not if two or more think the disease is not present)?

    Answer
    PH = 0.01*[80 70 75];
    PHc = 0.01*[85 80 70];
    pH = 2/3;
    P  = ckn(PH,2)*pH + ckn(PHc,2)*(1 - pH)
    P =  0.8577

    Exercise \(\PageIndex{14}\)

    A software company has developed a new computer game designed to appeal to teenagers and young adults. It is felt that there is good probability it will appeal to college students, and that if it appeals to college students it will appeal to a general youth market. To check the likelihood of appeal to college students, it is decided to test first by a sales campaign at Rice and University of Texas, Austin. The following analysis of the situation is made.

    • \(H\) = the event the sales to the general market will be good
    • \(s\) = the event the game appeals to college students
    • \(E_1\)= the event the sales are good at Rice
    • \(E_2\) = the event the sales are good at UT, Austin

    Since the tests are for the reception are at two separate universities and are operationally independent, it seems reasonable to assume \(\{H, E_1, E_2\}\) ci \(|S\) and \(\{H, E_1, E_2\}\) ci \(|S^c\). Because of its previous experience in game sales, the managers think \(P(S) = 0.80\). Also, experience suggests

    \(P(H|S) = 0.95\) \(P(E_1|S) = 0.90\) \(P(E_2|S) = 0.95\)
    \(P(H|S^c) = 0.30\) \(P(E_1|S^c) = 0.20\) \(P(E_2|S^c) = 0.25\)

    Determine the posterior odds favoring \(H\) if sales results are satisfactory at both schools.

    Answer

    \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1E_2)} = \dfrac{P(HE_1E_2S) + P(HE_1E_2S^c)}{P(H^cE_1E_2S) + P(H^cE_1E_2S^c)}\)

    \(= \dfrac{P(S) P(H|S) P(E_1|S) P(E_2|S) + P(S^c) P(H|S^c) P(E_1|S^c) P(E_2|S^c)}{P(S) P(H^c|S) P(E_1|S) P(E_2|S) + P(S^c) P(H^c|S^c) P(E_1|S^c) P(E_2|S^c)}\)

    \(= \dfrac{0.80 \cdot 0.95 \cdot 0.90 \cdot 0.95 + 0.20 \cdot 0.30 \cdot 0.20 \cdot 0.25}{0.80 \cdot 0.05 \cdot 0.90 \cdot 0.95 + 0.20 \cdot 0.70 \cdot 0.20 \cdot 0.25} = 15.8447\)

    Exercise \(\PageIndex{15}\)

    In a region in the Gulf Coast area, oil deposits are highly likely to be associated with underground salt domes. If \(H\) is the event that an oil deposit is present in an area, and \(S\) is the event of a salt dome in the area, experience indicates \(P(S|H) = 0.9\) and \(P(S|H^c) = 1\). Company executives believe the odds favoring oil in the area is at least 1 in 10. It decides to conduct two independent geophysical surveys for the presence of a salt dome. Let \(E-1, E_2\) be the events the surveys indicate a salt dome. Because the surveys are tests for the geological structure, not the presence of oil, and the tests are carried out in an operationally independent manner, it seems reasonable to assume \(\{H, E_1, E_2\}\) ci \(|S\) and ci \(|S^c\). Data on the reliability of the surveys yield the following probabilities

    \(P(E_1|S) = 0.95\) \(P(E_1|S^c) = 0.05\) \(P(E_2|S) = 0.90\) \(P(E_2|S^c) = 0.10\)

    Determine the posterior odds \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1E_2)}\). Should the well be drilled?

    Answer

    \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1E_2)} = \dfrac{P(HE_1E_2S) + P(HE_1E_2S^c)}{P(H^cE_1E_2S) + P(H^cE_1E_2S^c)}\)

    \(P(HE_1E_2S) = P(H) P(S|H) P(E_1|SH) P(E_2|SHE_1) = P(H) P(S|H) P(E_1|S) P(E_2|S)\)

    with similar expressions for the other terms.

    \(\dfrac{P(H|E_1E_2)}{P(H^c|E_1E_2)} = \dfrac{1}{10} \cdot \dfrac{0.9 \cdot 0.95 \cdot 0.90 + 0.10 \cdot 0.05 \cdot 0.10}{0.1 \cdot 0.95 \cdot 0.90 + 0.90 \cdot 0.05 \cdot 0.10} = 0.8556\)

    Exercise \(\PageIndex{16}\)

    A sample of 150 subjects is taken from a population which has two subgroups. The subgroup membership of each subject in the sample is known. Each individual is asked a battery of ten questions designed to be independent, in the sense that the answer to any one is not affected by the answer to any other. The subjects answer independently. Data on the results are summarized in the following table:

    GROUP 1 (84 members) GROUP 2 (66 members)
    Q Yes No Unc Yes No Unc
    1 51 26 7 27 34 5
    2 42 32 10 19 43 4
    3 19 54 11 39 22 5
    4 24 53 7 38 19 9
    5 27 52 5 28 33 5
    6 49 19 16 19 41 6
    7 16 59 9 37 21 8
    8 47 32 5 19 42 5
    9 55 17 12 27 33 6
    10 24 53 7 39 21 6

    Assume the data represent the general population consisting of these two groups, so that the data may be used to calculate probabilities and conditional probabilities.

    Several persons are interviewed. The result of each interview is a “profile” of answers to the questions. The goal is to classify the person in one of the two subgroups

    For the following profiles, classify each individual in one of the subgroups

    1. y, n, y, n, y, u, n, u, y. u
    2. n, n, u, n, y, y, u, n, n, y
    3. y, y, n, y, u, u, n, n, y, y
    Answer
    % file npr05_16.m
    % Data for Exercise 5.3.16.
    A = [51 26  7; 42 32 10; 19 54 11; 24 53  7; 27 52  5;
         49 19 16; 16 59  9; 47 32  5; 55 17 12; 24 53  7];
    B = [27 34  5; 19 43  4; 39 22  5; 38 19  9; 28 33  5;
         19 41  6; 37 21  8; 19 42  5; 27 33  6; 39 21  6];
    disp('Call for oddsdf')
    npr05_16
    Call for oddsdf
    oddsdf
    Enter matrix A of frequencies for calibration group 1  A
    Enter matrix B of frequencies for calibration group 2  B
    Number of questions = 10
    Answers per question = 3
     Enter code for answers and call for procedure "odds"
    y = 1;
    n = 2;
    u = 3;
    odds
    Enter profile matrix E  [y n y n y u n u y u]
    Odds favoring Group 1:   3.743
    Classify in Group 1
    odds
    Enter profile matrix E  [n n u n y y u n n y]
    Odds favoring Group 1:   0.2693
    Classify in Group 2
    odds
    Enter profile matrix E  [y y n y u u n n y y]
    Odds favoring Group 1:   5.286
    Classify in Group 1

    Exercise \(\PageIndex{17}\)

    The data of Exercise 5.3.16., above, are converted to conditional probabilities and probabilities, as follows (probabilities are rounded to two decimal places).

    GROUP 1 \(P(G_1) = 0.56\) GROUP 2 \(P(G_2) = 0.44\)
    Q Yes No Unc Yes No Unc
    1 0.61 0.31 0.08 0.41 0.51 0.08
    2 0.50 0.38 0.12 0.29 0.65 0.06
    3 0.23 0.64 0.13 0.59 0.33 0.08
    4 0.29 0.63 0.08 0.57 0.29 0.14
    5 0.32 0.62 0.06 0.42 0.50 0.08
    6 0.58 0.23 0.19 0.29 0.62 0.09
    7 0.19 0.70 0.11 0.56 0.32 0.12
    8 0.56 0.38 0.06 0.29 0.63 0.08
    9 0.65 0.20 0.15 0.41 0.50 0.09
    10 0.29 0.63 0.08 0.59 0.32 0.09

    For the following profiles classify each individual in one of the subgroups.

    1. y, n, y, n, y, u, n, u, y, u
    2. n, n, u, n, y, y, u, n, n, y
    3. y, y, n, y, u, u, n, n, y, y
    Answer
    npr05_17
    % file npr05_17.m
    % Data for Exercise 5.3.17.
    PG1 = 84/150;
    PG2 = 66/125;
    A = [0.61 0.31 0.08
         0.50 0.38 0.12
         0.23 0.64 0.13
         0.29 0.63 0.08
         0.32 0.62 0.06
         0.58 0.23 0.19
         0.19 0.70 0.11
         0.56 0.38 0.06
         0.65 0.20 0.15
         0.29 0.63 0.08];
     
    B = [0.41 0.51 0.08
         0.29 0.65 0.06
         0.59 0.33 0.08
         0.57 0.29 0.14
         0.42 0.50 0.08
         0.29 0.62 0.09
         0.56 0.32 0.12
         0.29 0.64 0.08
         0.41 0.50 0.09
         0.59 0.32 0.09];
    disp('Call for oddsdp')
    Call for oddsdp
    oddsdp
    Enter matrix A of conditional probabilities for Group 1  A
    Enter matrix B of conditional probabilities for Group 2  B
    Probability p1 an individual is from Group 1  PG1
    Number of questions = 10
    Answers per question = 3
     Enter code for answers and call for procedure "odds"
    y = 1;
    n = 2;
    u = 3;
    odds
    Enter profile matrix E  [y n y n y u n u y u]
    Odds favoring Group 1:   3.486
    Classify in Group 1
    odds
    Enter profile matrix E  [n n u n y y u n n y]
    Odds favoring Group 1:   0.2603
    Classify in Group 2
    odds
    Enter profile matrix E  [y y n y u u n n y y]
    Odds favoring Group 1:   5.162
    Classify in Group 1
    

    This page titled 5.3: Problems on Conditional Independence is shared under a CC BY 3.0 license and was authored, remixed, and/or curated by Paul Pfeiffer via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.