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

Home > Just Math
Minimizing disjoint sum (Posted on 2023-06-20) Difficulty: 2 of 5
Let A and B be two non-empty subsets of X = {1, 2, . . . , 8 } with A ∪ B = X and A ∩ B = ∅. Let PA be the product of all elements of A and let PB be the product of all elements of B. Find the minimum possible value of PA +PB.

No Solution Yet Submitted by Danish Ahmed Khan    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution computer solution | Comment 3 of 6 |
clearvars,clc
X=1:8;
best=inf;
for card=1:4
  setA=combinator(8,card,'c');
  for i=1:length(setA)
    A=setA(i,:);
    B=setdiff(X,A);
    s=prod(A)+prod(B);
    if s<best
      best=s;
      bestA=A;
      bestB=B;
    end
  end
end
best
bestA
bestB

finds

best =
   402
bestA =
     4     6     8
bestB =
     1     2     3     5     7


  Posted by Charlie on 2023-06-20 14:04:12
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