Here is the PDF I will referring to.:    The algorithm I'm referring to (which can also be found in the PDF file, above) is the following.:  public static long fibonacciBad(int n) {     if(n &lt;= 1)         return n;     else         return fibonacciBad(n-2) + fibonacciBad(n-1); }   I'm trying to understand why fibonacciBad is O( 2^(n/2) ), assuming that I'm correct in that being what the PDF is implying.   I suspect that it has to do with using B for every second numbers of calls in A, but the specifics are unclear to me. Also, could someone please give me an intuitive explanation as to why it's okay for it to be every second number of calls in order to be considered exponential (instead of every single number of calls being at least double the previous one)? (I'm making up this alphabetical notation, A and B, for below. This notation isn't used in the PDF linked to here.)  A:  c_0 = 1  c_1 = 1  c_2 = 1 + c_0 + c_1 = 1 + 1 + 1 = 3  c_3 = 1 + c_1 + c_2 = 1+ 1 + 3 = 5  c_4 = 1 + c_2 + c_3 = 1 + 3 + 5 = 9  c_5 = 1 + c_3 + c_4 = 1 + 5 + 9 = 15  c_6 = 1 + c_4 + c_5 = 1 + 9 + 15 = 25  c_7 = 1+ c_5 + c_6 = 1 + 15 + 25 = 41  c_8 = 1 + c_6 + c_7 = 1 + 25 + 41 = 67   B:  1 + 2 + 4 + ... + 2^(n-1) = 2^n - 1
I understand Big-O notation, but I don't know how to calculate it for many functions. In particular, I've been trying to figure out the computational complexity of the naive version of the Fibonacci sequence:  int Fibonacci(int n) {     if (n &lt;= 1)         return n;     else         return Fibonacci(n - 1) + Fibonacci(n - 2); }   What is the computational complexity of the Fibonacci sequence and how is it calculated?
Consider the equation $$|2^x-3^y|=1$$ in the unknowns $x \in \mathbb{N}$ and $y \in \mathbb{N}$. Is it possible to prove that the only solutions are $(1,1)$, $(2,1)$ and $(3,2)$? Pokemon Egg Disappearing So my Pokemon eggs are reaching "maturity" then they just disappear. I don't get a new Pokemon. The egg just disappears. I had this happen with a 2k and a 5k now. Is this happening to anyone else? Can Git hook scripts be managed along with the repository? We'd like to make a few basic hook scripts that we can all share -- for things like pre-formatting commit messages.  Git has hook scripts for that that are normally stored under &lt;project&gt;/.git/hooks/.  However, those scripts are not propagated when people do a clone and they are not version controlled.    Is there a good way to help everyone get the right hook scripts?  Can I just make those hook scripts point to version controlled scripts in my repo? What is the simplest organism that was observed to learn: change its behavior permanently in response to some event/stimuli in a way that this change persists even if the event does not happen again? I'm having some difficulty understanding how to interpret variable importance output from the Random Forest package. Mean decrease in accuracy is usually described as "the decrease in model accuracy from permuting the values in each feature".   Is this a statement about the feature as a whole or about specific values within the feature? In either case, is the Mean Decrease in Accuracy the number or proportion of observations that are incorrectly classified by removing the feature (or values from the feature) in question from the model?   Say we have the following model:  require(randomForest) data(iris) set.seed(1) dat &lt;- iris dat$Species &lt;- factor(ifelse(dat$Species=='virginica','virginica','other')) model.rf &lt;- randomForest(Species~., dat, ntree=25, importance=TRUE, nodesize=5) model.rf varImpPlot(model.rf)     Call:  randomForest(formula = Species ~ ., data = dat, ntree = 25,  proximity = TRUE, importance = TRUE, nodesize = 5)  Type of random forest: classification Number of trees: 25 No. of variables tried at each split: 2          OOB estimate of  error rate: 3.33% Confusion matrix:           other virginica class.error other        97         3        0.03 virginica     2        48        0.04     In this model, the OOB rate is rather low (around 5%). Yet, the Mean Decrease in Accuracy for the predictor (Petal.Length) with the highest value in this measure is only around 8.   Does this mean that removing Petal.Length from the model would only result in an additional misclassification of 8 or so observations on average?   How could the Mean Decrease in Accuracy for Petal.Length be so low, given that it's the highest in this measure, and thus the other variables have even lower values on this measure? How do I prompt users with a GUI dialog box to choose file/directory path, via the command-line? Prove $\sum_{i=1}^n2^{i-1}=\sum_{i=0}^{n-1}2^i=2^n-1$ combinatorially.  This is easy to prove inductively.  I know that $\sum_{i=0}^n{n\choose i}=2^n$ so maybe change $\sum_{i=0}^{n-1}2^i$ to $\sum_{i=0}^{n-1}\sum_{j=0}^i{i\choose j}$.  I also know that $2^n-1$ is the number of proper subsets in a set of size $n$. The entire answer is moving when hovering the bounty button It's just a minor CSS issue. See the following gif: I am trying to understand how complex numbers made their way into QM. Can we have a theory of the same physics without complex numbers? If so, is the theory using complex numbers easier? Grub menu at boot time... "holding shift" not working I read here at  that holding Shift during boot can bring up the GRUB menu. However I try holding one or the other Shift keys, tapping, tapping then holding, nothing works. Am I missing something? How does one access the GRUB menu during boot time?   No dual boot here, just standard Lubuntu 14.04 install. A circle has the same center as an ellipse and passes through the foci $F_1$ and $F_2$ of the ellipse, two curves intersect in $4$ points. I understand if I boot from a live cd  I can see all the system logs under System > Administration > File Log Viewer   I have a major error with a disk not mounting and I want to trace i tback to the last time it did work and what may have corrupted the ext4 filesystem on it.  So within the File Log Viewer Where do I start examining? Can "Wow!" be a sentence? The question is clear. Can "Wow!" be a sentence?  Imagine a hypothetical context where I'd utter something like this:     Wow! What an amazing idea! I should think about a way to push this fix.   We see "wow" in casual speech often. It bears punctuation marks (typically an exclamation mark, denoting the rising intonation) and a capital letter &mdash; just like all "regular" sentences.  On the other hand, neither Wow! nor What an amazing idea! contain any verbs. These certainly don't have any parts of speech in the other sentence, so what are they? Are they sentences or clauses? In other words, can "Wow!" be a sentence despite its lack of [any implied] verbs, and subsequently lack of any distinguishable predicates?  Please back up your answers with references. Natbib In-Text Citation displays (author?) I'm trying to solve    So far I've done the first part, evaluating the summation ;  where a is just n. I'm not sure where to go from here or what it even means deduce the second summation. I understand that the summation of simply $$\sum\limits_{k=0}^n\cos(kx)$$ is derived from looking at the real part of  $$\sum_{k=0}^n{\rm e}^{ikx} $$I'm guessing they want me to see how the second summation in the question is defined by 'playing around' with the original? What is the penalty for dual US citizens who lie on the ESTA form in order to enter under VWP using their second passport? Do the search engines take the number of 404 errors returned by a site into account when calculating the site rank? For example I have 8,000 404 errors and I am thinking that that's affecting my SEO in a negative way.  However, I read  about 404 errors which suggests that they are not always a negative quality indicator.   So I am confused...are high numbers of 404 errors harmful to a site or not? Is my phone liable to explode if I charge it with a charger that came with a different phone? dpkg:error:parsing file '/var/lib/dpkg/status' near line 1146 package 'python-minimal' Is there a saying or idiom for "trying to get the truth from someone by lying"? context   Mary-Ann got home late from school.  Asked where she had been, she said she had spent the afternoon at the library.  Her father thinks she is lying and says: "I know you haven’t been there because I was there myself".  He is lying because he thinks she will tell the truth if she realizes she has been caught. boyfriend – “your sister told me everything” (sister did nothing) -  girlfriend – “Oh, did she? I’m gonna kill her.    The rationale for doing this is to catch someone by surprise so he will admit having lied.  Soemtimes, however, the person isn’t lying and the real liar will have to reap the consequences of his reproachable action, having to admit he was just/it was just ...........(saying or idiom).....