Rarity ratio for an object I'm not sure of the terms, but let me explain the problem with a simple example.
Suppose there is a certain set of parameters for random generation of an object, in this case a colored geometric figure covered with a pattern.
Example
While people couldn't see the example image in my post, I will explain it in a few words. Let's say I have an algorithm which randomly generates a colored geometry shape from a given set of parameters (shape, color and texture).
Each parameters has a set of possible options.
Shape: rectangle (60%), circle (30%), triangle (8%) and star (2%).
Color: red (40%), green (40%) and blue (20%).
Texture: polka (15%), lines(25%) triangles (20%) and perforated (40%).

So, for each time random generator generated a value from 0.0 to 1.0
and, for example, if this value < 0.6 shape is rectangle, if value > 0.6 and < 0.9 circle, if value is bigger than 0.9 and less than 0.98 shape is triangle, and, finally, if it's > 0.98 the output would be a star. Similar to other propertes.
In other words, the problem is to calculate how rare the figure is based on the probability of each property falling out.
I need to find how rare is output.
Shape: rectangle (60%), circle (30%), triangle (8%) and star (2%).
Color: red (40%), green (40%) and blue (20%).
Texture: polka (15%), lines(25%) triangles (20%) and perforated (40%).
In terms of common sense, I would rather just multiply the values. For example, for Object A this would be 0.3 * 0.4 * 0.2 or 0.024, for Object B it would be 0.08 * 0.2 * 0.15 or 0.0024.
I would like to know if I am right and if there are special formulas to calculate the rarity rate/coefficient for any randomly generated figure, if the probability of each dropped parameter is known similar to the referenced example.
PS: I have made a very rough sketch codepen.io/isometrika-ru/pen/rNpXoMq, and it gives 0.024 for green polka circle. For blue triangle patterned star it's around 0.0006. Did 5M iterations. So, I need a formula to find these values.
 A: You could calculate the 48 probabilities multiplicatively as seen above and then save them in an array of $[0,1]$ in exactly the same way as you mentioned yourself: $[0,x_1]$ for object 1, $[x_1,x_2]$ for object 2, ... , $[x_{47},1]$ for object 48.
Just make sure that when later-on generating a random number in $[0,1]$, the algo knows what element to produce when the output is exactly, say, $x_1$, and doesn't produce both objects 1 and 2 or fails to produce any. This is either implemented in the programming languages array function already or can be achieved via explicit command. Other than that, you'd be good to go with using RNG once only.
A: I did one mistake, the second rate is 0.02 * 0.2 * 0.15 or 0.0006 and that's exactly what Codepen sketch gives, so the formula is straight-forward. All you need is just multiply all changes together.
In other words, if circle has 0.6 (60%) chance, green color 0.4 (40%) and triangled pattern 0.2 (20%), the rarity rate for green tri-patterned circle is 0.6 * 0.4 * 0.2 or 0.024 (2.4%).
