This is a number theory exercise I've been stuck on for a while. It was set during a lecture I attended once. It goes something like this . . .  Suppose there's a full circular prison with 100 cells and one prison guard who hates his job. He gets drunk one night and decides to play a game while the prisoners were asleep. He walks the circular prison and, the first time, he opens every cell; the second time, he closes every even numbered cell; the third time, he touches every third cell, and if that cell is open, he closes it, and he opens it otherwise; the fourth time, he touches every fourth cell, and if that cell is open, he closes it, and he opens it otherwise; and so on until his hundredth time around the prison. He then falls asleep. By the morning, after the prison guard's hundredth lap, every prisoner in an open cell escapes. Which prisoners escape?  Thoughts: I've thought of trying a modified use of the Sieve of Eratosthenes but there's got to be a more elegant, less brute-force solution.
I have a problem called "The Prison Problem" that I need to explain to my 9-year-old cousin. I would think that he has just started learning about divisors and perfect squares, and as such, I have a proposed solution. Any input from you guys would be welcome, as to what is the best way to go about this.  Problem:  There was a jail with 100 cells in it, all in a long row. The warden was feeling very jolly one night and told his assistant that he wanted to give all the prisoners a wonderful surprise. While they were sleeping, he wanted the assistant to unlock all the cells. This should be done, he told the assistant, by putting the key in each lock, turning it once. The assistant did this, then came back to report that the job was done. Meanwhile, however, the warden has second thoughts. "Maybe I shouldn't let all the prisoners free," he said. "Go back and leave the first cell open, but lock the second one (by putting the key in and turning it once). Then leave the third open, but lock the fourth, and continue in this way for the entire row." The assistant wasn't very surprised at this request as the warden often changed his mind. After finishing this task, the assistant returned, and again the warden had other thoughts. "Here's what I really want you to do," he said. "Go back down the row. Leave the first two cells as they are, and put your key in the third cell and turn it once. Then leave the fourth and fifth cells and turn the key in the sixth. Continue down the row this way." The assistant again did as instructed. Fortunately, the prisoners were still asleep. As a matter of fact, the assistant was getting pretty sleepy, but there was no chance for rest yet. The warden changed his mind again, and the assistant had to go back again and turn the lock in the fourth cell and in every fourth cell down the row. This continued all through the night, next turning the lock in every fifth cell, and then in every sixth, and on and on, until on the last trip, the assistant just had to turn the key in the hundredth cell. When the prisoners finally woke up, which ones could walk out of their cells?  Proposed solution:  Ten cells are left open after this process. Every cell that is a perfect square will remain open (1, 4, 9, 16, 25, 36, 49, 64, 81, and 100). If a number is not a perfect square, then it has an even number of divisors, therefore it will be "toggled" an even number of times and end up where it started (closed). Perfect squares have an odd number of divisors, so they will end up the opposite of where they started (open).
The UK Visas and Immigration Directorate publishes  that provides helpful tips that can result in successful visa applications. Section 2 of this guidance opens is entitled &quot;other documents you may want to provide&quot; (emphasis mine).  Section 2: other documents you may want to provide – all visitors This section provides guidance on the types of documents that you may want to provide to help us consider your application against the Immigration Rules. Previous travel documents/passports, which show previous travel. Financial documents showing that you have sufficient funds available.  These must clearly show that you have access to the funds, such as:  bank statements building society book proof of earnings such as a letter from employer confirming employment details (start date of employment, salary, role, company contact details) where a third party (who is either in the UK or will be legally in the UK at the time of your visit) is providing financial support to you e.g. a business, a friend or a relative, documents to show that they have sufficient resources to support you in addition to themselves and any dependant family should be provided   The first item is &quot;bank statements&quot; and this ties in with the , which says...  evidence that you can support yourself during your trip, eg bank statements or payslips from the last 6 months  (Note 'eg' is a Latin abbreviation meaning &quot;for example&quot;; this appears to be optional rather than a fixed requirement.) Question: How should someone interpret this such that the chances of success are maximized? How many statements should I submit? What are they looking for and what do my bank statements tell about me? Negative probabilities are naturally found in the Wigner function (both the original and its discrete variants), the Klein paradox (where it is an artifact of using a one-particle theory) and the Klein-Gordon equation.  Is a general treatment of such quasi-probability distributions, besides naively using 'legit' probabilistic formulas? For example, is there a theory saying which measurements are allowed, so to screen negative probabilities? Additionally, is there an intuition behind negative probabilities? How to calculate what this power series converges against? (double factorials) Node only partially rendered near edge of plot I'm trying to draw a relatively simple chart of a number line, and when one of the nodes is too close to the edge of the plot, it gets cut off.  The code:  \documentclass{article}  \usepackage{natbib} \usepackage{graphicx} \usepackage{pgfplots}  \begin{document}  \begin{tikzpicture} \begin{axis}[   width=\columnwidth,   axis y line=none,   axis lines=left,   axis line style={-},   xmin=0,   xmax=1,   ymin=0,   ymax=1,   xlabel=$\mu$,   scatter/classes={o={mark=*}},   restrict y to domain=0:1,   xtick={0,1} ] \draw[ultra thin] (axis cs:0, 0) -- (axis cs:0,.05); \draw[ultra thin] (axis cs:.4, 0) -- (axis cs:.4,.05); \node[coordinate,label=above:{$B$}] at (axis cs:0.0,0.05) {}; \node[coordinate,label=above:{$A$}] at (axis cs:0.4,0.05) {}; \node[coordinate,label=above:{$b$}] at (axis cs:0.2,0.02) {}; \node[coordinate,label=above:{$a$}] at (axis cs:0.7,0.02) {}; \end{axis}; \end{tikzpicture} \end{document}   The Result:    How do I get the B to fully render? A fiber bundle over Euclidean space is trivial. How should a user's death be handled? GUI/Unity crashing in 16.04 LTS after updates 2018-01-04, compiz segfaults Proof that a sequence is convergent I imagine a point-like particle can only experience the local properties of spacetime. But locally there is no curvature and no gravity, as it is often stated that     Locally, as expressed in the equivalence principle, spacetime is Minkowskian, and the laws of physics exhibit local Lorentz invariance. ()   But if this is the case how does a point-like particle know, which direction it should follow in a gravitational field?   Can this be a seen as a hint that point-like particles cannot be used as underlying concept for a field theory like general relativity? Is "a total of 10 payments" singular or plural? A total of 10 payments were made.   OR     A total of 10 payments was made.   Which is correct? Or can both be correct? I have a raster height model and would like to calculate the horizontal geographic direction (north, east, etc. - orientation) of each cell, then calculate then the mean value of all these cells in one region (polygon). This is to get information about to what direction a vineyard is exposed to. How do I do this? What happens with lethargy when Haste is cast again on a creature before first cast runs out? How to implement a follow author (or user) function? Is it possible to implement a Follow button for authors of posts in Drupal 7, so that users can:   Follow any one they wish, and Be notified about the new posts of those authors.   This sounds like 'Mashable Follow button' for authors.  Do you have any suggestions about how to implement this? If random variables are drawn from an identical distribution, why doesn't this guarantee they are independent? MacBook Pro detects syncmaster (monitor) but doesn't display The lines wrap so much on v1.0.85 that only a few items can be displayed.  Edit: This is on the world's most low end tablet, Azpen A727.  Screenshots of the old:    and new, showing loss of quality Texture messes up after extruding a modified plane I want to make some 3d models of pixel art. I started by adding a plane, adding a texture to it, added loop cuts to my plane, 15 loop cuts because it's a 16x16 texture, then I selected the blank faces and deleted them. As I extrude this plane, A &gt; E &gt; $0.1$, the texture messes up on the edge of the item, as shown below  Although not all faces mess up on the edge, a lot still do. I tried recalculating normals, unwrapping the object again, but I ended with the same problem, no change at all. Though I may have done it wrong, since I never did it before. I tried smart UV project and cube projection, but they just mess it up even more. Does anyone have a solution to this? Currently i am using RF toolbox on MATLAB for a binary classification Problem  Data Set: 50000 samples  and more than 250 features  So what should be the number of trees and randomly selected feature on each split to grow the trees? can any other parameter greatly affect the results? The 'ok' on the 'Your Answer' dialog on unregistered sites is a bit too high The 'ok' on the 'Your Answer' dialog on unregistered sites is a bit too high:     You can see the top of the k is outside the actual box, increasing the margin-top by 10px in the containing div fixes it. Let $R$ be a commutative ring with unit, $I$ an ideal of $R$ and consider the following three constructions.   The  $R_I$ of $R$ at $I$ (i.e. the localization of $R$ at the multiplicative system $R\setminus I$) gives a morphism $$ f_1:\operatorname{Spec}(R_I)\to \operatorname{Spec}(R)=:X $$ The  $\widehat{R}_I$ of $R$ at $I$ gives a morphism $$ f_2:\operatorname{Spec}(\widehat{R}_I)\to X $$ For the special case $I=(a)$, the localization $R_a$ (i.e. the localization of $R$ at the multiplicative system $\{1,a,a^2,\ldots\}$) gives a morphism $$ f_3:\operatorname{Spec}(R_a)\to X $$   My question is:     What is the geometric meaning of all three constructions and how are they related?   This is what I ''know'' already or describes at least the style of answer I would appreciate. As remarked in the comments, $I$ has to be a prime ideal.   $R\to R_I$ is injective iff $R\setminus I$ contains no zero divisors which is the case if $I$ is a prime ideal. The scheme $\operatorname{Spec}(R_I)$ is the intersection of all the neightbourhoods of $I$ in $X$. This is a little contra-intuitive for me since the last statement sounds like ''$f_1$ is injective'' but the $\operatorname{Spec}$-operator should turn 'injective'' and ''surjective'' around somehow (I know this is literally not true but I only want to get a feeling like ''is contained'', ''is bigger'', ''is smaller'', etc.). $\operatorname{Spec}(R_a)$ is somehow the opposite of $\operatorname{Spec}(R_{(a)})$ (= the intersection of all the neightbourhoods of $(a)$ in $X$) because $\operatorname{Spec}(R_a)$ seems to be something like the union of all the open sets of $X$ not containing the point $(a)$. $R\to\widehat{R}_I$ is injective iff $\cap I^n=(0)$ and this holds very often (e.g. for $R$ noetherian and either an integral domain or a local ring). Hence (this is probably false intuition as remarked before), $f_2$ should be something like a ''projection'' (from something ''big'' into something ''small''). But what is geometrically the difference between localization and completion. I don't have a geometric idea of completion at all.   As remarked by Qiaochu Yuan in the comments below, one should not think of $\operatorname{Spec}$ as injective-surjective switching.