Overview
I'm in a strange place here. I've written an algorithm, and am now not certain how to document it. I'm looking for assistance in turning this logic into a precise description.
Details
I have a method that takes a variable number of groups as input and spits out a large set of results. The number of results varies with the distribution of items in the groups and the number of groups. I can calculate the number of results that will be created as such:
In Psudocode:
(# of groups -1) * (# items in group 1) * (# items in group 2) * ... * (# items in group n)
In English:
The number of groups minus one, times the number of items in group 1, times the number of items in group 2, times the number of items in group 3 ... etc.
Question
Both the pseudocode and English descriptions above seem unwieldy.
How do I more succinctly describe this algorithm? Is there a compact mathematical formula? Or can it be described with more precise words? Better Pseudocode? Any advice would be greatly appreciated.
You could use the capital Pi notation to express this very neatly. Model the groups as sets and use the cardinality notation to mean # of items in group.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With