printing float value producing wrong results
Is floating point math broken?
Suppose that sequences of real numbers satisfy:  \begin{align*}   a_n &amp;= \sum\limits_{r=0}^n \binom{n}{r} b_r \\ \end{align*}  Prove that:  \begin{align*}   (-1)^n b_n &amp;= \sum\limits_{s=0}^n \binom{n}{s} (-1)^s a_s \\ \end{align*}  My work:  The $n=0$ case:  \begin{align*}   a_0 &amp;= b_0 \\   b_0 &amp;= a_0 \\ \end{align*}  Then $n=1$ case:  \begin{align*}   a_1 &amp;= \binom{1}{0} b_0 + \binom{1}{1} b_1 = b_0 + b_1 \\   -b_1 &amp;= \binom{1}{0} a_0 - \binom{1}{1} a_1 = a_0 - a_1 \\   b_1 &amp;= a_1 - a_0 = b_0 + b_1 - a_0 = b_1 \\ \end{align*}  The inductive step:  \begin{align*}   (-1)^{n+1} b_{n+1} &amp;= \sum\limits_{s=0}^{n+1} \binom{n+1}{s} (-1)^s a_s \\ \end{align*}  I'm not sure where to go from here. I tried substituting $a_s$ into that last equation and it didn't help. Any ideas? How do I get the  value of a character as an int in ? My grandparents bought a flight on United Airlines that departs on Feb 10 2019, as the one and same ticket, from Toronto, to ORD with 1 55-minute layover, then Maui. Please ping me if I ought post their return flight on Feb 24's details.   advises:     There should be no customs and immigrations formalities at ORD, as YYZ is a , and CBP matters will be handled in Toronto.    I'm assuming that  persists during their vacation to Maui.   reported some TSA agents' refusal to work.  Will  refuse to work, or any other federal workers pertinent to travelling to and from the US? Find the value of $\sin\frac{2\pi}{7}+\sin\frac{4\pi}{7}+\sin\frac{8\pi}{7}$ Performing Raster Reclassification in QGIS? Is there a way to perform a reclassify of a raster image in QGIS?  In ArcGIS you can do that in Spatial analyst Tools→Reclass→Reclassify  Any ideas? What does $\bigcup_{i=0}^{\infty}[i, i+2]$ mean? I think I get it but I wanted to be sure before attempting the question:  Question  Describe the following set, and prove your answers correct. (Here brackets denote intervals on $\mathbb{R}$.)  $\bigcup_{i=0}^{\infty}[i, i+2]$  Does it mean: {$0, 1, 2, 3, 4, 5...,\infty$} $\cup$ {$2, 3, 4, 5, 6, 7,...,\infty$}?  If so, what is the difference between:  $\bigcup_{i=0}^{\infty}[i, i+2]$ and $\bigcup_{i=0}^{\infty}(i, i+2)$ What do the nomodeset, quiet and splash kernel parameters mean? What do Kernel command line parameters (also also known as boot options) mean?  When you go to Ubuntu (or better, GRUB) options, you have things like nomodeset, quiet and splash. What do these options mean?  I am also interested in other parameters and would be interested to see descriptions of any kernel parameter (like acpi), but these are not essential. Why does my ArrayList contain N copies of the last item added to the list? Plotting two variables as lines using ggplot2 on the same graph OK guys I have this problem:  For $x,y,p,q&gt;0$ and $ \frac {1} {p} + \frac {1}{q}=1 $ prove that $ xy \leq\frac{x^p}{p} + \frac{y^q}{q}$  It says I should use Jensen's inequality, but I can't figure out how to apply it in this case. Any ideas about the solution? How do you rotate a two dimensional array? Inspired by , say you have a 4x4 two dimensional array, write a function that rotates it 90 degrees. Raymond links to a solution in pseudo code, but I'd like to see some real world stuff.  [1][2][3][4] [5][6][7][8] [9][0][1][2] [3][4][5][6]   Becomes:  [3][9][5][1] [4][0][6][2] [5][1][7][3] [6][2][8][4]   Update: Nick's answer is the most straightforward, but is there a way to do it better than n^2? What if the matrix was 10000x10000? Image of Jacobson Radical is the Jacobson Radical I'm stuck on the following problem:      Let $R$ be a commutative ring with $1$, and suppose $R$ is semilocal with maximal ideals $\mathfrak m_1, ... , \mathfrak m_s$.  Let $\mathfrak a$ be an ideal of $R$. The problem is to show that under the usual surjection $\pi:R \rightarrow R/\mathfrak a$, the Jacobson radical of $R$ is sent to the Jacobson radical of $R/\mathfrak a$.   My attempt: suppose that $\mathfrak m_1, ... , \mathfrak m_t$ contain $\mathfrak a$, but $\mathfrak m_{t+1}, ... , \mathfrak m_s$ do not.  Then $Jac(R/\mathfrak a) = (\mathfrak m_1/ \mathfrak a) \cap \cdots \cap (\mathfrak m_t/ \mathfrak a)$.  Obviously $\pi Jac(R) \subseteq Jac(R/ \mathfrak a)$, and the converse inclusion is equivalent to the following claim: if $x \in \mathfrak m_1 \cap \cdots \cap \mathfrak m_t$, then there exists a $y \in \mathfrak m_1 \cap \cdots \cap \mathfrak m_s$ such that $x - y \in \mathfrak a$.    This should be some application of the Chinese remainder theorem, but I'm not seeing it.  All I have to go on is that there exist $m_i \in \mathfrak m_i$ ($t+1 \leq i \leq s$) with $m_i \not\in I$.  I also haven't found out a way to use the fact that $\mathfrak m_1 ,... , \mathfrak m_s$ are all the maximal ideals of $R$.  I was also thinking about looking at some explicit maps.  If we let $\Gamma$ be the composition $$\frac{(R/\mathfrak a)}{Jac(R/ \mathfrak a)} \xrightarrow{\cong} \frac{(R/\mathfrak a)}{(\mathfrak m_1/\mathfrak a)} \oplus \cdots \oplus \frac{(R/\mathfrak a)}{(\mathfrak m_t/\mathfrak a)} \xrightarrow{\cong} R/\mathfrak m_1 \oplus \cdots \oplus R/\mathfrak m_t$$ then we have a commutative diagram $$\begin{matrix} R/Jac(R) &amp;  \rightarrow &amp; \frac{(R/\mathfrak a)}{Jac(R/\mathfrak a)} \\ \downarrow &amp; &amp; \downarrow \Gamma \\ R/\mathfrak m_1 \oplus \cdots R/\mathfrak m_s &amp; \rightarrow &amp; R/\mathfrak m_1 \oplus \cdots \oplus R/\mathfrak m_t \end{matrix}$$ where the vertical arrows are isomorphisms, and the horizontal arrows are surjections. How can I get this 'Version: 0.1.0 - 94" value from the  tag in selenium webdriver? How can I get this Version: 0.1.0 - 94 value from the &lt;div&gt; tag in selenium webdriver? and here is my code:  &lt;div _ngcontent-qbk-c3="" style="text-align: center;"&gt;Version: 0.1.0 - 94&lt;/div&gt; How to scroll in a terminal using keyboard? How can I scroll in bash using only the keyboard? If it's not possible in bash, are there any other shells that support this? What is an efficient way to implement a singleton pattern in Java? Is there a rational number between any two irrationals? Suppose $i_1$ and $i_2$ are distinct irrational numbers with $i_1 &lt; i_2$.  Is it necessarily the case that there is a rational number $r$ in the interval $[i_1, i_2]$?  How would you construct such a rational number?  [I posted this only so that the useful answers at  could be merged here before that question was deleted.] Estimating the intersection of two lines I have two datasets, A and B, of weighted (x,y) pairs. I computed the best fit lines, L_A and L_B, respectively, of these datasets, and then computed the intersection of these two lines, (x*,y*).  Now, A and B are drawn from random distributions (of the form y=mx+b+e, where e is a normally distributed error term). I'd like to compute a confidence interval around x*. How can I do this?  A naive approach I tried involved computing confidence intervals for the slope/intercept estimates of L_A and L_B, generating approximate distributions for those 4 parameters, and repeatedly randomly sampling from these distributions. But a given line's slope and intercept estimates are not independent of each other, and I wasn't sure how to salvage this approach to account for that. A question about the higher-order Weyl variation for the geodesic distance I have a question in deriving Eqs. (3.6.15b) and (3.6.15c) in Polchinski's string theory vol I p. 105.   Given      $$\Delta (\sigma,\sigma') = \frac{ \alpha'}{2} \ln d^2 (\sigma, \sigma') \tag{3.6.6}$$   where $d(\sigma,\sigma')$ is the geodesic distance between points $\sigma$ and $\sigma'$.   It is said for the Weyl variation $\delta_W$,     $$\partial_a \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= \frac{ 1}{2} \alpha' \partial_a \delta \omega(\sigma) \tag{3.6.15a} $$   $$ \partial_a \partial_b' \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= \frac{ 1+ \gamma}{2} \alpha' \nabla_a \partial_b \delta \omega(\sigma) \tag{3.6.15b} $$   $$ \nabla_a \partial_b \delta_W \Delta(\sigma,\sigma')|_{\sigma'=\sigma}= - \frac{  \gamma}{2} \alpha' \nabla_a \partial_b \delta \omega(\sigma) \tag{3.6.15c} $$   Here $\gamma=-\frac{2}{3}$.   I know the reason for the factor of $1/2$ in the RHS of Eq. (3.6.15a) and I can derive it. But, putting $\nabla$ on LHS and RHS of Eq. (3.6.15a) will not lead to (3.6.15c). I guess it is because there is some higher-order terms in the geodesic distance where the treatment of (3.6.9)-(3.6.11) omitted. But I don't know how to get it. I tried $ds^2= g_{ab} dx^a dx^b= (\eta_{ab} + h_{ab})dx^a dx^b $ to separate the deviation of Minkowski metric, but I cannot get the factor $\gamma$   My question is, how to derive Eqs. (3.6.15b) and (3.6.15c) (especially there is a prime, $'$, namely $\partial'_b$ in the LHS of (3.6.15b) but not in the RHS) Is there a difference between Bayesian and Classical sufficiency? The title pretty much says it all. I wonder whether there is any difference in the way Bayesians understand sufficiency vs. the way orthodox statistics understands sufficiency, or are they equivalent?  If there is a difference, what is it? How to forward specific log file outside of /var/log with rsyslog to remote server? How can I forward message from a specific log file like /www/myapp/log/test.log with rsyslog client to remote rsyslog server? This log file is outside of the directory /var/log.