Answer: 6/7
This approximates to roughly 6/7 = 0.8571
========================================================
Step-by-step explanation:
Let's define the following
- A = number of people who passed the test, and did the hw
- B = number of people who passed the test, but didn't do the hw
- C = number of people who failed the test, but did the hw
- D = number of people who failed the test, and didn't do the hw
There are 30 students in the class total. This must mean A+B+C+D = 30.
We know that "There were 7 students who failed the test and also did not complete the assignment", meaning we can say D = 7.
We can also say A+B = 21 because this is the entire group of people who passed the test (whether they did the hw or not).
This means:
A+B+C+D = 30
(A+B)+C+D = 30
(21) + C + 7 = 30
C+28 = 30
C = 30-28
C = 2
We have 2 people who failed the test, but did the hw.
Because 20 students did the hw, we know that
A+C = 20
A+2 = 20
A = 20-2
A = 18
We have 18 students who passed the test and did the hw. This is out of 21 students who passed. From here on out, we only focus on this group of students because of the phrasing "given that they passed the test". This means we know 100% that whoever we picked, they passed the test.
The probability we're after is therefore:
18/21 = (3*6)/(3*7) = 6/7
Side note: It might help to sort the data into a table as shown below. Start with table 1, and the goal is to replace the placeholder letters with the proper numbers, to arrive at table 2. You'll have to use algebra as shown earlier to fill out the table.