Assume $A\in \mathbb{R}^{t\times n}$ and $b\in \mathbb{R}^t$. How to solve the following optimization problem in $x\in \mathbb{R}^n$?  $$\begin{array}{ll} \text{minimize} &amp; \|Ax-b\|_2^2\\ \text{subject to} &amp; x^Tx=1\end{array}.$$    Thanks for the comments, I already read another question. But in fact, the two answers are not complete. In fact, this is not a convex optimization, so the solution we get may be local maximum or something else.   Can anyone prove that if $x,\lambda$ satisfy $$A^TAx-A^Tb+\lambda x = 0\\ x^tx=1.$$ This must be a global minimum?
It is easy to find the minimum of $\|Ax-b\|_2$, when $A$ has full column rank. But how is the case when we add the constraint $\|x\|_2=1$? Or, to be explicit,  $$\min_{\|x\|_2=1}\|Ax-b\|_2=?$$  My idea is to construct the corresponding Lagrange function  $$L(x,\lambda) = (Ax-b)^T(Ax-b) + \lambda(x^T x - 1)$$  Differentiate the function with respect to $x,\lambda$, we have  $$A^T A x - A^T b + \lambda x = 0$$  $$x^T x=1$$  However, I find it hard to move forward to get the answer. Could anyone help me? Thanks a lot!
$f:\mathbb R\to\mathbb R$ continuous function. Which of the following sets can not be image of $(0,1]$ under $f$? Let $f:\mathbb R\to\mathbb R$ continuous function. Which of the following sets can not be image of $(0,1]$ under $f$?          A. $\{0\}$.          B. $(0,1)$.          C.$[0,1)$.          D.$[0,1]$.      My effort: Continuous image of connected set connected. $(0,1]$ is connected and remove $1$ from the set left the set connected...but removing any point from $(0,1)$ make it disconnected.....I am not sure though What is the best way to clean lenses and filters? After removing dust with an air pomp and a brush, what are you using to remove stains from the lens and filters?  So far I'm using the liquid from a Giotto's CL 1002 cleaning kit for the lens, but I'm not sure what should I use for the filters, and if there is some better alternative.  Also, what kind of brushes are recommended? List only regular files (but not directories) in current directory Initial note: Having read , the answers there do not help in this specific situation, as they rely on having lots space to spare - I have very little.  When I started my city, I designed a simple exit from the default highway that I thought was sustainable: I left enough space around it to upgrade the road as I needed to, which has worked up until now. However, I am now stuck with a six-lane one-way exit from the highway that isn't getting used: since cars seem to pick the most efficient lane to get where they want to go, regardless of traffic, the rightmost lane fills up, then spills over onto the highway. This blocks the highway, my bus routes, and more importantly my planned emergency routes.  My setup looks like this:    The red arrows show road direction, and the orange line is the traffic backed up. Note that in this image, I have replaced the six-lane one-way exit with a highway exit, as this is just about as efficient...  This situation is getting to be pretty bad, and is bringing half my city to a standstill. Its effects compound themselves further down the highway:    In this image, the orange line is the traffic directly caused by this exit not working. This traffic jam then blocks two exits/entrances further down, on the red crosses; the yellow line shows the traffic jam caused by these being blocked. In other words, my inefficient exit design is now blocking itself from moving.  So this is a two part problem.   Considering that I'm constructing a residential district in the space above left of the problem exit, and would like to keep the solution inside the power line, how can I redesign this exit to be more efficient? How do I solve the ring of traffic jams? Is it a simple case of just deleting and replacing a bit of road? Let $A$ be a closed and bounded subset of $\mathbb{R}^{n}$. Given that $f: A \to A$ satisfies $d(f(x),f(y)) &lt; d(x,y)$ for all $x,y \in A$, $x\neq y$ where $d$ is the usual Euclidean metric. Show that $f$ has a unique fixed point.    My observations:    Since $\mathbb{R^{n}}$ is complete, then $(A,d)$ is complete since $A$ is closed; Since $A$ is bounded, then $A \subset B_{R}$ for some $R &gt; 0$; Banach Fixed Point Theorem guarantees a unique fixed point if $f$ is contraction on $A$.   Please correct me if I am wrong. My quandry here is showing that $f$ is a contraction, i.e.  $$ d(f(x),f(y)) \leqslant k\cdot d(x,y), \hspace{3mm} k \in (0,1) $$  I'm looking for some hints or tips. Thank you. Creating mask file from shapefile using ArcGIS for Desktop? I have a shapefile of Lakes over my study area. Each polygon has attribute information of each lake, name, shape etc. Actually I want to eliminate all lakes from analysis. In other word, I want lakes to have 0 value and the area that out of boundary of lake to have their orginal pixel values. when I do subset using this shapefile, the output is not I want because my shapefile deoesn't have any value outer boundary of lake.   How can I build a proper mask file (inner part of lake has 0 value, outer is 1) using this shapefile in ArcGIS Desktop? I have come across the following few questions on past exams papers.. I know how to solve these type when it is of the form $a_nz^n$ but don't have a clue what to do with these. Any help would be greatly appreciated!  (i) $\displaystyle\sum_{n=0}^\infty \bigg(\dfrac{1}{2n}\bigg)z^{3n}$.  (ii) $\displaystyle\sum_{n=0}^\infty(2^n+i)(z-i)^n$.  (iii) Show that the radius of convergence of $\displaystyle\sum_{n=0}^\infty z^{n!}$ is $1$ and that there are infinitely many $z \in \mathbb{C}$ with $|z|=1$ for which the series diverges. I replaced a non-protected receptacle with a GFCI type and now my circuit tester trips the GFCI as soon as it is plugged in.  The receptacle tested fine before replacement, ground, neutral, hot, etc.  I've double checked the hot/neutral/ground connections.  I've also tried it with the downstream load disconnected.   The GFCI trips the moment I plug in my circuit tester (before pushing the test button).  Otherwise things check out OK.  I can plug in a power tool without it tripping.  Also, the integrated test/reset button work correctly.   I've read that the integrated test button is the only one that truly matters. Is this correct or should I be concerned? I'm sure a home inspector will red flag this if their tester has the same result.  Update  My tester is by "Commercial Electric".  The tester is one of the palm sized three prong type with three leds to indicate the condition of the circuit and a button on top to test GFCI. It's new from the local box store. This question is here so we can offer users who are looking for information on how to make one or more common or basic redirects in Apache using the htaccess file. All future questions pertaining to finding information that is that is covered by the question should be closed as a duplication of this question. .  Whats the point in this question? The idea while not perfect is catch the most commonly asked questions regarding redirects using the  htaccess on the Apache platform either on  some type of lamp or a live server. The type of answers should be generally those that you could imagine are used by 100,000’s of sites world-wide and are constantly asked here at Pro Webmasters repeatedly over and over in various forms.  A few examples of the type of answers we are looking for:   How can I redirect non-www to www? How can I redirect a sub domain to the main domain? How can I redirect a sub folder from domain to a root or a subdomain?  How can I redirect an old URL to a new URL?   A few examples of the types of answers that we are not looking for:   Answers that do not involve a redirect. Any answers relating to NGinx, IIS or any other non-Apache platform. Answers that involve custom and complex string or query removals.   Resources for Advanced to Complex Mod_Rewrite Rules:      Please note: that this question is still in construction and may need some refining either by myself or a real moderator of Pro Webmasters, if you have any concerns or questions . Nicely discouraging serial upvoting Probably everybody who is very active on SO has experienced cases of random, serial upvoting as the expression of thanks from a (usually newbie) user. The pattern is usually 5 or more upvotes on your latest answers. The upvotes will be detected within 24 hours, and removed. (Or so I assume.)  No harm done except maybe a minor irritation for people after one of the &quot;rep cap&quot; badges because they are shown a higher reputation than they actually have. Still, I was thinking whether, in an attempt to channel the positive attitude into more productive areas, it would be worth showing a tooltip on the third upvote for the same person within time frame x:  Please use one upvote, a comment, or some quality content of your own, to say thank you Large numbers of upvotes for the same user may become invalid as part of our spam detection mechanisms.  Does this make sense? Maybe it is too localized and rare, but it has happened to me three or four times in the last two weeks alone. You decide.  Clarification: I am not advocating putting up any kind of barrier on upvotes. . I'm suggesting informing people of the barrier and the futility of their ten or so upvotes for a single person because those votes are likely to be revoked.  Update: @devinb makes the good point that &quot;saying thanks&quot; is not the only possible reason for serial upvoting, and the message wouldn't make sense then. The point still stands: Your votes aren't going to count, and when it comes to up voting (which is always some sort of positive behaviour, however misguided if done indiscriminately) I think it's fair to inform people of this. Convert list of ints to one number? Browsing through a copy of Counterexamples in Analysis (Gelbaum  &amp; Olmsted), I'm quite enjoying the typeface used for 'script' letters (see links to examples below); visually it's somewhere between what I'd now call calligraphic and fraktur, and semantically it's used where now we'd use mathcal, mathfrak or mathbb.  I was therefore procrastinatiously looking for a LaTeX-usable font to include these characters, but couldn't seem to find any. I'm certain they're not unique to this text or publisher, so figured my lack of success was probably more to do with searching with the wrong keywords. If anyone has any ideas I'd be grateful. May I get off in an intermediate city of my route during transfer? I want to go from Panamá to Turkey. There're direct flights of Turkish Airlines that are expensive. And there're flights Panamá -&gt; Istambul -&gt; Baku there're cheaper 2 times of the same airline. The transfer in Istambul takes 6 hours.    Will it be a violation if I buy a ticket Panamá -&gt; Istambul -&gt; Baku and leave in Istambul? I'm trying to process some data in Excel. The data includes numeric account numbers and other long numeric strings (like cell phone MEIDs). I am not doing math operations on these strings, so I want Excel to treat them as plain text.  Here is what is making me nuts (this is Excel 2010):   Take a long number like 1240800388917 and paste it in a cell in a new worksheet. Excel's default cell format is general, so the string is presented in scientific notation as 1.2408E+12 Right click on the cell, select Format Cells, set the format to Text   The cell is still displayed in scientific notation, even though the format has been set to text.  Now, if I do the steps in a different order:   Format an empty cell as text. Right click on the cell, select Format Cells, set the format to Text Take a long number like 1240800388917 and paste it in to the text formatted cell   Now, the cell is displayed as a string and not in scientific notation.  The results remaining in scientific notation even though the cell is formatted as text just seems broken to me. I've seen suggested work-arounds like: use CSV import and set the format to text, add a space character to the beginning of each numeric string, and others.  Is there a simple good work around to easily keep these strings formatted as text?  Why on earth does Excel do this?  Related SU questions I found:  and The maximum energy stored by a capacitor is when it’s (theoretically) fully charged, or just before it reaches dielectric breakdown, if you will. It seems, then, that the maximum energy ($E$) $=QV$, where $Q$ is the maximum charge attained and $V$ is the maximum ‘voltage’. However, the correct equation for the maximum energy is $E=\frac{1}{2}QV$. Why? I’m looking for a simple, intuitive explanation because my reasoning that $E=QV$ seems sound to me. I know about , but I’m looking for a reason to disprove my specific argument that $E=QV$ and not the “Oh, it comes from integration.” response. Show $GCD(a_1, a_2, a_3, \ldots , a_n)$ is the least positive integer that can be expressed in the form $a_1x_1+a_2x_2+ \ldots +a_nx_n$ What's the difference between semicolon and double ampersand && What is the difference between  echo "Hello " ; echo "world"   and  echo "Hello " &amp;&amp; echo "world"   Both seems to run the two commands after each other. Algebraic proof that if $a>0$ then $1+a^9 \leq \frac{1}{a}+a^{10} $ Prove that if $a&gt;0$ then $1+a^9 \leq \frac{1}{a}+a^{10} $.   Using the fact that $a \gt 0$, multiply by $a$ on both sides and get everything to one side we have; $a^{11}-a^{10}-a+1 \geq 0$. By factoring $(a^{10}-1)(a-1) \geq 0 $.  I am not sure how to proceed any further. This is irritating me. I seen several suggestions (all using different files and syntax) and none of them worked.  How do I set an environment variable for a specific user? I am on debian squeeze. What is the exact syntax I should put in the file to make ABC = "123"? Comparing negatives: "she seems not to know" vs. "she doesn't seem to know" What is the difference in style and meaning between the following two:        She seems not to know.   She doesn't seem to know.      Is there a name to this type of construction?