Hacker News new | ask | show | jobs
by pansa2 171 days ago
6 is the product of the members of the set {2, 3}.

3 is the product of the members of {3}.

1 is the product of the members of the empty set.

2 comments

3 is also the product of the sets {3, 1}, {3, 1, 1}, etc.

We’re excluding the unit when defining these factor sets (ie, multiplicative identity) because it removes unique factorization.

That 1 is the unit is also why it’s the value for the product of the empty set because we want the product of a union of sets to match the product of a product of sets. But we don’t exclude it from the primes for that reason.

What.

Oh! So it’s like Python’s `reduce(multiply,s,initial=1)`, such that s={} still gets you 1. Alright, that makes sense.