All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Two urns (Posted on 2013-01-10) Difficulty: 3 of 5
There are two urns, each with some numbered cards inside.
In urn A there are cards representing all 3-digit numbers (from 109 to 910 inclusively), having 10 as their sum of digits.
In urn B - all 3-digit numbers (from 119 to 920 inclusively), with 11 as their s.o.d.

Assuming you aim to randomly draw a prime number, which urn would you choose?
What if there was a 3rd urn with s.o.d=15, would you consider it as a good choice?

No Solution Yet Submitted by Ady TZIDON    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution re(4): computer assisted solution -remarki Comment 5 of 5 |
(In reply to re(3): computer assisted solution -remarki by Ady TZIDON)

Indeed there was a bug:extra NEXT's in the IF statements.

Corrected:

    5   Digsum=10
   10      for N=100 to 999
   20      S=fnSod(N)
   30        if S=Digsum and prmdiv(N)=N then inc Ct
   35        if S=Digsum then print N;:inc Ct2
   40      next
   50      print:print Ct,Ct2,Ct/Ct2
   60      end
 1070     fnSOD(X)
 1080        Sod=0
 1090        S=cutspc(str(X))
 1100        for I=1 to len(S)
 1110          Sod=Sod+val(mid(S,I,1))
 1120        next
 1130      return(Sod)
OK
run
 109  118  127  136  145  154  163  172  181  190  208  217  226  235  244  253 262  271  280  307  316  325  334  343  352  361  370  406  415  424  433  442 451  460  505  514  523  532  541  550  604  613  622  631  640  703  712  721 730  802  811  820  901  910

new stats:
 12  out of  54 for prob   0.2222222222222222221

and for sod=11:

 119  128  137  146  155  164  173  182  191  209  218  227  236  245  254  263 272  281  290  308  317  326  335  344  353  362  371  380  407  416  425  434 443  452  461  470  506  515  524  533  542  551  560  605  614  623  632  641 650  704  713  722  731  740  803  812  821  830  902  911  920

for stats:
 13 out of  61 making prob =   0.2131147540983606557

These probabilities agree with snark's reported results.

Same choice of urn for best chances, as noted by snark.


  Posted by Charlie on 2013-01-11 01:57:35
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (1)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (16)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information