Can you help me out with drawing a simple cumulative distribution function of a discrete variable, which has the following values:
x=1, f(x)=1/15;
x=2, f(x)=2/15;
x=3, f(x)=1/5;
x=4, f(x)=4/15;
x=5, f(x)=1/3
Most resources show how to do it for continuous variables. The question is very trivial because I am a newbie. Thank you.
EDIT:
\documentclass[paper=a4, fontsize=11pt]{scrartcl} % A4 paper and 11pt font size
\usepackage[T1]{fontenc} % Use 8-bit encoding that has 256 glyphs
\usepackage{fourier} % Use the Adobe Utopia font for the document - comment this line to return to the LaTeX default
\usepackage[english]{babel} % English language/hyphenation
\usepackage{amsmath,amsfonts,amsthm} % Math packages
\usepackage{lipsum} % Used for inserting dummy 'Lorem ipsum' text into the template
\usepackage{sectsty} % Allows customizing section commands
\allsectionsfont{\centering \normalfont\scshape} % Make all sections centered, the default font and small caps
\usepackage{fancyhdr} % Custom headers and footers
\usepackage{xfrac}
\pagestyle{fancyplain} % Makes all pages in the document conform to the custom headers and footers
\fancyhead{} % No page header - if you want one, create it in the same way as the footers below
\fancyfoot[L]{} % Empty left footer
\fancyfoot[C]{} % Empty center footer
\fancyfoot[R]{\thepage} % Page numbering for right footer
\renewcommand{\headrulewidth}{0pt} % Remove header underlines
\renewcommand{\footrulewidth}{0pt} % Remove footer underlines
\setlength{\headheight}{13.6pt} % Customize the height of the header
\numberwithin{equation}{section} % Number equations within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{figure}{section} % Number figures within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\numberwithin{table}{section} % Number tables within sections (i.e. 1.1, 1.2, 2.1, 2.2 instead of 1, 2, 3, 4)
\setlength\parindent{0pt} % Removes all indentation from paragraphs - comment this line for an assignment with lots of text
%----------------------------------------------------------------------------------------
% TITLE SECTION
%----------------------------------------------------------------------------------------
\newcommand{\horrule}[1]{\rule{\linewidth}{#1}} % Create horizontal rule command with 1 argument of height
\title{
\normalfont \normalsize
\textsc{\LARGE XXXX} \\ [20pt]
\textsc{ XXX} \\ % Your university, school and/or department name(s)
\textsc{ XXX} \\ [20pt]
\horrule{0.5pt} \\[0.4cm] % Thin top horizontal rule
\huge Problem Set 1 \\ % The assignment title
\horrule{2pt} \\[0.5cm] % Thick bottom horizontal rule
}
\author{XXX \textsc{XXX}} % Your name
\date{\normalsize\today} % Today's date or a custom date
\begin{document}
\maketitle % Print the title
%----------------------------------------------------------------------------------------
% PROBLEM 1
%----------------------------------------------------------------------------------------
1. Let X be a discrete random variable with density function
\[ P(x) = \left\{
\begin{array}{l l}
cx & \quad \text{for $x$ =1, 2, 3, 4, 5}\\
0 & \quad \text{otherwise}
\end{array} \right.\]
\\ The discrete probability density function (PDF) of a discrete random variable $X$ provides the probabilities P($X=x$) for all possible values of $x$. In our case, \\
P($x$=1)=$1\times c$,\\
P($x$=2)=$2\times c$,\\
P($x$=3)=$3\times c$,\\
P($x$=4)=$4\times c$,\\
P($x$=5)=$5\times c$, $0$ otherwise\\
$1\times c + 2\times c +3\times c +4\times c +5\times c=1 \rightarrow c=\dfrac{1}{15}$
The probability density function for $X$ is:\\
\begin{tabular*}{1\textwidth}{@{\extracolsep{\fill} } | c | c | c | c | c | c |}
\hline
x & 1 & 2 & 3 & 4& 5 \\ [1ex]
\hline
\raisebox{2ex}f(x)& $1\times \dfrac{1}{15}=\dfrac{1}{15}$ & $2\times \dfrac{1}{15}=\dfrac{2}{15}$ & $3\times\dfrac{1}{15} =\dfrac{1}{5}$ & $4\times \dfrac{1}{15}=\dfrac{4}{15}$ & $5\times \dfrac{1}{15} =\dfrac{1}{3}$ \\ [1.5ex]
\hline
\end{tabular*}\\\\
A. What is $c$? \\\\
$c=\dfrac{1}{15}$ \\\\
B. Find P($X$ is odd).\\\\
P($X$ is odd)$= P($X$ =1)+ P($X$ =3)+ P($X$ =5)=\dfrac{1}{15}+\dfrac{1}{5}+\dfrac{1}{3}=\dfrac{9}{15}$ \\\\
C. What is the cumulative distribution function for X? Plot the function.\\\\
$P(X\leq1)=\dfrac{1}{15}$\\\\
$P(X\leq2)=\dfrac{1}{15}+\dfrac{2}{15}=\dfrac{1}{5}$\\\\
$P(X\leq3)=\dfrac{1}{15}+\dfrac{2}{15}+\dfrac{1}{5}=\dfrac{6}{15}$\\\\
$P(X\leq4)=\dfrac{1}{15}+\dfrac{2}{15}+\dfrac{1}{5}+\dfrac{4}{15}=\dfrac{2}{3}$\\\\
$P(X\leq5)=\dfrac{1}{15}+\dfrac{2}{15}+\dfrac{1}{5}+\dfrac{4}{15}+\dfrac{1}{3}=1$\\\\
\\\\
\\\\
\\\\
\\\\
\\\\
\\\\
\end{document}


\documentclass{...}and ending with\end{document}. – Aug 28 '14 at 15:44destroymy edit? ;-) – Aug 28 '14 at 16:06