strange Bayessian probability calculation in book let us consider following   problem  taken from book
An appliance store purchases electric ranges from
two companies. From company A, 500 ranges are
purchased and 2% are defective. From company B,
850 ranges are purchased and 2% are defective.
Given that a range is defective, find the probability
that it came from company B
so here  we are assuming that  probability of selection   company is equally right? that means that   $P(A)=P(B)=\frac{1}{2}$ ,  also   $2$ %  defective means that probability of  selection of defective  from  ranges  is equal to $0.02$, for instance  in Company A, number of defective ranges is $500*0.02=10$ there  probability is equal to  $\frac{10}{500}=0.02=2$% 
we know probability of selecting  defective range is equal to
$ \frac{1}{2} *2$%   + $\frac{1}{2} *2$%  and probability of selecting defective from company  B  will be $1/2 * 2$%    divided by   probability of  selection of defective range,  but book says that answer is  $0.65 $, how?
 A: Here are two related problems: Can you solve these? The first one is the same as the intended interpretation of your problem.  The second is more interesting and is related to an alternative interpretation. 
There are 850 ranges of type A.  Each of these is independently defective with probability $d_A$.  There are 500 ranges of type B.  Each of these is independently defective with probability $d_B$. 
1) Suppose we randomly select a range, equally likely over all $(850+500)$ ranges.  Define
\begin{align*}
B &= \{\mbox{The randomly selected range is type B}\}\\
D &= \{\mbox{The randomly selected range is defective}\}
\end{align*}
Compute $P[B|D]$ in terms of $d_A$ and $d_B$. 
2) Define events:
\begin{align*}
F &= \{\mbox{at least one of the 850 ranges of type A is defective}\}\\
G &= \{\mbox{at least one of the 500 ranges of type B is defective}\}
\end{align*}
Compute $P[G| \{F \cup G\}]$ in terms of $d_A$, $d_B$.
A: Either there is a typo or the answer in the book $(0.65)$ isn't correct:


*

*"Given that .. (condition) ..." says it is about a conditional probability.

*So, let $D$ be the event "range is defective".

*To be calculated is $P(B|D)$.


In the problem text is nothing said about a specific randomized selection process. So, the only meaningful context here is to consider the range as randomly selected from all ranges. 
Now $\color{blue}{\mbox{Bayes}}$ gives immediately (here including all steps)
$$\color{blue}{P(B|D)} = \frac{P(B \cap D)}{P(D)} = \frac{P(B \cap D)}{P(D \cap A) + P(D \cap B)}= \color{blue}{\frac{P(D|B)P(B)}{P(D|A)P(A) + P(D|B)P(B)}}$$ $$ = \frac{0.02\cdot \frac{850}{500+850}}{0.02\cdot \frac{500}{500+850} + 0.02\cdot \frac{850}{500+850}} = \frac{850}{500+850} \approx \boxed{0.63}$$
