i have searched a lot and i am not getting what exactly it is! Can any one please explain that what exactly it is by having examples or some other ways ? thanks.
If "x" is chosen "at random", from [0, 1], say with the uniform probability distribution, then x is a "random" variable. If we also define , y is also a "random variable". That is, a "random variable" is a variable whose value depends upon some probability distribution.
Random variables come in two types: discrete and continuous. In both cases, the random variable is a kind of bundle of information: possible outcomes and the probabilities assocated with those outcomes.
In the discrete case, you can list/label/name the outcomes, and assign each of them a probability. That information together *IS* the random variable.
Ex: X = random variable that's the flip of a fair coin. Outcomes are Heads and Tails. Associated probabilities are 1/2 for both outcomes. The data in those last two sentences is of two kinds, outcomes and probabilities associates with those outcomes. That data *IS* the random variable X. X is just a gathering together of that information.
That information might be written: Sample Space(X) = {Heads, Tails}. Prob(X=Heads) = 1/2. Prob(X=Tails) = 1/2.
There are some restrictions. The sample space for a discrete random variable must be finite (perhaps countable too - I'm not sure, but I'd assume so - look in your book). The probabilties must all be between 0 and 1, (inclusive at both 0 and 1), and sum over the whole sample space to be 1.
Continuous Random Variables are also sample space and associated probabilities, only now, the sample space is a certain subset of all possible subsets of some "continuous" space. The probabilities aren't presented as a list, but rather as function (probability density function) to be integrated to calculate the probabilities. The same kinds of restrictions apply: the probability density function should be everywhere non-negative and the integral over the whole space should be 1. The idea is still the same: a continuous random variable is two pieces of information, one says the kinds of outcomes, the other says the probability associated with those outcomes. It's just that in the continuous case, we present that information in a different manner - subsets of the big space, and a function to integrate over those subsets to tell you what the probability of a subset is.
For the continuous case, it usually amounts to this in practice: You're going to measure something, a time, a weight, a distance, whatever. Your measurement will be real number. The probability of measuring an exact particular number, like 12.92847893792741..., is zero. What has a positive probability will be that what you measured fell into a RANGE of numbers. It might be that Prob(10<X<14) = 0.7335.
Sometimes the discrete case is treated as a continuous case. If you're talking about thousands or millions of people, it's often easier to treat them as a continuum rather than a discrete set.
Ex: The total duration in minutes of a soccer (football) game, from the first whistle to the last, might be a continous random variable X. The probability density function p(t) might be given by:
p(t) = 0 for t<=90. p(t) = (t-90)^2/(36^3) for 90<t<=126. p(t) = (174-t)/((36)(48)) for 126 < t < 174, and p(t) = 0 for t >= 174.
That's 0, then a parabola, then a line, then 0. If I didn't mess up my calculations, the total area under p(t) is 1. The area under the parabola part (90<t<=126) is 1/3, and the area under the line part is 2/3 (126 < t < 174).
That defines a continuous random variable X, since it tells you what the possible outcomes are (RANGES of times = intervals) and what the assocated probabilities are for those outcomes(determined by integrating that probability function over that interval.)
For example, the probability that the game takes longer than 126 minutes = area under p(t) (integral!) between 126 and infinity, which comes out to be 2/3.
Write that as Prob(X>126) = 2/3.
For example, the probability the game takes between 120 and 130 minutes is given by:
(worked below)
-----------------------------------------------------------