Answer:
A discrete variable is a variable that can only take some selected given values from a given set, like x ∈ {x₁, x₂, ..., xₙ}
While a continuous variable can take any value in the range, like x ∈ {x₁, xₙ}.
1) The weight of bags of apples, with 10 apples in each bag.
Here the weight depends on the number of apples in the bag, and we can have only whole numbers of apples in the bag, so this is clearly a discrete variable.
2) The number of times required for a modem to dial an internet provider before connecting.
Same as before, here we can have only a whole number of attempts, so this set is discrete.
3) Out of 10 times connecting to an internet provider, the average number of attempts necessary before connecting.
Here we will have an average of 10 integer numbers:
so here we have a kinda dense set of possible values, so we can think of this as a continuous variable.
4) A pair of dice is rolled, and the sum to appear on the dice is recorded.
Here the possible values are whole numbers again, so we can not have values like 3.5, so again, this is a discrete variable.