# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Generate a new metal subgenre in the spirit of the many metal microgenres

Contributed by:
Christopher Stover

ResourceFunction["RandomMetalPseudoSubgenre"][] generates a String consisting of one random (probably-fictitious) metal subgenre. | |

ResourceFunction["RandomMetalPseudoSubgenre"][ generates a List of | |

ResourceFunction["RandomMetalPseudoSubgenre"][UpTo[ is the same as ResourceFunction["RandomMetalPseudoSubgenre"][ | |

ResourceFunction["RandomMetalPseudoSubgenre"][{ generates an ×⋯ array of subgenres.n_{2} |

In the above, the arguments *n* and *n*_{i} must be integers.

ResourceFunction["RandomMetalPseudoSubgenre"] automatically threads over lists of integers.

ResourceFunction["RandomMetalPseudoSubgenre"] uses RandomInteger and RandomSample under the hood to create as much randomness as possible, but duplicates may still exist (see "Possible Issues" below).

Generate a random (probably-fictitious) metal subgenre:

In[1]:= |

Out[1]= |

Here are five random (probably-fictitious) metal subgenres:

In[2]:= |

Out[2]= |

It may be easier to read as a Column:

In[3]:= |

Out[3]= |

Using UpTo provides a different way to get five random (probably-fictitious) metal subgenres:

In[4]:= |

Out[4]= |

Here is an array of random (probably-fictitious) metal subgenres:

In[5]:= |

Out[5]= |

The nesting is easier to visualize using Grid with the Frame→All option:

In[6]:= |

Out[6]= |

RandomMetalPseudoSubgenre[*n*] returns unevaluated when *n* is any data type not mentioned in "Usage":

In[7]:= |

Out[7]= |

In[8]:= |

Out[8]= |

In[9]:= |

Out[9]= |

In[10]:= |

Out[10]= |

RandomMetalPseudoSubgenre uses RandomInteger and RandomSample under the hood to create as much randomness as possible. For small samples, this is generally enough to avoid duplicates:

In[11]:= |

In[12]:= |

Out[12]= |

Even so, duplicates may still exist in larger examples:

In[13]:= |

In[14]:= |

Out[14]= |

In[15]:= |

Out[16]= |

While all of the examples are neat, some stand out more than others. For example, sometimes, you get really long subgenre names:

In[17]:= |

Out[17]= |

In[18]:= |

Out[18]= |

And sometimes, the subgenre names are really short:

In[19]:= |

Out[19]= |

In[20]:= |

Out[20]= |

On average, however, the lengths of the subgenre names tend to be more average. Experimental evidence suggests that the Mean and Median of the subgenre name lengths are both around 50:

In[21]:= |

Out[21]= |

In[22]:= |

Out[22]= |

To make metal seem more academic, you can test the Mean/Median hypothesis by using StringLength on longer and longer lists of subgenres. This yields a pair of datasets (where *x* is the length of the subgenre list and *y* is the Mean/Median of the corresponding list's string lengths) which seem to support the hypothesis.

Here is a plot of the corresponding Mean data:

In[23]:= |

Out[1]= |

And here is one for the Median data:

In[24]:= |

Out[3]= |

The trend can be summarized by taking the Mean of the means and the Median of the medians. Again, the results are very close to 50:

In[25]:= |

Out[25]= |

In[26]:= |

Out[26]= |

- Wikipedia–Heavy metal music
- Wikipedia–Heavy metal genres
- Wikipedia–Extreme metal
- Metal Wiki–Fandom
- Wikipedia–Microgenre

- 1.0.0 – 14 March 2022

This work is licensed under a Creative Commons Attribution 4.0 International License