Comment-Spam Template revealed by Accident

Ein Spammer auf Github-User Shanselmans Blog hat aufgrund eines Fehlers sein komplettes Comment-Spam-Template gepostet, aus dem Teil kann man 4,3 Millarden unterschiedliche Spam-Varianten basteln. Auf Hackernews haben sie ihren Spaß damit:

It looks like this factors out to 4,351,250,624 unique comments.

How did you calculate this?

The set of strings is isomorphic to a Cartesian Product of sets of the same cardinalities as the set of options (for example, if the template was "{I,We} like {HTML, CSS, Javascript}", you can make a set {0,1}x{0,1,2}, where each element in the product set maps to one string and vice versa. For example (0,0) might represent I like HTML, and (1,2) might represent We like Javascript).

Because there is a one to one map (bijection) between the Cartesian Product set and the set of strings, the size of the product set is the same as the size of the set of strings. The cardinality of a cartesian product AxB, where A and B are sets, is |AxB|=|A|x|B|, so to find the size of the set of strings, you just need to multiply together the number of options at each point in the template where you have a choice.

Comment spam random text template (github.com)