Hello, and welcome to the second module of this online course. Today we are going to continue with the Star Wars exercise that we started in the past module. What we have here is that after calculating the probability of escaping through the laser beam, the android R2D2 realizes that he didn't take into account the laser beam of the enemies that would try to attack the Millennium Falcon to escape the asteroid field. Therefore, R2D2 needs to recalculate the probability of safely going and flying through the asteroid field, taking into account that the enemy's laser beams might actually hit the Millenium Falcon and damage it such that the probabilities of successfully flying through the asteroid beam would be changed. For this, R2D2 uses a contingency table, which has data of historical past escapes, that he will use to reproduce his probability of escaping the asteroid fields safely. You can find your contingency table in your documentation. Here you see the historical data of past escapes. So we see that from those who survived the asteroids' field, which are a total of 39 spacecraft, 37 managed to avoid the laser beams, and 2 were hit by the laser beams. This means that on the way from the place where the aircraft is to the asteroids' field, 2 spacecrafts were hit by laser beams, 37 were not hit by these laser beams, and 39 in total of them could escape through the asteroids' field. Then we had also historical data about the spacecraft that actually crashed in the asteroids, in the asteroid fields. And from this we know that 63 out of them could avoid the laser beams. 93, however, were hit by the laser beams. In total, we have 195 escapes, from which 156 crashed in the asteroids, 39 survive in the asteroids, 95, what we see here, were hit by laser beams, and 100 could avoid the laser beams. Well, taking this contingency table and this information, we are now able to answer the specific questions. So the first question is, what's the margin of probability of being hit by a laser beam? Well, we can calculate this probability as a 95 divided by 195. Why do we to make this calculation? Well, it's easy. We take the total number of escapes that we have, 195, and we select, or we divide, by this 195, those who were hit by a laser beam. So if we could go back to our table and we see here that we have 95 aircrafts, spacecrafts, that were hit by a laser beam, out of 195 total, that we have no deficit. So 95 divided by 195 would give us this 49%. Similarly we can try to answer the second question. What's the joint probability of surviving the asteroids and avoiding the laser beams? Well, now we have to calculate the probability of two events. Actually the probability of surviving the asteroids and the probability of avoiding the laser beams. So the favorable cases that we would have to divide by the total cases in this case are those in which a spacecraft survives the asteroids, and those in which they avoid the laser beam. So if you go to the contingency table, you would be able to see that this number is 37. So if we divide 37, which are our favorable cases, by the total number of cases, 195, this yields the probability of surviving and avoiding the laser beam, which is 19%. Now we can increase a little bit the difficulty of the question and ask, given that the spacecraft is hit by a laser beam, what's the probability of being alive after crossing the asteroid field? Well, in this case we know for sure that the spacecraft is hit by laser beam. So, this reduces the relevant state space that we can, or that we have to use to make our calculation. In this case it's the relevant space case is reduced to 95 cases. Actually, those in which the aircraft, the spacecraft, is for sure hit by the laser beam. Then we take at favorable cases again which is those in which the spacecraft survive. And we see it's only two in the contingency table, so if we divide two by 95, we get the probability that we're looking for which is 2.1%. Now we can scroll down a little bit and try to answer our last question which is also very similar to the previous one. Now, given that the space craft escapes the asteroid field, what's the probability of having been hit by a laser beam? So, now we see again that the relevant state space gets updated again to the cases in which the space craft survives the asteroids, the crossing of the asteroid field, which is 39 cases. We would then take our favorable cases, which would be those in which the spacecraft manages to escape the asteroid field, which are only 2, and then divide it by our relevant state space, 39. This will give a probability of 5.1%. Well, thank you very much. I hope that you have learned a little bit more about how to handle some probabilities, and that you have enjoyed the modules. See you soon, and have fun.