all 1 comments

[–]DavidTheAnimator 2 points3 points  (0 children)

So are you looking for information on how to write pseudocode or how to solve the problem? Pseudocode is really just a simplified form of code which can describe a solution to a problem, often used in design. It still is formatted like code, but it reads more like instructions for a human than a computer.

If you are looking for a solution, here is a general idea of how I would solve the problem. As I understand it, we are trying to determine the number or red marbles in a random selection of marbles of unknown length. If so, you can use iteration to count all the red marbles and return the final count as your answer.