How do you determine the number of ways a computer can randomly generate two integers whose sum is 8 from 1 through 12?

1 Answer
Write your answer here...
Start with a one sentence answer
Then teach the underlying concepts
Don't copy without citing sources


Write a one sentence answer...



Explain in detail...


I want someone to double check my answer

Describe your changes (optional) 200

Nimo N. Share
Jan 24, 2018


Some comments to get you started. The problem may not have been well-enough defined.


First, the problem has to be well defined.

A) If the problem is to generate random integers, will the choice of numbers used to generate the sum only be in the set of values: # N_A = {1, 2, 3, ... , 12} #?

  • This leads to another important mathematical question:
    Does "sum" mean simply "addition", or is it the mathematical "sum", which includes both adding and subtracting?

If that is the case, none of the numbers # X_A = {8, 9, 10, 11, 12} # can be selected, since all of the numbers are positive and there is no other number in the set # N_A # that can be added to any of the numbers in # X_A # to obtain 8.

Suppose the problem is as described in A), and that "sum" only means "addition". Then, the solution is easy to find - just make a list of the possible combinations, then count them.

Okay, we shall to do this the easy way...
# (1 + 7) #, # (2 + 6) #, # (3 + 5) #, # (4 + 4) #, # (5 + 3) #, # (6 + 2) #, # (7 + 1) #.
It looks as though we have all the possible combinations.
There are only 7 ways.

  • NB All the computer needs to do is pick one of the numbers in the set # S_A = {1, 2, 3, ,,, , 7} #. The second number can't be random, since once the first one is generated, the second one is determined.

We really may not be finished with the problem.

B) If the problem is really asking about integers (including both positive and negative values) and the list given should really be # N_B = {+-1, +-2, +-3, ... , +-12} #, we have a little longer list to make, but the solution can be found just as easily.

There are 24 numbers from which to choose in set # N_B #. But, at least two of them can't be used, since there is no way to obtain a sum of 8 if chosen.

For example, we can't use 8, since zero is not in the set and there is no positive number in the set # N_B # large enough to add to (-8) to produce a sum of 8.

The solution is, as above: make a list of the combinations from set # N_B # that will produce a sum of 8, then count them. And, remember the comment in NB, above.

Was this helpful? Let the contributor know!
Trending questions
Impact of this question
82 views around the world
You can reuse this answer
Creative Commons License