You can simulate this in Microsoft Excel.
You must use the RAND() function in Excel. What this function does is that it tells Excel to randomly generate a number from the interval [0,1] with equal probability (in other words, a uniform distribution). Now for every random number that is less than or equal to 0.2, you can count that as a malfunction. For every random number that is greater than 0.2, you will count that as a box with all 4 cards included.
For example, if you run the RAND() 4 times and it happens to give:
Then you will have 1 malfunctioned box, and 3 normal boxes.