Quantifying permutations and scenarios

I have been using Excel to illustrate multiple scenarios about election outcomes over the next three election cycles. The overall purpose is to examine which scenarios result in one party attaining a certain number of seats. I have seven scenarios per cycle, and each cycle builds on the previous.

What I can’t figure out - and this may be something I learn how to do at my bootcamp in a couple weeks - is to automate the process of determining which scenarios and combinations of scenarios result in attainment of a certain number of seats. For example, in the worst-case scenario for 2018, party “A” could lose 10 seats, but in the best possible case they could gain 3. In the next cycle, Party “A” could lose 3 seats, or gain as many as 6.

What tool should I be using to get the computer to try out all 343 permutations to see which combination reaches the target # of seats I’m looking for?

Thanks for any help!

I’m not sure what you mean when you say that you ‘have seven scenarios per election cycle’. Maybe an example would clarify it.
But from the look of things you don’t have that many permutations so a simple approach would be to go over each permutation one by one and evaluate them. You would have some notion of one permutation being better than another permutation and you would use this to find the ‘best’ one.

Concept of search trees is relevant to your work.

You need to run an algorithm which makes a tree of all possibilities. One you have that, you can traverse and search the tree to look for specific possibilities that you want to work on.

The tree, but like a tree in nature, has a root and leaf.

You want to find out how certain possibilities can occur, which can be achieved by determining the path(s) from the root to the possibility of interest.