A box contains 5 red and k blue balls. A ball is selected at random…