I wanted to know what is the time complexity of Enum.random and Enum.shuffle.
More specifically i wanted to figure out if I want to select 50 random values from a possible set of 10,000 values, will it be faster to shuffle the list and then take first 50 elements or select random elements 20 times
The shuffle implementation is straightforward. It creates assigns a random number to each list element and then sorts them and returns the result: https://github.com/elixir-lang/elixir/blob/master/lib/elixir/lib/enum.ex#L2080Enum.random depends on Enum.take_random which seems to creates a map with all the elements and takes a few of them.
To answer your question, you should run a few benchmarks using benchee to decide which one to use. If you want multiple random elements use Enum.take_random(enumerable, count) instead of running Enum.random multiple times.