When calculating the probability of selecting an onto function, use the principle of inclusion-exclusion. First, calculate the total number of functions, then subtract the cases where the function is not onto, and finally divide by the total number of functions to find the probability.


A shop selling electronic items sells smartphones of only three reputed companies A, B, and C because chances of their manufacturing a defective smartphone are only 5%, 4%, and 2% respectively. In his inventory, he has 25% smartphones from company A, 35% smartphones from company B, and 40% smartphones from company C.
A person buys a smartphone from this shop
(i) Find the probability that it was defective.