Skip to main content
1-Visitor
May 8, 2014
Question

A Programme works out all the possible answers?

  • May 8, 2014
  • 6 replies
  • 2837 views

Hi,

I need some ideas on how to do the following:

I have two variables a and b, the sum of a & b is 10. I would like Mathcad to work out all the possibilities that give me a+b=10, and a keep in mind I would like them to be integers.

Thank you

6 replies

19-Tanzanite
May 8, 2014

If you just mean positive integers it's trivial:

ten.PNG

or have I misunderstood what you are looking for?

Alan

h_nas1-VisitorAuthor
1-Visitor
May 8, 2014

What if I have a, b, c, d and e?

19-Tanzanite
May 8, 2014

Here's a brute force and ignorance method, again assuming positive integers only.

ten2.PNG

Alan

23-Emerald I
May 8, 2014

Are you placing bounds on a and b? Integers, fine. Positive? Or are negative values allowed? Count "0" as an integer?