Say I have 4 unique resistors. How would I calculate all the possible unique series and parallel configurations and thus, calculate all the possible total resistances?

And how can I expand this to accommodate a variable number of resistors?

I first started listing all the possible combinations for 4 resistors, but this was very time consuming and I ended up missing a few valid combinations. Is there some sort of algorithm that can do this?

  • \$\begingroup\$ A spreadsheet can do this easily \$\endgroup\$ Commented Feb 6, 2021 at 15:11
  • \$\begingroup\$ There's a lot more combinations of 4S, 3S, 3S1P, 2S, 2S+1P, 2S+2P, 1S, 1S+2P, 1S+3P, \$\endgroup\$ Commented Feb 6, 2021 at 15:47
  • \$\begingroup\$ This sounds like a nightmare for a human but a joke for a computer. Rather than trying to make an algorithm to find all possible layouts I'd do that part by hand and then let the computer find all the permutations and weed out duplicate combinations. That said there may be someone around here that knows offhand how to generate the netlists(connection diagrams) too, that's more of a programming problem, so you could take a look at the programming stack exchange (or code golf if you don't mind an algo only one person alive understands lol) \$\endgroup\$
    – K H
    Commented Feb 7, 2021 at 3:03
  • \$\begingroup\$ Perhaps read this? The general subject is a very powerful topic area called "generating functions" and Donald Knuth (and a couple of others) have written a book that covers the topic: "Concrete Mathematics: A Foundation for Computer Science," 2nd edition. \$\endgroup\$
    – jonk
    Commented Feb 7, 2021 at 4:12

1 Answer 1


It's called (unsurprisingly) combinatory math. Is a whole branch of math devoted to it, look around. Mostly stuff done multiplying and dividing factorials.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.