To go with the Lego Movie, Lego sell minifigures of the characters from the movie.  They are sold in packets, where each packet contains one minifigure, and from the outside of the packet it is impossible to tell which minifigure is inside. There are $n$ minifigures to collect.  Assuming that each packet that my son buys is equally likely to contain any one of the minifigures, show that the expected number of packets that he needs to buy to collect the whole set is approximately $n \log n$.  [Hint: express the random variable that is the total number of packets as a sum of simpler random variables, and use linearity of expectation.]
What is the average number of times it would it take to roll a fair 6-sided die and get all numbers on the die?  The order in which the numbers appear does not matter.  I had this questions explained to me by a professor (not math professor), but it was not clear in the explanation.  We were given the answer $(1-(\frac56)^n)^6 = .5$ or $n = 12.152$  Can someone please explain this to me, possibly with a link to a general topic?
Sometimes it is convenient to use an absolute path to include a preamble. To do so, I use the following "hack":  \documentclass[a4paper, 12pt]{article} \newcommand{\folder}{/path/to/folder} \input{\folder/preamble}  \begin{document} \end{document}   Now my question is, whether there is a more elegant way to do this, especially a way which is compatible with one of the flatten scripts from  ? Rights if we possess Carta di Soggiorno? Product of binomial coefficient as a basis Is it possible to plot a graph of any shape? In school, I have learnt to plot simple graphs such as $y=x^2$ followed by $y=x^3$.  A grade or two later, I learnt to plot other interesting graphs such as $y=1/x$, $y=\ln x$, $y=e^x$. I have also recently learnt about trigonometric graphs and circle equations. In the internet, I have seen users posting graphs of different shapes like a heart-shaped graph and a Batman logo-shaped graph. I am sure there are numerous more graphs that I have yet to see. Seeing that the graphs can be shaped into shapes like the Batman logo and a heart brings me to my question: Is it possible to plot a graph of any shape regardless of its complexity? Perhaps, shaped into an outline of a person or a landmark? Why or why not? How does the T-1000 see? In Terminator 2: Judgement Day, how does the T-1000 sense things? It's made of mimetic poly alloy; however, does it have a retinal scan camera like the T-X or T-800, or is just molecules that allow it to see what it does? In other words: let's say it is made out of nanobots. Would a group of these nanobots provide the capability of sight? Kind of like humans with cells that  make up the brain? I have always wondered whether James Cameron explained this on a special edition or if the topic was left up for insight from Terminator fans. From what I get from the whole mimetic poly alloy and some of the extra scenes, it seems to feel its way out to get information. Of course, it's very much not blind! Thoughts? Centos recently updated to 7.3 and there's been problems with sshd sftp group permissions. I have one user that is chrooted to it's home directory, and that user is in group sftponly. Then i have the /var/www directory, which has 775 permissions and owner is apache and owner group is sftponly. I have a bind link pointing from /home/user/files/web --> /var/www, so the user can access /var/www even though being chrooted to it's home directory. I can view files in /var/www with that user, but impossible to edit or add anything. This worked fine before the big Centos 7.3 update, and now it's stopped working. Any ideas? Hi everyone I'm attempting to install spotify, I've been running linux for less than 24 hours so please cut me some slack if this seems trivial. Here is a link to the webpage  and the example script.         Add this line to your list of repositories by editing your /etc/apt/sources.list    deb http://repository.spotify.com stable non-free    If you want to verify the downloaded packages, you will need to add our public key  sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 94558F59    Run apt-get update  sudo apt-get update    Install spotify!      sudo apt-get install spotify-client      would someone be nice enough to walk me through this? I'm not even sure where to start. I am building a java server that needs to scale. One of the servlets will be serving images stored in Amazon S3.  Recently under load, I ran out of memory in my VM and it was after I added the code to serve the images so I'm pretty sure that streaming larger servlet responses is causing my troubles.  My question is : is there any best practice in how to code a java servlet to stream a large (>200k) response back to a browser when read from a database or other cloud storage?  I've considered writing the file to a local temp drive and then spawning another thread to handle the streaming so that the tomcat servlet thread can be re-used. This seems like it would be io heavy.  Any thoughts would be appreciated. Thanks. If $g \circ f$ is surjective, show that $f$ does not have to be surjective? What are metaclasses in Python? Split comma-separated strings in a column into separate rows I'm a computer student, learning math just for fun. Today I was  that I found something strange! I noticed that that wired function ${x^{x^{\cdot^{\cdot^{x}}}}}$ in zero, seems to converge to 1 when there are even powers and to 0 when there are odd powers! Then I attempt to prove it but I failed.  Then I did a little research and I found the  article on Wikipedia. This article says that my guess was right but without any proof. So I'm here to ask you about it.     If we define ${x^{x^{\cdot^{\cdot^{x}}}}}$ as ${^{n}x} :=\begin{cases} 1 &amp;\text{if }n=0 \\ x^{\left(^{(n-1)}x\right)} &amp;\text{if }n&gt;0 \end{cases}$      then prove:      $$\lim_{x\rightarrow0} {}^{n}x = \begin{cases}   1, &amp; n \text{ even} \\  0, &amp; n \text{ odd} \end{cases}$$ How can one cite theorems of references? I would like to cite the item (iii) of proposition 3 of a reference. How can I do it? Which ways do you suggest? This is a question not only about LaTeX, but also about style. One option I have seen to cite pages of a reference is \cite[p.~333]{Audet}. Is there something similar to cite theorems, propositions and so on? “Are” vs. “is” after “parents and the family” How do I write an Apex unit test? This is a canonical question and answer developed by the community to help address common questions. If you've been directed here, or your question has been closed as a duplicate, please look through the resources here and use them to shape more specific questions. To browse all canonical questions and answers, including more unit test resources, navigate to the  tag.  This canonical question is intended to address several classes of common questions by providing a quick summary and links to comprehensive resources:   How do I start writing my first unit test?  How do I unit test this code?  I need help writing this unit test.   Salesforce Stack Exchange looks for detailed, specific questions that the community can help you with, and can't write tests on your behalf. We feel that working with the resources below can help you get started, and we encourage you to make an attempt to write your test and return to SFSE with your specific questions when you encounter challenges you can't resolve. Generate random numbers uniformly over an entire range I need to generate random numbers within a specified interval, [max;min].  Also, the random numbers should be uniformly distributed over the interval, not located to a particular point.  Currenly I am generating as:  for(int i=0; i&lt;6; i++) {     DWORD random = rand()%(max-min+1) + min; }   From my tests, random numbers are generated around one point only.  Example min = 3604607; max = 7654607;   Random numbers generated:  3631594 3609293 3630000 3628441 3636376 3621404   From answers below: OK, RAND_MAX is 32767. I am on C++ Windows platform. Is there any other method to generate random numbers with a uniform distribution? Doubles rules in table tennis Why are two permutations conjugate iff they have the same cycle structure? I'm trying to identify fantasy book series I encountered some time ago. Here are things I remember:   it was a fantasy setting but with some s-f elements; with many worlds and possibility to travel between them; resembling  setting a little, the two main races were non-human and probably hostile to each other,  a labyrinth (?), which somehow played an important role in the plot, a protagonist was some kind of emissary and was sent on a mission to another worlds  time period: 80s - 90s    Does anyone know what it is the name of the series? Close and flag links do nothing on mobile site