If we have $n$ people there are $n(n-1)/2$ possible pairs that we can find. The probability that any two people have the same birthday is $1/365$. So for $n$ people the probability of finding at least one pair with the same birthday is $\frac{1}{365} \cdot \frac{n(n-1)}{2}$. Setting this to $50\%$ we get that $n=20$ and not $23$ as it should be. What is wrong with the solution?
So what I decided to do is to start a small case with only 3 people. There are three possible combinations that I could pair up the people, using the symbols A, B, and C to represent the persons involved: A&amp;B, A&amp;C, B&amp;C. The probability of each pair having the same birthday is $1\over365$ (the first guy gets any birthday, and the second guy only gets one birthday to choose from). What my intuition directed me to do next is to find the probability that any of the three events are true, or the union of the three events, which involved adding up the probabilities.   To put this generally, the equation for the probability SHOULD be:  ${n \choose 2} \div 365$  However, clearly this is not the case since $n \choose 2$ gets over 365 when $n = 28$. And with 28 people, there is obviously still a chance that they all have different birthdays (Person 1 has Jan. 1, Person 2 has Jan. 2. ... Person 28 has Jan. 28). Could anyone tell me what's wrong with my intuition? I don't want to know what's the right solution, I just want to know what's wrong with my solution .. it makes sense to my intuition, even though it's incorrect.
In the Harry Potter series, are wizards capable of creating their own spells, or are they limited to the spells that they're taught/learn?  I seem to remember something about Snape creating sectumsempra, but I'm not sure if that really is the case. I want to learn to use biper and biblatex in Lyx. This is how I would do it in LaTeX traditionally with biblatex and biber  \documentclass[12pt,a4paper,oneside,pdftex]{report} \usepackage[backend=biber]{biblatex} \addbibresource{minCuts.bib} ... \printbibliography \end{document}   The error is apparently originating from the \bibliographystyle command and biblatex package getting mixed, by . But I have no \bibliographystyle command in Preamble so they should not be mixed unless Lyx is somehow importing the \bibliographystyle.   How to resolve the biblioraphystyle error in Lyx with Biber and Biblatex?    Settings by the instructions  and Error        Document > Settings > Bibliography > Biber                  In Document > Settings > LaTeX Preamble                   Insert > List / TOC > BibTeX Bibliography...                        Package biblatex Error : '\bibliographystyle' invalid. Solve $p_4(x) = x^4 −(2m + 4)x^2 + (m−2)^2 $such that $p_4$ is a product of two non-constant integer-coeficient polynomials I'm having trouble getting the starting idea for a problem I've been presented with:  I need to find values for m (integer) such that the following polynomial     $p_4(x) = x^4 −(2m + 4)x^2 + (m−2)^2$; $m$ is integer   can be described as the product of two non-constant integer-coeficient polynomials.  Any help/pointers/tips on how to go about this are greatly appreciated!  Edit: I meant polynomials with integer coeficients, but for some reason typed positive. Differential equation with resonance Assuming String a and b:  a += b a = a.concat(b)   Under the hood, are they the same thing?  Here is concat decompiled as reference. I'd like to be able to decompile the + operator as well to see what that does.  public String concat(String s) {      int i = s.length();     if (i == 0) {         return this;     }     else {         char ac[] = new char[count + i];         getChars(0, count, ac, 0);         s.getChars(0, i, ac, count);         return new String(0, count + i, ac);     } } How to create an interactive bash script to collect arguments for a command in linux? I'm trying to create an interactive bash script where I can collect user input variables to be used as arguments in another command. Can someone provide me an example of this?  Currently i want to do:   what type of content you want to delete? what is the status?   then feed it into a mysql delete query command. I have the following reference:  @MISC{EX2012,   author = {{S}ingle {A}uthor {O}rganization},   year = {2012},   title = {Example} }   A citation for this is breaking after "Author", but extending beyond the margin, as shown in the following example layout in the PDF:  Demo text demo text demo to margin Demo text which cites it (Single Author Organization, 2012) and flows over the margin.   How can I solve this? I am using natbib and citing with \citep{EX2012}. I'm using R(3.1.1), and ARIMA models for forecasting. I would like to know what should be the &quot;frequency&quot; parameter, which is assigned in the ts() function, if im using time series data which is:  separated by minutes and is spread over 180 days (1440 minutes/day) separated by seconds and is spread over 180 days (86,400 seconds/day).  If I recall right the definition, a &quot;frequency&quot; in ts in R, is the number of observations per &quot;season&quot;. Question part 1: What is the &quot;season&quot; in my case? If the season is &quot;day&quot;, then is the &quot;frequency&quot; for minutes = 1440 and 86,400 for seconds? Question part 2: Could the &quot;frequency&quot;  also depend on what I am trying to achieve/forecast? for example, in my case, I'd like to have a very short-term forecast. One-step ahead of 10minutes each time. Would it then be possible to consider the season as an hour instead of a day? In that case frequency= 60 for minutes, frequency = 3600 for seconds? I've tried for example to use frequency = 60 for the minute data and got better results compared to frequency = 1440 (used fourier see link below by Hyndman)  (The comparison was made by using MAPE for the measure of forecast accuracy) In case the results are complete arbitrary, and the frequency cannot be changed. What would be actually the interpretation of using freq = 60 on my data? I also think it's worth mentioning that my data contains seasonality at every hour and every two hours (by observing the raw data and the Autocorrelation function) Configuring ADB for Nexus 4 on Ubuntu 11.10 In Ubuntu 18.04 I'm not able to assign Ctrl+Alt+← or Ctrl+Alt+→ to anything. To be precise I may bind it to something, but it doesn't work when using the keyboard combination, up/down arrows do however work.   .  The strange thing is that the system detects the keyboard combinations when assigning a key, but not when trying to use them. As a result the keyboard combinations don't work in any other programs either. Is there a more efficient way to clamp real numbers than using if statements or ternary operators? I want to do this both for doubles and for a 32-bit fixpoint implementation (16.16). I'm not asking for code that can handle both cases; they will be handled in separate functions.  Obviously, I can do something like:  double clampedA; double a = calculate(); clampedA = a &gt; MY_MAX ? MY_MAX : a; clampedA = a &lt; MY_MIN ? MY_MIN : a;   or  double a = calculate(); double clampedA = a; if(clampedA &gt; MY_MAX)     clampedA = MY_MAX; else if(clampedA &lt; MY_MIN)     clampedA = MY_MIN;   The fixpoint version would use functions/macros for comparisons.  This is done in a performance-critical part of the code, so I'm looking for an as efficient way to do it as possible (which I suspect would involve bit-manipulation)   EDIT: It has to be standard/portable C, platform-specific functionality is not of any interest here. Also, MY_MIN and MY_MAX are the same type as the value I want clamped (doubles in the examples above). Interactive pixel information of an image in Python? What is the difference between "var=${var:-word}" and "var=${var:=word}"? Given the differential equation $$\dot x = -2x + u$$ determine the optimal control law $u = - kx$ that minimizes the performance index $$J = \int_0^{\infty} x^2 \, \mathrm d t$$  My approach was to find the state feedback $k$. But since the value of $R$ (positive semidefinite Hermitian) is not given, that means $R=0$. How do I determine the optimal control for this system where $R=0$? It said  that:     [....] Rijndael can be specified with block and key sizes in any multiple of 32 bits, with a minimum of 128 bits. The blocksize has a maximum of 256 bits, but the keysize has no theoretical maximum.   How would the key schedule look for these other key sizes, like a 136-bit key? Problems when adding a fillable PDF form if the page is rotated Why does an unhinged body rotate about its centre of mass? What are the Undying Lands? I've heard a lot about the Undying Lands but I don't fully understand how they're different from Middle-earth and why only certain people/races are allowed to go there.  Can someone explain? When conducting multiple regression, when should you center your predictor variables & when should you standardize them? Penalized models can be used to estimate models where the number of parameters is equal to or even greater than the sample size. This situation can arise in log-linear models of large sparse tables of categorical or count data. In these settings, it is often also desirable or helpful to collapse tables by combining levels of a factor where those levels are not distinguishable in terms of how they interact with other factors. Two questions:   Is there a way to use penalized models such as LASSO or elastic net to test for the collapsibility of levels within each factor? If the answer to the first question is yes, can, and should, this be set up in such a way that the collapse of levels and the estimation of model coefficients occurs in a single step?