What is the event and sample space in this specific probability problem? I have always been taught that probability of an event is defined as $$P(E) = \frac{n(E)}{n(S)}$$
where E is an event, S is the sample space, and n(x) indicates the size of x.
Now, let's say I have 5 cubes and 10 balls in a box. If I take one object from the box, then the probability that the outcome will be a cube is 5/15.
In this case, what is the event and the sample space? How to interpret the number 15 as the size of sample space?
note: I have a feeling that the definition is somewhat wrong, but I don't know why it is wrong.
 A: 
I have always been taught that probability of an event is defined as $$P(E) = \frac{n(E)}{n(S)}$$

This formula applies when every outcome has the same probability (classical probability) and the sample space is finite.

Now, let's say I have 5 cubes and 10 balls in a box. If I take one object from the box, then the probability that the outcome will be a cube is 5/15. In this case, what is the event and the sample space?

This single-trial experiment can be cast with
$$S=\{C,B\}\\E=\{C\}$$ or, classically, $$S=\{C_1,C_2,\ldots,C_5,B_1,B_2,\ldots,B_{10}\}\\E=\{C_1,C_2,\ldots,C_5\}.$$
A: The formula $P(E) = n(E)/n(S)$ assumes that all events in $S$ are equally likely; this need not be the case.
Here, a reasonable assignment to the sample space would be $S = \{B,C\}$, for drawing a ball or cube respectively. But as you have seen, these are not equally likely.
One potential reframing of the problem is to label the objects: let $B_i$ be balls and $C_i$ cubes. Then instead we might have
$$S = \{B_1,B_2,\cdots,B_{10},C_1,C_2,\cdots,C_5\}$$
An event is a subset of the sample space, so you might define the events $B = \{B_1,\cdots,B_{10}\}$ and $C = \{C_1,\cdots,C_5\}$ for drawing some ball or cube respectively (irrespective of the label). Now notice how any singular element of $S$ occurring is equally likely compared to any other one, that $n(B) = 10$ and $n(C) = 5$ and $n(S) = 15$.
There are some technicalities we're sweeping under the rug here, but that's the gist of things.
