Lecture book just stated that:  $(n-1)^2/\sigma^2$ is a chi squared distribution with $(n-1)$ degrees of freedom where $n$ sample size, $S^2$ sample variance and $\sigma$ population standard deviation,but how do I prove such thing. Thanks, any tips hints would do.
It's a standard result that given $X_1,\cdots ,X_n $ random sample from $N(\mu,\sigma^2)$, the random variable $$\frac{(n-1)S^2}{\sigma^2}$$ has a chi-square distribution with $(n-1)$ degrees of freedom, where $$S^2=\frac{1}{n-1}\sum^{n}_{i=1}(X_i-\bar{X})^2.$$ I would like help in proving the above result. Thanks.
Difference between declaring variables before or in loop? I have always wondered if, in general, declaring a throw-away variable before a loop, as opposed to repeatedly inside the loop, makes any (performance) difference?  A (quite pointless) example in Java:  a) declaration before loop:  double intermediateResult; for(int i=0; i &lt; 1000; i++){     intermediateResult = i;     System.out.println(intermediateResult); }   b) declaration (repeatedly) inside loop:  for(int i=0; i &lt; 1000; i++){     double intermediateResult = i;     System.out.println(intermediateResult); }   Which one is better, a or b?   I suspect that repeated variable declaration (example b) creates more overhead in theory, but that compilers are smart enough so that it doesn't matter. Example b has the advantage of being more compact and limiting the scope of the variable to where it is used. Still, I tend to code according example a.  Edit: I am especially interested in the Java case. See all my questions across all Stack Exchange sites? Touchpad stopped working 20.04 packed vs unpacked vectors in system verilog Looking at some code I'm maintaining in System Verilog I see some signals that are defined like this:  node [range_hi:range_lo]x;   and others that are defined like this:  node y[range_hi:range_lo];   I understand that x is defined as packed, while y is defined as unpacked.  However, I have no idea what that means.  What is the difference between packed and unpacked vectors in System Verilog?  Edit: Responding to @Empi's answer, why should a hardware designer who's writing in SV care about the internal representation of the array?  Are there any times when I shouldn't or can't use packed signals? Let $m,n$ be positive integers bigger than $1$. Show that $\mathbb{Z}_m \times \mathbb Z_n$ is cyclic if and only if $\gcd(m,n)=1$.    I have no idea on how to start. Anyone hints are much helpful. Prove that the additive groups $\mathbb{Z}$ and $\mathbb{Q}$ are not isomorphic. Is my proof below correct? What specific property of rationals did I exploit in my proof? It looks like the property I exploited is the following: Given any positive rational, I can always write it as sum of arbitrary number of positive rationals, whereas given any positive integer I cannot write it as a sum of arbitrary number of positive integers. Has it got to do with the fact that $\mathbb{Q}$ is a field?       Problem Prove that the additive groups $\mathbb{Z}$ and $\mathbb{Q}$ are not isomorphic.   Solution Let there exist an isomorphism between $\mathbb{Z}$ and $\mathbb{Q}$. Now consider the element $1_{\mathbb{Q}}$. We then have $\phi(1_{\mathbb{Q}}) = z \in \mathbb{Z}$. Since $\phi$ has to be a bijection, $z$ cannot be zero, since $\phi(0) = 0$.  Now consider the element $\left(\dfrac1{z+1}\right)_{\mathbb{Q}}$. We now have $$z = \phi(1_{\mathbb{Q}}) = \phi\left(\underbrace{\left(\dfrac1{z+1}\right)_{\mathbb{Q}} + \left(\dfrac1{z+1}\right)_{\mathbb{Q}} + \cdots + \left(\dfrac1{z+1}\right)_{\mathbb{Q}}}_{z+1 \text{ times }} \right) = (z+1) \phi\left(\left(\dfrac1{z+1}\right)_{\mathbb{Q}}\right)$$ However, there is no element in $y \in \mathbb{Z}$ such that $(z+1)y = z$.    First update  Actually I realize that I complicated it unnecessarily. Instead, we can do like this. Since $\phi$ is an isomorphism, we have $\phi(q_{\mathbb{Q}}) = 1_{\mathbb{Z}}$ for some $q \in Q$. However, $$\phi(q) = \phi(q/2+q/2) = 2\phi(q/2)$$ And there is no $y \in Z$, such that $2y=1$. Hence, $\phi(q/2)$ remains unmapped.    Thanks Prove the map sending a matrix to it's inverse is continuous. Let $GL(n,\mathbb{R})$ be the space of invertible $n \times n$ matrices over $\mathbb{R}$. I have already proved that $GL(n,\mathbb{R})$ is open in $\mathbb{R}^{n^2}$ and that it is not connected with the relative topology from $\mathbb{R}^{n^2}$. How do I prove that the map $f:GL(n,\mathbb{R})\rightarrow GL(n,\mathbb{R})$ given by $f(x):=x^{-1}$ is continuous?  Any help would be greatly apprecaited.   Additionally how do I prove that $g:GL(n,\mathbb{R})\times GL(n,\mathbb{R}) \rightarrow GL(n,\mathbb{R})$ given by $g(x,y):=xy$ (matrix multiplication) is continuous, where we take the relative topology from $\mathbb{R}^{n^2} \times \mathbb{R}^{n^2} \cong \mathbb{R}^{2n^2}$? If a matrix has orthonormal columns, they must be linearly independent, so $A^+ = (A^T A)^{−1} A^T$ . Also, the fact that its columns are orthonormal gives $A^T A = I$. Therefore,  $$A^+ = (A^T A)^{−1} A^T = (I)^{-1}A^T = A^T$$  Thus, $A^+ = A^T$. Am I correct? Thank you. If $a$ and $b$ are consecutive integers, prove that $a^2 + b^2 + a^2b^2$ is a perfect square. Problem is as stated in the title. Source is Larson's 'Problem Solving through Problems'. I've tried all kinds of factorizations with this trying to get it to the form $$k^2l^2$$ but nothing's clicking. I tried Bézout but the same expression can be written as $$a^2 + (a^2 + 1)(a+1)^2$$ which would imply that there is no real root.  Would really appreciate some help, thanks. Efficient unsigned-to-signed cast avoiding implementation-defined behavior In An Introduction to Statistical Learning (James et al.), in section 3.7 exercise 5, it states that the formula for $\hat{\beta}_1$ assuming linear regression without an intercept is  $$\hat{\beta}_1 = \dfrac{\displaystyle\sum\limits_{i=1}^{n}x_iy_i}{\displaystyle \sum\limits_{i=1}^{n}x_i^2}\text{,}$$ where $\hat{\beta}_0 = \bar{y}-\hat{\beta}_1\bar{x}$ and $\hat{\beta}_1 = \dfrac{\displaystyle S_{xy}}{S_{xx}}$ are the usual estimates under OLS for simple linear regression ($S_{xy} = \displaystyle\sum\limits_{i=1}^{n}(x_i - \bar{x})(y_i - \bar{y})$).  This is not the actual exercise; I am merely wondering how to derive the equation. Without using matrix algebra, how do I derive it?   My attempt: with $\hat{\beta}_0 = 0$, we have $\hat{\beta}_1 = \dfrac{\bar{y}}{\bar{x}} = \dfrac{S_{xy}}{S_{xx}}$.  After some algebra, it can be shown that $\displaystyle S_{xy} = \sum\limits_{i=1}^{n}x_i^2 - n\bar{x}\bar{y}$ and $\displaystyle S_{xx} = \sum\limits_{i=1}^{n}x_i^2 - n\bar{x}^2$. From here, I'm stuck. Why does it take so long to review a flag suggested by a user? Why does it take so long to review a flag suggested by a user?  When I flag a question or comment, some get a response quickly whereas some of them get a response after few or more hours.  Is there any flag review condition which cause so much time to be taken for different flags?  Or are there different moderators for different flag posted? Consider the function : $$f: \mathbb{R}^2 \rightarrow \mathbb{R} , (x,y) \mapsto   \begin{cases}         0 &amp; \text{for } (x,y)=(0,0) \\    \frac{x^3}{x^2+y^2}       &amp; \text{for } (x,y) \neq (0,0)   \end{cases} $$  Show that $f$ not differentiable at $(0,0)$ but all directional derivatives exist.  I don't know how to tackle this problem. Can someone give some hints or solve the problem? Thanks :) Showing that if the center of a group is trivial, then the center of its automorphism group is trivial I have End Date column and I want to add 14 Days on it auto when created, can I do it by workflow? Can I do it via jQuery. If yes how? if no how I can do it? Why is the amount of photos that fit on one card dependent on ISO? Explode MULTILINESTRING into individual segments in PostGIS 1.5 I have a MULTILINESTRING in PostGIS consisting of several LINESTRING's. Consider each LINESTRING to have a set of POINT's      P1, P2, ... PN   forming the line segments     L1, L2, ... LN-1   where LX is the line segment connecting PX to PX+1.  Using PostGIS 1.5 how can I explode the MULTILINESTRING into individual line segments of each LINESTRING? Find out which process is locking a file or folder in Windows How can I find out which process is locking a file or folder in Windows?  For instance, when trying to delete a folder, Windows reports this:     The action can't be completed because the folder is open in another program   Happens the same with a file, but how do I find out what program or application is currently using it and preventing me from deleting the file or folder? F# insert/remove item from list Intuitive explanation for how could there be "more" irrational numbers than rational?