Making a basic math quiz program java
How do I compare strings in Java?
I am writing a few rather large pseudocode functions using algorithm and algorithmic, i.e. my code looks something like:  \begin{algorithm}                      \caption{Coolest Algorithm ever}           \label{findme}                           \begin{algorithmic} [1]                   % enter the algorithmic environment \REQUIRE    Here are a few variables \\             variable 2 \\             variable 3  \ENSURE     this is the output \\             output 2  \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \STATE $some cool code here$ \end{algorithmic} \end{algorithm}   Unfortunately this code does not fit on one page and I am definitely not able to split it into some subfunctions or so (I already did that as far as possible).  So now I need to split up the algorithm into two pages, but I have no idea how.  The easiest way I can imagine is just to start a new algorithm on the new page, but this time letting the line counter start at line 35 or so instead of 1. But how can I do that?  Please not that there is already a similar question here on this site, but it deals with the package algorithmicx. Our admins deployed a new version of Notepad++ (version 6.3) on our machines, and this version is highlighting all changes done in a file by default. It does so by setting the background color of every modified line to a bright orange, which I find very distracting.  We  have dozens of plugins installed, but I double checked and we do not have the "Change Markers" plugin (which could be the culprit).  Any idea where I can disable this feature? Changing the highlight color could also be an option. The X button stopped working on one of my PS3 controllers. It's hardly through abuse, the controller isn't a year old and I don't play a lot.  The button doesn't stick, it presses like the others, only the system isn't aware that I'm using it. I tried resetting it with the tiny reset button in the back, to no avail.  What can I do? I am reading Velleman's "How to Prove it", and in one example he proves  $\neg \exists x P(x)  \implies \forall x \neg P(x)$    in the following way:    Suppose $\neg \exists x P(x)$. Let x be arbitrary. Suppose $P(x)$. Since we have a specific $x$ for which P(x) is true, it follows that $\exists x P(x)$, which is a contradiction. Therefore $\neg P(x)$. Since $x$ was arbitrary, we can conclude that $\forall x \neg P(x)$, so $\neg \exists x P(x)  \implies \forall x \neg P(x)$    What makes me confused is the line in bold text, that is "Suppose $P(x)$". The reason is that he writes that he is doing proof by contradiction, but $P(x) \not\iff \neg\forall x \neg P(x)$. He is not treating all possible cases where $\forall x \neg P(x)$ is false by assuming $P(x)$, does he? So how can this be a valid proof by contradiction?    Edit: I deleted my first example since it was clearly not representative for the problem.  Edit 2: So the thing that I am opposing I guess is that $\neg \forall x \neg P(x)$ is not $P(x)$. And from what I have undestood, a proof by contradiction should use the negation of the consequent which I do not think that Velleman does. Is there a BNF grammar of the TeX language? I'm looking for a BNF grammar of the TeX language, does it exist?  EDIT  For those of us who are not computer scientists, a BNF grammar is one kind of formal description of a CFG: .  For those who don't know their Chomsky, a CFG is a , which means (very roughly) that substitutions can be made independently of their use context. Why I can't connect to VPS after changing OS from CentOS to Ubuntu? I want to implement the EM algorithm manually and then compare it to the results of the normalmixEM of mixtools package. Of course, I would be happy if they both lead to the same results. The main reference is Geoffrey McLachlan (2000), .  I have a mixture density of two Gaussians, in general form, the log-likelihood is given by (McLachlan page 48):      $$ \log L_c(\Psi) = \sum_{i=1}^g \sum_{j=1}^n z_{ij}\{\log \pi_i + \log f_i(y_i;\theta_i)\}. $$ The $z_{ij}$ are $1$, if the observation was from the $i$th component density, otherwise $0$. The $f_i$ is the density of the normal distribution. The $\pi$ is the mixture proportion, so $\pi_1$ is the probability, that an observation is from the first Gaussian distribution and $\pi_2$ is the probability, that an observation is from the second Gaussian distribution.   The E step is now, calculation of the conditional expectation:      $$ Q(\Psi;\Psi^{(0)}) = E_{\Psi(0)}\{\log L_c(|\Psi)|y\}. $$ which leads, after a few derivations to the result (page 49):      \begin{align} \tau_i(y_j;\Psi^{(k)}) &amp;= \frac{\pi_i^{(k)}f_i(y_j;\theta_i^{(k)}}{f(y_j;\Psi^{(k)}}  \\[8pt]                        &amp;= \frac{\pi_i^{(k)}f_i(y_j;\theta_i^{(k)}}{\sum_{h=1}^g \pi_h^{(k)}f_h(y_j;\theta_h^{(k)})} \end{align} in the case of two Gaussians (page 82):      $$ \tau_i(y_j;\Psi) = \frac{\pi_i \phi(y_j;\mu_i,\Sigma_i)}{\sum_{h=1}^g \pi_h\phi(y_j; \mu_h,\Sigma_h)} $$ The M step is now the maximization of Q (page 49):      $$ Q(\Psi;\Psi^{(k)}) = \sum_{i=1}^g\sum_{j=1}^n\tau_i(y_j;\Psi^{(k)})\{\log \pi_i + \log f_i(y_j;\theta_i)\}. $$ This leads to (in the case of two Gaussians) (page 82):      \begin{align} \mu_i^{(k+1)} &amp;= \frac{\sum_{j=1}^n \tau_{ij}^{(k)}y_j}{\sum_{j=1}^n \tau_{ij}^{(k)}}  \\[8pt] \Sigma_i^{(k+1)} &amp;= \frac{\sum_{j=1}^n \tau_{ij}^{(k)}(y_j - \mu_i^{(k+1)})(y_j - \mu_i^{(k+1)})^T}{\sum_{j=1}^n \tau_{ij}^{(k)}} \end{align} and we know that (p. 50)      $$ \pi_i^{(k+1)} = \frac{\sum_{j=1}^n \tau_i(y_j;\Psi^{(k)})}{n}\qquad (i = 1, \ldots, g). $$ We repeat the E, M steps until $L(\Psi^{(k+1)})-L(\Psi^{(k)})$ is small.        I tried to write a R code (data can be found ).    # EM algorithm manually # dat is the data  # initial values pi1       &lt;-  0.5 pi2       &lt;-  0.5 mu1       &lt;- -0.01 mu2       &lt;-  0.01 sigma1    &lt;-  0.01 sigma2    &lt;-  0.02 loglik[1] &lt;-  0 loglik[2] &lt;- sum(pi1*(log(pi1) + log(dnorm(dat,mu1,sigma1)))) +               sum(pi2*(log(pi2) + log(dnorm(dat,mu2,sigma2))))  tau1 &lt;- 0 tau2 &lt;- 0 k    &lt;- 1  # loop while(abs(loglik[k+1]-loglik[k]) &gt;= 0.00001) {    # E step   tau1 &lt;- pi1*dnorm(dat,mean=mu1,sd=sigma1)/(pi1*dnorm(x,mean=mu1,sd=sigma1) +            pi2*dnorm(dat,mean=mu2,sd=sigma2))   tau2 &lt;- pi2*dnorm(dat,mean=mu2,sd=sigma2)/(pi1*dnorm(x,mean=mu1,sd=sigma1) +            pi2*dnorm(dat,mean=mu2,sd=sigma2))    # M step   pi1 &lt;- sum(tau1)/length(dat)   pi2 &lt;- sum(tau2)/length(dat)    mu1 &lt;- sum(tau1*x)/sum(tau1)   mu2 &lt;- sum(tau2*x)/sum(tau2)    sigma1 &lt;- sum(tau1*(x-mu1)^2)/sum(tau1)   sigma2 &lt;- sum(tau2*(x-mu2)^2)/sum(tau2)    loglik[k] &lt;- sum(tau1*(log(pi1) + log(dnorm(x,mu1,sigma1)))) +                 sum(tau2*(log(pi2) + log(dnorm(x,mu2,sigma2))))   k         &lt;- k+1 }   # compare library(mixtools) gm &lt;- normalmixEM(x, k=2, lambda=c(0.5,0.5), mu=c(-0.01,0.01), sigma=c(0.01,0.02)) gm$lambda gm$mu gm$sigma  gm$loglik   The algorithm is not working, since some observations have the likelihood of zero and the log of this is -Inf. Where is my mistake? What is the optimal path between $2$ fixed points around an invisible obstructing wall? Is RSA key size the size of private key exponent? I have implemented a key pair generation scheme for RSA algorithm. I have taken the length of private key exponent as RSA key size, but then I've got to know that RSA key size is the size of the modulus $n$. Is it wrong to take RSA key size as the size of the private key exponent?  To generate a private key of 1024 bits, I increase the size of private key exponent regardless the modulus $n$. Why are naturals < modulus equal if congruent? [uniqueness of remainder] Let $a$, $b$, and $n$ be integers with $0 \le a \lt n$ and $0 \le b \lt n$. Suppose $a \equiv b \pmod n$. Then $a-b=0$ and $a=b$. Why does the congruence of two non negative integers imply that they must be equal? Automatically determine tags while writing a question Can we modify "Ask question" to automatically suggests tags based on your question content.   So instead that user needs to type "team-foundation-server" or "TFS" or "TeamFoundationServer" he will see list of tags auto-populated with ajax which he (or she) can then select and it will be associated with the question. So basically only thing we need is code which will cross-match question content with list of known tags while user is typing and display results in some nice ajax-enabled list/cloud/whatever UI control. This should be separate control for tags suggestions so user still has option to use standard tag list input to type-in tags.  In this case, instead of three (or more) tag variations we would have only one tag for Team-Foundation-Server. How can I play encrypted DVD movies? My machine can't play encrypted DVDs on a fresh install.  How do I add this capability?  Another useful bit of information would be what programs are best for playing DVDs, once I'm able to do so.  See the .  Will I be able to play DVD movies from ? What's the keyboard shortcut for keyboard layout switch in Mojave? Shift + Control + Space doesn't seem to work anymore. Many times I see that URL extensions are hidden (e.g. .html, .php), but not all websites do this.  Why do webmasters hide the extension? Is it for security, for the URL to look cleaner, or for some other purpose? Show that a holomorphic function satisfying $|f(z)|\leq c|z|^n$ must be $f(z)=a\cdot z^n$ for some a. Let $f:\mathbb{C}\to\mathbb{C}$ be a holomorphic function such there exists a $c\in\mathbb C$ with $|f(z)|\leq c\cdot |z|^n$ for all $z\in\mathbb C$. Show that there exists an $a\in\mathbb C$ with $f(z)=a\cdot z^n$.   Proof.  My general idea is to show that the taylor series only has one non-zero coefficient:  $\displaystyle |a_k|\leq\frac{k!}{2\pi}\oint_{|w|=r}\frac{|f(w)|}{|w|^{k+1}}dw\leq \frac{k!}{2\pi}\oint_{|w|=r}\frac{c\cdot|w|^n}{|w|^{k+1}}dw\leq \\\displaystyle\leq \frac{c\cdot k!}{2\pi}\oint_{|w|=r}|w|^{n-k-1}dw$  Now using the standard estimate since $\oint=2\pi r$:  $\displaystyle \leq c\cdot k!\cdot r^{n-k}\longrightarrow\begin{cases}0,\ k&gt;n\\c\cdot n!,\ k=n\\ \infty,\ k&lt;n\end{cases}$ as $r\to\infty$  In conlusion the taylor series for now looks like $f(z)=\sum_{k=0}^{n-1}a_k z^k+ a_n z^n$ with $|a_n|\leq n!\cdot c$. What do I do with the remaining summands?  Edit: I would say that for $k&lt;n$ we have $|z|^k&gt;|z|^n$ for $z\in D_1(0)$. So since the estimate has to hold for all $z\in \mathbb C$ we can't have that either. This has happened to me many times in the last 5 years: an upgrade broke my system. Each time I end up with this situation, I have to reinstall the whole system, which is really annoying.  Is there any way to roll back the most recent upgrade to be able to have a functional system without reinstalling? If not, which is the best way to suggest this as a top priority idea?   I read this idea was described in brainstorm.ubuntu.com, but it feels it is dead... and the forums are full of examples of upgrades breaking things, that's why I feel something needs to be done about this topic. Thanks! I am an international student in the US (important as my stay in US is tied to my student visa, issued to attend my current university).  I joined as a grad student in the MS CS program in one of the okayish public universities (ranked ~50 on QS/US news). I joined in Fall '18 and am still in my first semester. I took all the so-called "difficult" courses, but I find them very trivial (considering my undergrad was from a very good university). I am very disappointed with the curriculum and feel the coursework is not at all rigorous for a grad-school.  I might sound super arrogant, but I feel out-of-place when I talk to other students and hear them cringe about how hard the courses are, or how they don't have enough time to finish assignments within the deadlines as I find all of the coursework very trivial and feel that the assignments are a joke.   Fortunately, I am working with one of the best profs the university has to offer on a very impactful project and the research is going great. But that's the only plus point I see from sticking around.  My aim from grad school is to get research experience and join one of the Big 4s or upcoming CS unicorn startups. I cannot see myself joining one of the Big-Ns after graduating since the students from this school rarely bag a Google/Fb/unicorn startup job.  Since December is the Fall'19 admissions deadline, I am thinking about reapplying to those top 10 CS schools which I couldn't get into last year (probably because of my poor undergrad GPA).   On the other hand, since every CS company just asks leetcode-style questions in interviews, I can just be super good at it and try to nail whatever interview I get without wasting another year and then doing the same.  I'm not really interested in any kind of credit transfer either since I would like to start fresh in a more rigorous curriculum.  I'm not sure if switching schools would be a wise decision and could really use some advice from the community here.  PS :  Probably related -   Posting with a dummy account for anonymity. Why would Littlefinger want this person dead? if $f^{(n)}(x_0),g^{(n)}(x_0)$ exist and $\lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n}=0$ then $f^{(r)}(x_0)=g^{(r)}(x_0 )$ for all $0\leq r\leq n.$ Show:   if $f^{(n)}(x_0),g^{(n)}(x_0)$ exist and   $$\lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n}=0$$   then $f^{(r)}(x_0)=g^{(r)}(x_0 )$ for all $0\leq r\leq n.$   My attempt:  let n = 1,  since $f'(x_0),g'(x_0)$ exists then The taylor polynomial exists: $$T_{f,1}(x)=f(x_0)+f'(x_0)(x-x_0), \lim_{x\to x_0} \dfrac{f(x)-T_{f,1}(x)}{(x-x_0)}=0$$  $$T_{g,1}(x)=g(x_0)+g'(x_0)(x-x_0), \lim_{x\to x_0} \dfrac{g(x)-T_{g,1}(x)}{(x-x_0)}=0$$  Then, \begin{align} \lim_{x\to x_0} \dfrac{f(x)-g(x)}{(x-x_0)^n} &amp; =\lim_{x\to x_0} \dfrac{f(x)-g(x)+T_{f,1}(x)-T_{f,1}(x)+T_{g,1}(x)-T_{g,1}(x)}{(x-x_0)^n}\\ &amp;=\lim_{x\to x_0} \dfrac{f(x)-g(x)+T_{f,1}(x)-T_{f,1}(x)+T_{g,1}(x)-T_{g,1}(x)}{(x-x_0)^n}\\ &amp;=\lim_{x\to x_0} \dfrac{f(x)-T_{f,1}(x)}{x-x_0}-\lim_{x\to x_0} \dfrac{g(x)-T_{g,1}(x)}{x-x_0}+\lim_{x\to x_0} \dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0}\\ &amp;=\lim_{x\to x_0}\dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0}\\ &amp;=0 \end{align}  Then, \begin{align} \lim_{x\to x_0}\dfrac{T_{f,1}(x)-T_{g,1}(x)}{x-x_0} &amp;=\lim_{x\to x_0}\dfrac{f(x_0)+f'(x_0)(x-x_0)-g(x_0)-g'(x_0)(x-x_0)}{x-x_0}\\ &amp;=\left(f(x_0)-g(x_0)\right)\lim_{x\to x_0}\dfrac{1}{x-x_0}+f'(x_0)-g'(x_0) \\&amp;=0 \end{align} I am confused because  $\lim_{x\to x_0}\dfrac{1}{x-x_0}$ does not exist. file /dev/* prints the description of a bunch of files as "block special (M/N)" and "character special (M/N)", where M and N are numbers. For example:  $ file /dev/null /dev/null: character special (1/3)   man file doesn't seem to document these, but refers vaguely to man stat, which seems to refer to these as major and minor device types. apropos 'device type' finds nothing. So what do these numbers mean?