How to set up frequency of values occurrences in a column?

For example, I want to create a column where
50% of the cells having 2,
30% of the cells having 3,
20% of the cells having 4.

How should I set up?