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

Home > Just Math
Counting Quadruplets II (Posted on 2010-09-21) Difficulty: 3 of 5
Each of A, B, C and D is a positive integer with the proviso that A ≤ B ≤ C ≤ D ≤ 20

Determine the total number of quadruplets (A, B, C, D) such that: A*B + C*D > 300.

What is the total number of quadruplets (A, B, C, D) such that: A*B - C*D > 100?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution Comment 2 of 2 |

FOR a = 1 TO 20
FOR b = a TO 20
FOR c = b TO 20
FOR d = c TO 20
  IF a * b + c * d > 300 THEN gt300 = gt300 + 1
  IF a * b - c * d > 100 THEN gt100 = gt100 + 1
  IF c * d - a * b > 100 THEN rgt100 = rgt100 + 1
  ct = ct + 1
NEXT
NEXT
NEXT
NEXT

PRINT gt300, gt100, rgt100, ct

shows
 
 3254          0             6347          8855
 
That is, of the 8855 quadruplets meeting the ordering criteria, 3254 have A*B + C*D > 300, but none have A*B - C*D > 100.  If the latter were reversed, however, there'd be 6347 with C*D - A*B > 100.
 


  Posted by Charlie on 2010-09-21 17:36:38
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 (3)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

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