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

Home > Numbers
Finding Two Calculator Fractions (Posted on 2023-03-02) Difficulty: 3 of 5
Lionel has a calculator that displays a maximum of ten digits (for example: 3,478,062,139 and 0.073672932)
• Lionel chose 4 distinct prime numbers p,q,r and s all less than 100 and he calculates p/q – r/s. The result is 0.180451127. Determine p,q,r and s.
• Consider the two base ten numbers 0.728101457 and 0.635149023. One of these numbers is the result displayed by Lionel's calculator of an irreducible fraction u/v with u and v, that are positive integers less than 1000. The decimals of the other number are taken from a table of random numbers.

Determine the terms u and v of the irreducible fraction.

See The Solution Submitted by K Sengupta    
Rating: 5.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Some Thoughts First Part | Comment 1 of 4
I found three sets of primes for {p,q,r,s} which find the correct result, if the calculator determines the last displayed digit by truncation rather than by rounding:
17/19  -  5/7 =  0.18045112781954886
23/7 - 59/19 =  0.18045112781954886
37/7 - 97/19 =  0.18045112781954842

-----
primes = [p for p in range(2,100) if isprime(p)]
from itertools import permutations
for perm in permutations(primes,4):
    if abs((perm[0]/perm[1] - perm[2]/perm[3]) - 0.180451127) < .000001:
        print(  '{}/{} - {}/{} = '.format(perm[0],perm[1],perm[2],perm[3]),
              (perm[0]/perm[1] - perm[2]/perm[3])  )

Edited on March 2, 2023, 2:25 pm
  Posted by Larry on 2023-03-02 14:19:05

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 (15)
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