0
Can someone pls help me with a doubt in the code - halloween candy
I have gone through many codes for this problem and almost everyone has used the logic like b=(2/a) *100 But I don't understand that why do we need use the line 2/a... because it's not mention that we must have in the bag 2 dolar bills,there might be possibility of 1or 0 dolar bills too in the bag, then how can we use this line in our code. Plss help me out with this logic. https://code.sololearn.com/cBWft4HuOFK3/?ref=app
6 ответов
+ 1
https://code.sololearn.com/ck86nSEV9tRy/?ref=app
+ 1
I also did not use that line... Maybe that will help (just another idea). :)
+ 1
Indirectly u also used the same term only right bcoz 2 will come up so it becomes 2*100/houses....my doubt is why are we writing 2 here
0
Bcoz as per my knowledge of probability the term on top is the quantity that we have but in this case we are not sure about the number of dolar bills in the bag, so then why are we using 2 in the numerator?
0
I‘m pretty sure it‘s because „two houses are giving out dollar bills“, hence the 2.
0
Okhh...