How to find T(n) of the following code. I need an analysis.  void abc(int n) {   for(int i = 0; i&lt;n; i++){     for(int j = 0; j&lt;i; j++){         System.out.println("Hello World");     }   } }
I need to calculate the time complexity of the following code:  for (i = 1; i &lt;= n; i++) {   for(j = 1; j &lt;= i; j++)   {    // Some code   } }   Is it O(n^2)?
Why does the guestbook chatbox not produce any network activity? I was trying to test if I was able to automatically send a message through curl by inspecting the network activity on chrome and getting the curl command, but I found out that in spite of messages showing up in the gestbook chat there was no any network activity. Why? How do electric currents make light? In an incandescent light bulb, electrons flow through wires to the bulb, where is passes through a filament, and the filament lights up.  Does this work because of several high energy electrons losing some of their energy to disturb the electromagnetic field, creating photons? The electrons just leave the filament afterward and are replaced by more high-energy electrons from the negative terminal. Or does it work differently?  As a secondary question, is there a type of light bulb that directly converts electron flow to photons? Does the OP of a flagged post get comment notifications if the post is deleted by mods? Why does C/C++ differentiates in case of array index out of bound #include &lt;stdio.h&gt; int main() {     int a[10];     a[3]=4;     a[11]=3;//does not give segmentation fault     a[25]=4;//does not give segmentation fault     a[20000]=3; //gives segmentation fault     return 0; }  I understand that it's trying to access memory allocated to process or thread in case of a[11] or a[25] and it's going out of stack bounds in case of a[20000]. Why doesn't compiler or linker give an error, aren't they aware of the array size? If not then how does sizeof(a) work correctly? Installing QGIS Statist plugin in Mac OS X? Determinant of a specially structured matrix ($a$'s on the diagonal, all other entries equal to $b$) I have the following $n\times n$ matrix:  $$A=\begin{bmatrix} a &amp; b &amp; \ldots &amp; b\\ b &amp; a &amp; \ldots &amp; b\\ \vdots &amp; \vdots &amp; \ddots &amp; \vdots\\ b &amp; b &amp; \ldots &amp; a\end{bmatrix}$$  where $0 &lt; b &lt; a$.  I am interested in the expression for the determinant $\det[A]$ in terms of $a$, $b$ and $n$.  This seems like a trivial problem, as the matrix $A$ has such a nice structure, but my linear algebra skills are pretty rusty and I can't figure it out.  Any help would be appreciated. Recalculate google sheet on demand: I have the following formula in a sheet:  =if(E1="HOLD",,query(Cust_Orders!B6:Z5000,"Select Y,G,I,H,K where H&gt;0  "))   With E1 being a drop down with values HOLD and FETCH  The recalculation when I go to FETCH takes about 13 seconds.  But when it is in HOLD, the query doesn't exceute, and everything goes blank. Not what I want.  I'm trying to avoid recalculating this query every time I make a change in the Cust_Orders range, but keep the old values, as two different pivot tables that are viewed by other people are dependent on it.  Google spreadsheet recalc settings all are 'on change and foo'  Is there a way to do this? Determine all functions satisfying $f(x + f(x + y)) + f(xy) = x + f(x + y) +yf(x)$ Do lure modules and incense cause new pokemon to spawn near you, or existing pokemon to be drawn to you? how to get the selected date in jquery Do we need a global test before post hoc tests? What are the dev-loop services that started on boot? I am looking for a closed form (ideally expressed as elementary functions) of the function $\exp_n(x) = \sum_{k=0}^n x^k / k!$.  I am already aware of expressing it in terms of the gamma function. Background / Motivation When counting combinations of objects with generating functions, it is useful to be able to express the partial sum $1 + x + \cdots + x^n$ as $\frac{1-x^{n+1}}{1-x}$. For example, to count the number of ways to pick 5 marbles from a bag of blue, red, and green marbles where we pick at most 3 blue marbles and at most 2 red marbles, we can consider the generating function $f(x) = (1+x+x^2+x^3)(1+x+x^2)(1+x+x^2+\cdots)$. By using the partial sum identity, we can express it as $f(x) = \left(\frac{1-x^4}{1-x}\right)\left(\frac{1-x^3}{1-x}\right)\left(\frac{1}{1-x}\right)$.  Simplify, express as simpler product of series, and find the coefficient of the $x^5$ term. I want to be able to do the same for a generating function in the form $g(x) = \exp_{n_1}(x)^{p_1} \exp_{n_2}(x)^{p_2} \cdots \exp_{n_j}(x)^{p_j}$ The easiest way to extract the coefficient of a given term $x^p / p!$ would be to use a similar closed form expression for $\exp_n(x)$ and a similar technique to $f$. Attempted Solutions Differential equation Recall that the way to prove the identity $1+x+x^2+\cdots+x^n = \frac{1-x^{n+1}}{1-x}$ is to define $S = 1 + x + x^2 + \cdots + x^n$ and notice that: $S - Sx = 1 - x^{n+1}$. Likewise, notice that $y(x) = \exp_n(x)$ satisfies $y - y' = x^n/n!$.  Via SAGE, the solution is $y(x) = \frac{c+\Gamma(n+1,x)}{n!}e^x$.  Our initial condition $y(0) = 0$ so $c=0$.  By , $\Gamma(n+1,x) = n! e^{-x} \exp_n(x)$ so we have $y(x) = \exp_n(x)$. Recurrence Relation Notice that $\exp_n(x) = \exp_{n-1}(x) + x^n/n!$. Using the unilateral Z-Transform and related properties, we find that $\mathcal{Z}[\exp_n(x)] = (z e^{x/z})/(z-1)$. Therefore, $\exp_n(x) = \mathcal{Z}^{-1}\left[(z e^{x/z})/(z-1)\right] = \frac{1}{2 \pi i} \oint_C z^n e^{x/z}/(z-1)\;dz$. $(z^n e^{x/z})/(z-1)$ has two singularities: $z = 1$ and $z = 0$.  The point $z = 1$ is a pole of order one with residue $e^x$.  To find the residue at $z = 0$ consider the product $z^n e^{x/z} (-1/(1-z)) = -z^n \left( \sum_{m=0}^\infty x^m z^{-m} / m! \right) \left( \sum_{j=0}^\infty x^j \right)$.  The coefficient of the $z^{-1}$ term is given when $n - m + j = -1$. The residue of the point $z=0$ is then $-\sum_{m,j} x^m / m! = -\sum_{m=n+1}^\infty x^m / m!$. Let $C$ by the positively oriented unit circle centered at the origin.  By Cauchy's Residue Theorem, $\frac{1}{2 \pi i} \oint_C z^n e^{x/z}/(z-1)\;dz = \frac{1}{2 \pi i} 2 \pi i \left(e^x - \sum_{m=n+1}^\infty x^m / m!\right) = \exp_n(x)$. Finite Calculus I've tried to evaluate the sum using finite calculus, but can't seem to make much progress. How to know the types of windowing system, window manager and desktop environment of a Unix-like OS Disable cache for some images I've found conflicting sources over who initiated the idea of Marvel's Multiverse having numbered universes.  Some say Alan Moore's Captain Britain was the first to use Earth-616, whereas others indicate it was fan-created from Fanzines: with Mark Gruenwald's Omniverse being the frontrunner.  Who is responsible for creating the universe designations? Is there any credible information on their development? Self Teaching QFT I am currently in the process of teaching myself QFT.  It is not an easy task.  I have armed myself with many of the standard textbooks.  However, I am slow learner.   I get stuck on a thousand different terms which I don't understand, and a style of 'mathematics speak'  which loses me 95% of the time.   There are so many gaps in my knowledge that if I were a ship I would be at the bottom of the ocean.  What I really need is a book called 'QFT for Morons'. That's a bit harsh but 'QFT for dummies' doesn't quite express it clearly enough and besides there isn't such a book as far as I can find.  Any suggestions of resources or books that might help?   What I am really looking for is the one that explains QFT like you were talking to a five year old.  Perhaps I am asking the impossible.  I will add a bit more of a specific question here.    I have learnt that there are groups and non-abelian Lie groups like SU(2) etc., and then there a lagrangians, as well as a few other things like operators and states.   So a really dumb question is how are the lagrangians derived?  Are they determined by the group?  I am also confused because I understand some of the groups like SU(3) are used for different things in QFT.   I feel compelled to appologize for my ignorance but I am determined to make so more progress with this.   The problem when one is teaching oneself is you don't know which is the most fruitful path to follow. Help finding a combinatorial proof of $k {n \choose k } = n {n - 1 \choose k -1}$ Help finding a combinatorial proof of $k {n \choose k } = n {n - 1 \choose k -1}$  I have expanded it this far:  $$\frac{k \cdot n!}{k!(n-k)!} = \frac{n \cdot (n-1)!}{(k-1)!(n-k)!} $$  but then I am stuck from where to go from there. Difference between knockout View Models declared as object literals vs functions multiline command chunks in bash history into multiple lines In Bash (as well as Bash in WSL), multiline written commands can call-back with up/down arrows correctly also built-in history command report them correctly (until I'm still logged-in in bash). But after exiting from bash and press up/down arrows, multiline commands appears each as separate entries and that's because cat ~/.bash_history has chucked the command on multiple separate entries and writing problem here; the history command result messed too. I have set these options in ~/.bashrc shopt -s cmdhist lithist HISTTIMEFORMAT='%F %T '  and now writing problem fixed but history command still report in multiple line and separate entries (reading problem now). Bash version is 4.3, same issue on v4.4 there is  since a long years but no solution yet. Update: it's also to mention that below multiline command as an example is correctly displaying even after exit Bash: for i in {1..10} do echo $i done  but this is failing: awk ' { print $1}' &lt;&lt;&lt;'first last'  Update 2: the issue mentioned above is fixed in Bash v5.0.0+ that changed to recognize entries between &quot;timestamp as delimiter&quot; as single entry of command (HISTTIMEFORMAT, cmdhist and lithist must be set).