Big O of recursive function that counts the elements in a nested list
Big O, how do you calculate/approximate it?
How can I disown a running process and associate it to a new screen shell? I have a running program on a SSH shell. I want to pause it and be able to unpause its execution when I come back.  One way I thought of doing that was to transfer its ownership to a screen shell, thus keeping it running in there.  Is there a different way to proceed? Is Object constructor called when creating an array in Java? In Java, an array IS AN Object. My question is... is an Object constructor called when new arrays is being created? We would like to use this fact to instrument Object constructor with some extra bytecode which checks length of array being constructed. Would that work? Is there an algorithm for N body simulations in General Relativity I am new to general relativity but have a background in computer science.  Why is it so hard to do n-body simulations in GR?  For example, there could be a program which takes the properties (mass, position, velocity, etc.) of each particle as input and numerically integrates the evolution of the system using discrete but very small time steps.  If we throw enough memory and computing power at it, we can get arbitrarily close to the 'real' solution.  I assume the entire histories of the worldlines would need to be known, in order to calculate things like gravitational waves.  I have downloaded programs which show the evolution of the Schrodinger equation, so I am surprised they are so hard to find for GR.  Some responses I've heard elsewhere are 'the equations are nonlinear,' but from what I hear numerical algorithms are great for these types of problems.  What types of numerical algorithms are out there for GR? My phone was just stolen an hour or so ago. Are there any options for tracking? How to interpret the margin of error in a poll? Recently the media reported on a political poll that stated that "46% of Republican voters in Mississippi think that interracial marriage should be illegal".  One example story (of many around the 'net) is this one from the NY Daily News: .  From that article:     A survey conducted last month shows 46% of GOP voters in the state   believe interracial marriage should be illegal - a plurality of the   people questioned   Given that I know many people in interracial marriages (including in my own family) I was motivated to track down the full story rather than fall to the obvious hysteria.  I located the press release on the poll from Public Policy Polling  (PDF)  which has:     46% of these hardcore Republican voters believe interracial marriage   should be illegal, while 40% think it should be legal. With Barbour   included, Huckabee gets more support (22%) from the former than the   latter (15%), as does Palin (13-6). The support for Bachmann (10-2),   Gingrich (13-8), and Pawlenty (4-1) works the opposite way.   And at the end of the first page they state:     PPP surveyed 400 usual Mississippi Republican primary voters from   March 24th to 27th. The survey’s margin of error is +/-4.9%.   Now what I don't understand is how to interpret the results especially the margin of error value.    From the raw numbers, 46% (~50%) of 400 voters is 200 voters who responded who think that interracial marriages should be illegal.  But from stats of Mississippi in the 2008 Federal election, McCain polled about 725,000 Republican votes (to Obamas 556,000). My gut feeling is that you can't extrapolate that 46% number to the other 724,600 Republican voters and still retain a 5% margin of error.  So is the media misrepresenting the numbers (really? the media would do that?!?!?!) Or are there statistics at work that I don't understand?  Thanks for your help! Adding boolean yes/no field in ArcGIS Desktop? How does one add a field to an ArcGIS feature class with a boolean data type? That is an attribute where the allowed value is only one of a pair such as 1/0, Yes/No, On/Off, Present/Not-present, etc.   A boolean data type is not available in the Data Type pick-list. Representative point of a cluster with L1 distance The representative point of a cluster or cluster center for the k-means algorithm is the component-wise mean of the points in its cluster. The mean is chosen because it helps to minimize the within cluster variances (which is to say that it is minimizing within cluster squared Euclidean distance, since its the same). Now, when I want to use a different distance metric, like L1 (Manhattan distance), I would be minimizing the within cluster absolute deviations (if I choose to). I was looking at what the centers calculation would be like, because the mean won't reduce the new objective function, and I found this on the Matlab documentation of their kmeans function for the distance parameter     cityblock - Sum of absolute differences, i.e., the L1 distance. Each centroid is the component-wise median of the points in that cluster.   Now, how did they come up with the component-wise median? How does a median minimize absolute deviations? Is there a general formula for finding all subgroups of dihedral groups? Why does the Community user sometimes approve or reject edits? How does a machine know if my edit is valid? What does it mean if my edit was rejected by Community?     See also: Polynomials, prove exercise question about question There is a polynomial P with integer coefficients and with pairwise different integers $a,b,c$ . Prove that it is not possible for $P(a) = b$, $P(b)=c$, $P(c) = a$  First off I don't understand "pairwise different" part - what does it mean ,can you show me this as an equation? After that I'd like to get a hint in case I don't make it. + I'd prefer to have hints/answers written more algebraically without $\sum$ etc. (It helps me get better understanding what's going on under the hood) I would like to know how many switch can be stacked with fiber channel to get a best transfer rate between computers.  I have 200 computers connected to 12 3Com switches. All switches have two fiber ports.  Is the best way to have fiber backbone switch and connect fiber channel from every switch to the backbone? Or connect switch 1 to switch 2 to switch 3 to ... switch 12 to switch 1 again?  Thanks! I try to understand why for a connected Lie group $G$ the first fundamental group $\pi_1(G)$ is abelian, and mainly why the second fundamental group is trivial $\pi_2(G)=0$?  Thanks for anyone who give me references for a 'simple proof' of these results How to show bibliography alphabetically with biblatex? When and how did "pretty" enter English as an intensifying adverb? Is there something like "Firebug for IE" (for debugging JavaScript)? I'm trying to fix some JavaScript bugs. Firebug makes debugging these issues a lot easier when working in Firefox, but what do you do when the code works fine on Firefox but IE is complaining? Is $$d_1\mid n,d_2\mid n\iff [d_1,d_2]\mid n$$ true ? And if yes, how can I prove it ? I recall that $[d_1,d_2]$ is the least common multiple.  My tries  For the implication : Let $d_1\mid n$ and $d_2\mid n$. Then, $d_1d_2\mid n^2$. By the way, since $d_1,d_2\mid n$, we have that $(d_1,d_2)\mid n$ where $(d_1,d_2)=:\gcd(d_1,d_2)$  and thus $$[d_1,d_2](d_1,d_2)\mid n^2.$$  Question: How can I get $[d_1,d_2]\mid n$ from this?  For the converse, since $d_1,d_2\mid [d_1,d_2]\mid n$, the claim follow. What is an SE "day"? When does each day start? When does a day start on the Stack Exchange network? Some badges (Enthusiast, , ) and voting limits are bound by and relate heavily to the concept of a day. Do days correspond to calendar days? What time zone is used?  Related I'm trying to find the derivative of $\sin^{-1}(x)$. I know the steps that lead to $\frac{1}{\sqrt{1-x^2}}$, however I don't understand why the following reasoning leads to a wrong answer.  Because  $$\frac{d}{dx}f^{-1}(x) = \frac{1}{f'(f^{-1}(x))} $$  If we plug in for $f(x) = \sin(x)$, and because $\frac{d}{dx}\sin(x) = \cos(x)$ we get  $$\frac{d}{dx}\sin^{-1}(x) = \frac{1}{\cos(\sin^{-1}(x))} $$  Since $\sin(x) = \cos(x-\frac{\pi}{2})$, we can state that $\sin^{-1}(x) = \cos^{-1}(x-\frac{\pi}{2})$. (I suspect this is what is wrong)  Thus,  $$\frac{d}{dx}\sin^{-1}(x) = \frac{1}{\cos(\cos^{-1}(x-\frac{\pi}{2}))}$$  Then, by the definition of inverse function, we have  $$\frac{d}{dx}\sin^{-1}(x) = \frac{1}{x - \frac{\pi}{2}}$$ How do I show that $a^p + b^p > (a + b)^p$ for $a,b>0$ and $0<p<1$? A question on my math homework asks us to show that if $0 &lt; p &lt; 1$ and $a, b &gt; 0$, then $a^p + b^p &gt; (a + b)^p$. I have no idea how to do this, any pointers? Switch Stack Exchange site's interface to the beta theme