Doubt with a Question on Linearity of Expectation Question:  With each purchase at SlurpeeShack, you receive one random piece of the puzzle seen at right. Once you collect all 12 pieces, you get a free Slurpee! What is the expected value for the number of purchases you will need to make in order to collect all 12 pieces?  My solution: The probability to collect any piece is p=1/(12).  The expected value to collect any piece i at a step is E(i)=1/p= 12 steps.  By linearity of expectation: the expected value of the sum of random variables is equal to the sum of their individual expected values, regardless of whether they are independent.  So, why can't we write E(x)= E(1) + E(2)+ E(3)+....E(12)=144.  The answer is 37.  Can anyone explain where am I wrong in my approach.
How many throws of a die until every possible result is obtained? A die is thrown until every possible result (i.e., every integer from 1 to 6) is obtained. Find the expected value of the number of throws.   How do I do that? I understand that probability for the single result is $\{1, 5/6, \ldots , 1/6\}$, but what about the expected value?
This question led to a new package:      I'm giving my students an old exam and barely remembered to change the date at the top. A colleague and I joked about how long we could reuse the same exam, and it made me wonder if I could use LaTeX to create an exam that looked like it was written in 1963 on a typewriter.  Here's what I'd like to see:   Typewriter font even in math mode. (Several ways to accomplish this; is there a "best" way?) Slight inconsistencies in the printing of each letter. I attempt this below adapting code taken from . Each word has a random vertical shift, though I'd like to see it reduced to each letter having its own vertical shift. Other typewriter-like irregularities would be great. It would be great if math-mode delimeters \left(, \right}, etc., can be created in a piece-meal fashion as they did in days of old. Fraction bars, tops of square-root symbols -- any horizontal line, really -- is made up of a series of en-dashes that don't quite match up.   Here is what I've come up with so far:  \documentclass[10pt]{article}% This is a document class providing more font size options \usepackage{graphicx} \usepackage{ifthen} \usepackage[textwidth=7.5in,textheight=9.5in]{geometry} \pagestyle{empty}  % thanks to Bruno Le Floch: https://tex.stackexchange.com/q/9331/4012 % and in his comments to https://tex.stackexchange.com/a/29458/4012 \usepackage[first=-1,last=1]{lcg}% you can play around with these values \makeatletter \newcommand{\globalrand}{\rand\global\cr@nd\cr@nd} \makeatother  \newcommand{\randomvshift}[1]{\globalrand\raisebox{\value{rand}pt}{#1}}  %%% thanks to Martin Scharrer: https://tex.stackexchange.com/q/11598/4012 \makeatletter \def\typewriter#1{%     \@typewriter#1 \@empty } \def\@typewriter#1 #2{%    \randomvshift{#1}\space    \ifx #2\@empty\else     \expandafter\@typewriter    \fi    #2% } \makeatother \begin{document}\tt  \typewriter{Math 101 Fall 1963}  \begin{enumerate} \item   \typewriter{$\frac{\texttt{d}}{\texttt{dx}}\texttt{(x)}^2$}  \item \typewriter{State the Fundamental Theorem of Calculus.}  \end{enumerate}  \end{document} pkexec command in a .desktop file I made a .desktop file for Androxyde's Flashtool (utility for Sony Xperia devices that I have to open with an executable file in its folder) that requires root privileges to use fastboot utilities. I used to make it work with gksu, but I'm on Ubuntu 15.04 and gksu is now old.  I tried to modify the exec line from Exec=gksu /home/natasha/FlashTool/FlashTool to Exec=pkexec /home/natasha/FlashTool/FlashTool Then, I read about pkexec doesn't allow to run X11 applications and so I override in this way:      The problem now is: It asks me the password but the Flashtool's GUI doesn't start. BUT if I execute that command in terminal, the program starts without problems. What can I do? Generate random numbers uniformly over an entire range Is it acceptable to nest parentheses? Is it acceptable to nest parentheses (for example, if I (meaning myself) write like this)? I'd like to install a  client for Xubuntu (12.04).  I'm getting non-English Google results, and I didn't find  in the Xubuntu repositories.   Does anyone know of a client that works well for Ubuntu or it's supported derivates (or installation instructions for grive?) Awesome symbols and characters in a bash prompt I just ran across a screenshot of someone's terminal:    Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right arrow? How do I craft command blocks? I went to my friends house, and he was playing Minecraft on the PC. He showed me a command block, but when I went home and opened Minecraft pocket edition, I went to the crafting table but I could not find any command blocks to craft.  What are command blocks and how do I craft them? Why didn't Gandalf or Frodo Fly to Mount Doom? Why didn't Gandalf use his eagles to fly over Mount Doom and drop the ring? I know he feared what he would do if the ring overpowered him, so why not just give Frodo an eagle? And, if there would be too much risk in flying the ring to Mordor, couldn't the eagles fly them part of the way?  Why risk it with such a long walk; far less risky to fly over most of the journey. A inequality proposed at Zhautykov Olympiad 2008 An inequality proposed at Zhautykov Olympiad 2008.     Let be $a,b,c &gt;0$ with $abc=1$. Prove that:    $$\sum_{\mathrm{cyc}}{\frac{1}{(a+b)b}} \geq \frac{3}{2}.$$   Set $a=\frac{x}{y}$, $b=\frac{y}{z}$, $c=\frac{z}{x}$.   Our inequality becomes: $$\sum_{\mathrm{cyc}}{\frac{z^2}{zx+y^2}} \geq \frac{3}{2}.$$  Now we use that: $z^2+x^2 \geq 2zx.$ $$\sum_{\mathrm{cyc}}{\frac{z^2}{zx+y^2}} \geq \sum_{\mathrm{cyc}}{\frac{2z^2}{z^2+x^2+2y^2}} \geq \frac{3}{2}.$$  Now applying Cauchy-Schwarz we obtain the desired result.  What I wrote can be found on this link: . But now, I don't know how to apply Cauchy-Schwarz.   Thanks:) How do I disable negative scaling? By default blender allows you to scale past 0 - how do I prevent this?  i.e. it's common in other 3D modelling software to resize a set of vertices against an axis to align them - however this isn't possible when negative scaling is enabled. What are the prerequisites to encounter the legendaries in ORAS? There are a lot of legendaries available in ORAS, however a lot of them will only show up/be available if certain prerequisites are met.  I know Groudon/Kyogre are available through the Story, and      Rayquaza &amp; Deoxys   through the postgame Delta episode, but what about the other available legendaries? What do I need to do to catch them? Let $f$ be entire and suppose that $\text{Im} f\ge0$. Show that $\text{Im} f$ is constant. How do you show that if $f$ is entire and if $\text{Im} f\ge0$, then $\text{Im} f$ is constant? Is this even true in the first place? What is the geometric meaning of the determinant of a matrix? I know that "The determinant of a matrix represents the area of ​​a rectangle." Perhaps this phrase is imprecise, but I would like to know something more, please.  Thank you very much. Convert .mov to .mp4 I want to convert .mov to .mp4! I saved the video from iMovie but it is in .mov format! How do I convert it to .mp4?  I'm using a MacBook and I want to share it to my phone, but my phone can't open .mov format video. Monty hall problem extended. I just learned about the Monty Hall problem and found it quite amazing. So I thought about extending the problem a bit to understand more about it. In this modification of the Monty Hall Problem, instead of three doors, we have four (or maybe $n$) doors, one with a car and the other three (or $n-1$) with a goat each (I want the car).  We need to choose any one of the doors. After we have chosen the door, Monty deliberately reveals one of the doors that has a goat and asks us if we wish to change our choice.  So should we switch the door we have chosen, or does it not matter if we switch or stay with our choice?  It would be even better if we knew the probability of winning upon switching given that Monty opens $k$ doors. How to sum $\sum_{x=0}^{N-1} \cos{\left( \frac{2\pi x}{N} \right)}^{2}$? I've tried solving it, but I'm not familiar with these kind of progressions and I couldn't get to a result. Also, I've found that the result is just $N/2$, but I don't get why would that be the answer, as it doesn't work for $N=1$ or $N=2$. Appreciate your help :) What does the above Error mean? What is an installation candidate?  I was trying to do  sudo apt-get install munin-memcached     and I get this message:  Reading package lists... Done Building dependency tree        Reading state information... Done Package munin-memcached is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package munin-memcached has no installation candidate   I googled for the problem and someone said to do a apt-get upgrade but it still did not solve my problem. Is there a way to see the history of questions protected by me or another user? Having a record of all actions taken on a site, as is provided by the &quot;activity&quot; and &quot;votes&quot; tabs of our profile, comes in handy very often. Perhaps the most common case is being able to find a question I've interacted with in the past, to see if anything has changed about it. This applies to questions a user has protected as much as anything else. Users are theoretically encouraged to unprotect questions when it's no longer necessary, as emphasized , but in practice they often do not. In many cases it's hard to blame them: unless they specifically marked it as a favourite, the site doesn't keep any record of the question to allow them to find it again. We should help users more easily review their own protections in the future.    For personal review, the votes tab is adequate, but there may also be value in displaying this publicly in the activity tab. There may be users with a history of repeatedly protecting questions over-eagerly. It would be useful to be able to review other users' protection histories to see if this is the case. Even if this is not available to regular users, it may be helpful to moderators, unless their user activity views already allow them to filter down to see this. How do I restore the sources.list file? I accidentally removed my /etc/apt/sources.list file. Is it hosted by Canonical somewhere so I can re-add it to the system? It's a bit of an emergency, so I hope someone can provide a quick answer. What licence is subscriber content provided under 4.0, 3.0 or them all?