Teleplazm M.

asked • 06/22/15

how to find the possibilities?

Hi, I have this problem:
A=1
B=2
C=3
D=4
E=5
F=6
G=7
H=8
I=9
J=10
K=20
L=30
M=40
 
is there any way to find all possibility to get the sum of (43)?
example: C+M=3+40 = 43
example 2: A+B+M = 1+2+40 = 43
example e: A+B+J+L= 1+2+10+30= 43
 
how to find all the possible combinations that always will make the (SUM) ONLY = 43
THANK YOU.

1 Expert Answer

By:

David W. answered • 06/22/15

Tutor
4.7 (90)

Experienced Prof

Teleplazm M.

That was fast Mr. David. :)
Thank you a lot. a lot. I really appreciate your quick replay.
I not a a mathematician, but i always face this kind of problem.
Is there any computer software helps with this specific formula?
Thank you again.
Report

06/23/15

David W.

Computers are very, very, very fast.  They are also very, very, very accurate (if you give correct instructions).  It took me 5 minutes to write instructions and the computer was so fast I couldn't measure it.
 
Exhaustive iteration means to try every single possibility and to test whether the result meets the criteria.
 
This problem resembles the problem of making change for dollars paid minus price; for selecting a subset of workers to produce a product; etc, (there are lots of these types of problems).
 
What I did is similar to this:
    Set Y=0
    For A goes from 0 to 1 Step 1
      For B goes from 0 to 2 Step 2
        For C goes from 0 to 3 Step 3
          For D goes from 0 to 4 Step 4
            For E goes from 0 to 5 Step 5
              For F goes from 0 to 6 Step 6
                For G goes from 0 to 7 Step 7
                  For H goes from 0 to 8 Step 8
                    For I goes from 0 to 9 Step 9
                      For J goes from 0 to 10 Step 10
                        For K goes from 0 to 20 Step 20
                          For L goes from 0 to 30 Step 30
                            For M goes from 0 to 40 Step 40
                              If A+B+C+D+E+F+G+H+I+J+K+L+M = 43 then
                                   Y=Y+1
                                   Output A,B,C,D,E,F,G,H,I,J,K,L,M
                            NEXT M
                          NEXT L
                        NEXT K
                      NEXT J
                    NEXT I
                  NEXT H
                NEXT G
              NEXT F
            NEXT E
          NEXT D
        NEXT C
      NEXT B
    NEXT A
Output "There are: ",Y
 
This considers all possibilities of combinations and counts and prints those that total 43.  There are lots of free software languages that can do this -- Java, C, Pearl, etc.  I used a simple flow-chart interpreter program (RAPTOR is free; Visual Logic is $45; both have errors).
 
Note: The mathematical approach is often the best to learn if you can.
Report

06/23/15

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.