Transcript for:
Bayes' Theorem Problem: Taxi Companies and Accidents

Hi friends, in this video we'll understand one of the interesting problem from Bayes-Thinam and let's understand the problem statement first. So a city has two taxi companies A and B and A has 60 percentage of the taxis in the city and B has 40 percentage of the taxis and also they have mentioned about A's taxis are involved in an accident 3 percentage of the time and the B's taxis are involved in 6% of the time. If a taxi is involved in an accident, what is the probability that it belongs to company B? And they have given four options for this problem. So, if you look at this entire problem, what exactly we need to calculate? We need to calculate the probability that it belongs to company B, given that the taxi is involved in an accident. right so for this kind of a problem we can solve it in two approaches so let me solve this problem using the approach one or i would say that it's a tree based approach so let me write it down here it's a tree based approach So, in this approach, I am going to take a simple example. Let's say there are 1000 taxis are present in the city. And according to the given problem, A has 60% of the taxis in the city. So, 60% of 1000 means it will be there are 600 taxis are belongs to company A and remaining 400 cars are belongs to company B. And also they have mentioned ace taxes are involved in an accident three percentage of the time that means out of 600 cars there are three percentage of the cars are involved in an accident right so that means three percentage of 600 means it will be 18 cars have been involved in an accident and remaining three sorry 582 cars has been involved not involved in an accident according to the given problem statement. Similar to this company B, there are 6% of the cars have been involved in an accident. That means 6% of 400 means it will be 24 cars have been involved in an accident and remaining 376 cars have been not involved in an accident. So this is what I can create a tree based diagram of the given problem statement. If you look at my overall tree diagram and how many cars has been involved in an accident, there are 18 cars has been involved in an accident from the company A and there are 24 cars has been involved from the company B. But according to the given problem, they were asking about what is the probability that it belongs to company B. That means out of 42 cars, how many cars has been belongs to the company B? There are 24 cars are belongs to the company B and overall number of cars are involved in an accident out of 1000 was 42. So if you will calculate this number, you are going to get a probability value is 0.57. Right? So the option B is correct. This is the simplest way to solve the problem. And the next approach here is the formula based approach. Right? So, we know about the Bayes theorem. Let me write down the formula here. The probability of A given B is equal to probability of B given A multiplied by probability of A by probability of B. This is what the Bayes theorem says. Now, according to my given problem, they have given the some probability values, right. So, A has 60 percentage of the taxi that means they have given about the probability of A. The probability of A here is 0.6 and the probability of B is equal to 0.4. And also they have mentioned about the A's taxis are involved in an accident 3 percentage of the time. That means they have given the conditional probability here. That means the probability of given that it is a. company A and they have mentioned about the probability of an accident given that it is a company A. So, what is this probability? This probability is 0.03. Similar to that, they also mentioned about the probability of accident given that it is a company B. So, this probability is 0.06 because according to the problem statement, they mentioned about the 3 percent which is nothing but 0.03. So, these are the values which I have already given in the problem statement, right. So, we know about the Bayes theorem formula. So, I can simply write it down as before going to that. So, what exactly we need to calculate? What is the probability that it belongs to company B and if a taxi is involved in an accident that means this event has been already occurred. So, what exactly we need to calculate the probability that given that it is an accident and I want to calculate the probability of b. The probability of b given that it is an accident, And I can apply the Bayes theorem that means the probability of accident given that it is a company B multiplied by probability of B by probability of an accident. This is the Bayes theorem formula. And, I know about this value which is probability of an accident given that b is 0.06 multiplied by probability of b is 0.4. And, what about this probability of an accident? which is nothing but the total law of probability. The probability of an accident is equal to and how many cars has been involved in an accident. If you look at my overall tree, these 42 cars has been involved in accident. So, these 18 cars are belongs to company A and these 24 cars has been in from the company B. So, the formula here is the probability of A multiplied by probability of given that it is A and the accident was happened plus probability of B multiplied by probability of accident given that it is B. So, in this case the probability of A is 0.6 into the probability of an accident given that it is A is 0.03. plus the probability of B is 0.4 multiplied by the probability of an accident given that B is 0.06. So, in this case this will be 0.18 plus 0.24, then the overall probability of an accident is 0.42. So, I am going to substitute here this will be 0.42, this overall value will be 0.24 by B. So, this is the probability of an accident given that B is 0.24 multiplied 0.42 and if you will going to calculate this number you will get a result as 0.57. So, in these two approaches we can able to solve this problem. Even if you look at this tree you can also write down the probability values for this each and every branch. So, how are we going to get this number 600? So, you are going to multiply it by probability of a. My probability of a is 0.6. So, 1000 into 0.6, you are going to get the number is 600. And similarly, here, how are we going to get this number 400? I am going to multiply the 1000 with the probability of B, which is nothing but 0.4. And what about this branch? This is the probability of an accident, given that it's a company E. This probability they have already mentioned in the problem statement itself, which is 0.03. So, 600 into 0.03, then you are going to get the result is 18. And what about this branch? The probability of its accident was not happened. So, I am going to represent it as an accident complement given that it is a company A. So, this probability will be 0.97 because I am going to simply say that 1 minus 0.03 which is nothing but 0.97. And similarly, And how are we going to get this number? I am going to multiply the conditional probability here, which is nothing but the probability of an accident given that it is a company B. This value will be 0.06. And what about this branch? This branch will be probability of an accident complement given that it is a company B, which is nothing but 0.94. So, if you are going to multiply 400 into 0.94. you are going to get this number which is nothing but 376. So, this is how we can solve this kind of a problem. So, the final answer is 0.57. Thank you.