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

Home > Probability
Only two digits (Posted on 2023-07-14) Difficulty: 3 of 5
Choosing randomly two integer numbers from 10 to 1,000,000 inclusive,
What are the chances they will be represented:
a. each by two distinct digits, albeit different
for each one of the numbers e.g. 322 and 78778
b.exactly the same two, like 3334 and 433344
or
c. distinct couples, sharing one digit like 5558 and 88338

No Solution Yet Submitted by Ady TZIDON    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts re: simulation | Comment 3 of 5 |
(In reply to simulation by Charlie)

The simulation program had a bug; the corrected program:



  
clearvars,clc
typea=0; typeb=0; typec=0;
for trial=1:100000000
  n1=char(string(randi(999991)+9));
  if length(unique(n1))==2
    n2=char(string(randi(999991)+9));
    if length(unique(n2))==2   % correction in bold

      switch length(unique([n1 n2]))
        case 2
          typeb=typeb+1;
        case 3
          typec=typec+1; 
        case 4
          typea=typea+1;
      end
    end
  end
end
  typea
  typeb
  typec
  typea/trial
  typeb/trial
  typec/trial
  trial/typea
  trial/typeb
  trial/typec
  
and output:

  
typea =
        1349
typeb =
    48
typec =
   796

 

a ans =
                 1.349e-05
b ans =
                   4.8e-07
c ans =
                  7.96e-06


reciprocal


a ans =
          74128.9844329133
b ans =
          2083333.33333333
c ans =
          125628.140703518
  

  Posted by Charlie on 2023-07-14 11:48:10
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
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