Assume a population of $10^9$ people, tracked over a 1000 days. A person stays in a hotel for a probability of 1% in any given day. Each hotel hosts  100 people at a time.   How many pairs of people would've stayed at least twice together in the same hotel?
This is a summary of the excerpt:  Given that we have:  *$10^9$ people  *each person has a chance of 0.01 of going to a hotel  *we have $10^5$ hotels, each hotel holds 100 people  *Thus, $P(2 \text{ persons meet on the same hotel in any given day}) = 0.01 \cdot 0.01 \cdot 10^{-5}$  *and $P(2\text{ persons on the same hotel in $2$ day}) = P(2 \text{ persons on the same hotel in any given days})^2 = 10^{-18}$  the book "Mining of Massive Dataset" said that the expected number of pairs who stay in the same hotel for 2 days is:  $P(2 \text{ persons on the same hotel in $2$ days}) \cdot ( \text{number of pairs of people} ) \cdot (\text{number of pairs of days})$  this is the part where I got stuck. Can't understand how it come to this derivation. Can anybody explain it in more elaborate detail.  You can find the content on page 6 of this link:  (it is freely available)
If Z is a square integrable random variable such that $E[Z]&gt;0$, then prove that  $$P(Z\geq k) \geq \frac{(E(Z)-k)^2}{E(Z^2)} \forall k \in [0,E(Z)]. $$  This is a homework question and I don't even understand why the inequality is reversed comparing to Markov/Chebychev inequality. Should Cauchy-Schwartz inequality be used? If yes, then how to begin? Thanks a ton! How do I press Ctrl+Alt+Delete in VirtualBox? I'm running VirtualBox with Windows Vista as host OS and Windows Server 2008 as guest OS. To login to Windows Server I have to press Ctrl+Alt+Delete, but my host OS reacts on that so I can not send it to VirtualBox. How can I do it? We all know that in an idealised world all objects accelerate at the same rate when dropped regardless of their mass.  We also know that in reality (or more accurately, in air) a lead feather falls much faster than a duck's feather with exactly the same dimensions/structure etc.  A loose explanation is that the increased mass of the lead feather somehow defeats the air resistance more effectively than the duck's feather.  Is there a more formal mathematical explanation for why one falls faster than the other? Greyed-Out vs Invisible Generator of group $D_n$ What are your thoughts on epigraphs in theses? I am wondering if there is a general consensus as to the suitability of epigraphs in a thesis, either a single one at the start of the document, or an appropriate quote to begin every chapter.  For example, at the start of a technical chapter describing some code, I could write     Beware of bugs in the above code; I have only proved it correct, not tried it. - Donald E. Knuth   I am lucky to have complete freedom over how I choose to typeset my thesis (Master's thesis in astronomy) and I like the idea of a thematic quote to begin a chapter. However, I am wary of seeming unprofessional or tacky so I am curious to get some more thoughts on the matter. Q. Find all pairs $(p,n)$ of positive integers where $p$ is prime and $p^3-p=n^7-n^3$.   Rewriting the given equation as $p(p+1)(p-1)=n^3(n^2+1)(n+1)(n-1)$, we see that $p$ must divide one of the factors $n,n+1,n-1,n^2+1$ on the $\text{r.h.s}$.   Now, the $\text{l.h.s}$ is an increasing function of $p$ for $p\ge1$. This implies that for any given $n\ge1$, there is exactly one real $p$ for which $\text{l.h.s}=\text{r.h.s}$. For $p=n^2$, we get $\text{l.h.s}=n^6-n^2&lt;n^7-n^3=\text{r.h.s}.$ This means that either $p&gt;n^2$ or $p&lt;n^2$ must hold.  Assuming $p&gt;n^2$, it follows that the prime $p$ cannot divide any of $n,n+1,n-1$. So $p$ must divide $n^2+1$ and hence $p=n^2+1\quad (\because p&gt;n^2)$.  Substituting the value of $p$ in the given equation we get, $n^2+2=n^3-n\implies n^3-n^2-n=2$. As the factor $n$ on the $\text{l.h.s}$ must divide $2$, the above equation has a unique integer solution $n=2$.  Finally, we get $(5,2)$ as the solution to the given equation.      But how do I conclude this is the only solution possible? Also, why does'nt $p&lt;n^2$ (the case which I ignored) hold? As a bonus question, I would like to ask for any alternative/elegant solution (possibly using congruence relations) to the problem. Determining the structure of the quotient ring $\mathbb{Z}[x]/(x^2+3,p)$ Attending graduate school at my undergraduate university I've been told by numerous people that (1) my undergraduate university will be disinclined to bring me on as a graduate student, and that (2) it's a bad idea to attend grad school where you completed your undergraduate degree, anyway.  Is that true? If so, why? How do I give myself an item that can only be placed on a block with a certain damage value? Formation of ammonia from air and moisture On extended bicycle trips I sometimes slept under a plastic sheet, which helped with mosquitoes on hot nights. But there was a noticeable build-up of ammonia which made this almost impossible for more than an hour or so at a time.   Air is mostly nitrogen $(N_2)$ and there is always water (containing hydrogen) on a humid day. But I wonder about the mechanism for the formation of ammonia under these circumstances? There are (according to Wiki) trace amounts of methane and $H_2$ in the air. But methane and hydrogen (g) are I think pretty stable.   I wonder if the presence of exhaled air (containing $CO_2)$ could be a factor?  Thanks for any ideas. iOS navigation bar item image size I lost a couple hundred lines of a Vim plugin I wrote and continue back up every so often because I extracted a tar file containing an older version. I decided not to use source control management when I wrote the plugin, since I only update it periodically.  Why doesn't tar ask before overwriting existing files by default? I'm guessing that there's some rationale behind why the default behavior is to overwrite files silently, since we usually want safety over speed and convenience. For example, we usually use #ifdef NDEBUG, not #ifdef DEBUG; similarly, I would expect tar ask me before overwriting any files, and for it to have some flag which I can use to tell it to overwrite files without asking me. Also, how can make it so that tar does ask me by default, without me having to give it any flags? I'm fine with using tools other than tar, if they support this safer default behavior.  Thank you for your time! I am confused with the definition of non-parametric model after reading this link  and .   Originally I thought "parametric vs non-parametric" means if we have distribution assumptions on the model (similar to parametric or non-parametric hypothesis testing). But both of the resources claim "parametric vs non-parametric" can be determined by if number of parameters in the model is depending on number of rows in the data matrix.  For kernel density estimation (non-parametric) such a definition can be applied. But under this definition how can a neural network be a non-parametric model, as the number of parameters in the model is depending on the neural network structure and not on the number of rows in the data matrix?  What exactly is the difference between parametric and a non-parametric model? Find all real numbers $x$ for which $$\frac{8^x+27^x}{12^x+18^x}=\frac76$$  I have tried to fiddle with it as follows:   $$2^{3x} \cdot 6 +3^{3x} \cdot 6=12^x \cdot 7+18^x \cdot 7$$ $$ 3 \cdot 2^{3x+1}+ 2 \cdot 3^{3x+1}=7 \cdot 6^x(2^x+3^x)$$ Dividing both sides by $6$ gives us $$2^{3x}+3^{3x}=7 \cdot 6^{x-1}(2^x+3^x)$$  Is this helpful? If so, how should I proceed form here? If not any hints would be greatly appreciated. Creating point to center of polyline? I'm trying to create a points in the middle of polylines. The data is now in the form of shapefile. Is there an easy way to do this? Getting the array length of a 2D array in Java UITextField - capture return button event Should +1 and thanks comments be a declined flag? As a moderator for GD.SE I was always led to believe our role is to clean old comments as they are intended to be a temporary item depending on the level of context and if they add any benefit to an answer.  On SO I haven't had any issues or declines when I read old Q&amp;As and see +1 and thanks and flag.    However, on other sites when I read an old Q&amp;A and I see thanks or +1 I try to be courteous and flag them as I am aware moderators do get measured by their cleanup and I'm accustomed in doing so on SO but these flags are declined.    So this leads me to ask:   Should +1 and thanks comments be flagged and is the intended role of a comment still to be considered as temporary? What is the proper classification for a thanks or +1 comment if it should be flagged?   I didn't see any Q&amp;As on this topic after browsing the tags:   and searching led me to:  but that was several years old. Why is the ROC curve two-dimensional instead of three-dimensional?