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 $\displaystyle y= x^2$, 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:
$\displaystyle Prob( 120 < X < 130) = \int_{120}^{130} p(t) dt = \frac{20}{81} \sim 24.7\%$ (worked below)
-----------------------------------------------------------
$\displaystyle \int_{120}^{130} p(t) dt = $
$\displaystyle = \int_{120}^{126} p(t) dt + \int_{126}^{130} p(t) dt = $
$\displaystyle = \int_{120}^{126} \frac{(t-90)^2}{36^3} dt + \int_{126}^{130} \frac{174-t}{(36)(48)} dt = $
$\displaystyle = \frac{1}{36^3} \int_{120}^{126} (t-90)^2 dt + \frac{1}{(36)(48)} \int_{126}^{130} (174-t) dt = $
$\displaystyle = \frac{1}{36^3} \ \left \frac{(t-90)^3}{3} \right\rvert_{120}^{126} + \left \frac{1}{(36)(48)} \ \frac{-(174-t)^2}{2} \right\rvert_{126}^{130}$
$\displaystyle = \frac{1}{36^3} \left\{ \frac{(126-90)^3}{3} - \frac{(120-90)^3}{3} \right\} + \frac{1}{(36)(48)} \left\{ \frac{-(174-130)^2}{2} - \frac{-(174-126)^2}{2} \right\}$
$\displaystyle = \frac{1}{3(36^3)} \left\{ (36)^3 - (30)^3 \right\} + \frac{1}{(2)(36)(48)} \left\{ -(44)^2 + (48)^2 \right\}$
$\displaystyle = \frac{36^3}{3(36^3)} - \frac{30^3}{3(36^3)} - \frac{44^2}{(2)(36)(48)} + \frac{48^2}{(2)(36)(48)}$
$\displaystyle = \frac{1}{3} - \frac{5^3}{3(6^3)} - \frac{11^2}{(2)(9)(12)} + \frac{2}{3} = \frac{1}{3} - \frac{125}{(2^3)(3^4)} - \frac{121}{(2^3)(3^3)} + \frac{2}{3}$
$\displaystyle = \frac{(2^3)(3^3)}{(2^3)(3^4)} - \frac{125}{(2^3)(3^4)} - \frac{363}{(2^3)(3^4)} + \frac{(2^4)(3^3)}{(2^3)(3^4)}$
$\displaystyle = \frac{1}{(2^3)(3^4)} ( (2^3)(3^3) - 125 - 363 + (2^4)(3^3) )$
$\displaystyle = \frac{1}{(2^3)(3^4)} ( (2^3)(3^3) - 488 + (2^4)(3^3) ) = \frac{1}{(2^3)(3^4)} ( (2^3)(3^3) - 488 + (2^4)(3^3) )$
$\displaystyle = \frac{1}{(2^3)(3^4)} ( (2^3)(3^3) - (8)(61) + (2^4)(3^3) )$
$\displaystyle = \frac{1}{3^4} ( 3^3 - 61 + (2)(3^3) ) = \frac{1}{3^4} ( - 61 + (3)(3^3) ) = \frac{1}{3^4} ( - 61 + 3^4 )$
$\displaystyle = \frac{1}{(3^4)} ( - 61 + 81 ) = \frac{20}{81} \sim 24.7\%$