I was sure that these are the same things but I do not get the difference reading about mass probability function
Suppose that $X: S → A (A \subseteq R)$ is a discrete random variable defined on a sample space S. Then the probability mass function $f_X: A → [0, 1]$ for X is defined as
$$f_X(x) = \Pr(X = x) = \Pr(\{s \in S: X(s) = x\})$$
Thinking of probability as mass helps to avoid mistakes since the physical mass is conserved as is the total probability for all hypothetical outcomes ''x'': $\sum_{x\in A} f_X(x) = 1$
Well, I just do not get this
The sample space of an experiment is the set of all possible outcomes of that experiment
Sample set, the set of samples is the same as set of outcomes, so we can also call it outcome set. I just do not get why to denote it by two different letters A and S above if these are the same things and why does the function maps the samples to outcomes if it is the same thing?
Is outcome a value of the sample? What is the value of the sample then? The functions map values to values. I need a value (of sample) so that function (aka random variable) could produce the value of outcome.
Edit1 I would like to thank who started to elaborate my question. It is not answered, however. I cannot accept it unless the following is resolved.
I did not get how events/observations are different from samples/outcomes. Also, I see that you identify samples with any type whereas outcomes are values (you wanted to say num types instead since any type also has values and variables). We, programmers, write functions in terms of arguments/variables. For readability and reliability, we constrain every variable to some type. The values/arguments are placeholders that take concrete values during realization at runtime. The types simply constrain the domain of the variables (types are the domains/set of available values for that variable/argument). I think that it is sorta the same in math, you just skip the name of variable when define function like $f: Int \rightarrow Real$. So, by 'anything', you mean 'value of any, not necessarily numerical, type'.
It remains unclear however what is the point of introducing the S domain (aka separating samples and outcomes). You take heads/tails and convert it into a number. Why not to sample real numbers right away (identify S with A, why heads/tails, how introducing S improves our understanding of mass probability function) or why not to make the conversion chain even longer introducing $S_{interm}$ for instance, so that you could sample and use a series of random variables to turn the sample into A, e.g. $S \xrightarrow {randomvar_1} S_{interm} \xrightarrow {randomvar_2} A$? Why not to say that I have 3 pennies and 1 dime and sample A={1,10} right away? Why play around with heads/tails instead?
It is also not clear why 'random variables' appear in the S -> A stage rather than in the sampling, to obtain values of S? Does it mean that generation of heads/tails is deterministic whereas mapping them to real domain, {1,10}, is random?
Back to the sample=outcome
. I see that Wikipedia says
similarly
A random variable is a real-valued function defined on a set of possible outcomes, the sample space Ω.
So, how can it be that random variable maps samples to outcomes if the outcomes are the domain rather than range of random variables? I think that all this confusion deserves clarification.