So this is a program that calculates how many different possibilities there are of random selections from a set that we might have. Say we have 16 different colored pens. (Answer "16" for the first question asked.) We have four friends that each would like one and only one. (Say "4" for the second question asked.) The algorithm I have created then will spit out, "1,820." That number is the number of possible outcomes after the distribution of the pens! The actual formula is: N! ________ R!(n - r)! (*Disclaimer) Because of Scratch's internal math engine's limits, the use of numbers above 45 may give bad answers. Also, you can't choose x times if x is greater than the number in your set!
Just a lot of trial and error on my part! Feel free to use with credit if you can even find a use! By the way, those exclamation marks denote factorial, not emotion! - @Arrowcoding