# Thread: Math puzzle Thanks: 0 Likes: 0

1. ## Math puzzle

There are pairings and values are received one from each scale. Small scale numbers are always unique. We have sum of values that are used. We know that pairings are either summed or not. Based on sum we need the function to return which index in the array was used.

The goal is to build deciphering function to return which pairings were used to create the sum. For ex: Can you figure out which pairings were used to make the sum?

Excel
ABCDE
1large scale:600400800800
2small scale:50516364
3
4sum:1965  Reply With Quote

2. ## Re: Math puzzle

Sum of what?

What does small scale or Large scale matter to the question?  Reply With Quote

3. ## Re: Math puzzle

Sum of pairings that were used. Edited the original post. mikerickson, does that make sense?  Reply With Quote

4. ## Re: Math puzzle

Each couple (pairings) may be inolved in the sum (1) or not (0). You have to implement a distribution with repetition method to cicle all possible solutions and keep only those matching your sum. I think the light is on but turns off if the pairing are a lot: for 12 pairings you have to test 2^12 possible solutions.

Bye  Reply With Quote

5. ## Re: Math puzzle Originally Posted by B___P Each couple (pairings) may be inolved in the sum (1) or not (0). You have to implement a distribution with repetition method to cicle all possible solutions and keep only those matching your sum. I think the light is on but turns off if the pairing are a lot: for 12 pairings you have to test 2^12 possible solutions.

Bye
how to build recursion function that returns the index of the array that is (1)?  Reply With Quote

6. ## Re: Math puzzle  Reply With Quote

7. ## Re: Math puzzle Originally Posted by B___P Thanks for reply B_P. That is the correct direction but was this possible with VBA solution (pseudocode) in cases when there are many more permutations?

It would have 3 parameters =DecipherFunction("B1:E1","B2:E2","B4") and it would return array "1,2,4"  Reply With Quote

8. ## Re: Math puzzle

The vertical pairs are irrlevent, right? So it just reduces to finding the combination of a set of numbers that add to a given total, a problem that has been well explored on this and other forums.  Reply With Quote

9. ## Re: Math puzzle

Hello shg, not sure why you said vertical pairs were irrelevant. some of them might not count toward the sum. The task is to use code to decipher the sum to the pairings (one from large scale one from small scale).  Reply With Quote

10. ## Re: Math puzzle

Right. But for a given vertical pair, you either use both or neither, so it is only their sum that matters, yes?  Reply With Quote

## User Tag List

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•