Expectation and covariance calculation Let $X_{1},X_{2},X_{3}....X_{n}$ be independent and identically distributed random variables with continuous density symmetric around 0. Also suppose $\mathbb{E}(|X_{1}|)$=2. Define two variables Y and Z as $Y=\sum_{i=1}^{n}X_{i}$ and $Z=\sum_{i=1}^{n}$1$_{X_{i}&gt;0}$ We are asked to find the covariance between Y and Z. My approach: As $X_{i} $ has symmetric density around 0, $\mathbb{P}(X_{i}&gt;0)=\frac{1}{2}$ and because Z is an indicator function for each $X_{i}$ being greater than 0, Z $\sim$ Bin(n,$\frac{1}{2}$). Because $\mathbb{E}(|X_{i}|)$=2, $\int_{0}^{\infty}xf_{x}(x) dx=1$ and $\int_{-\infty}^{0}xf_{x}(x) dx=-1$ Which means that expectations of $x$ given $x$ is positive or negative are 1 and -1 respectively. Now $\mathrm{Cov}(Y,Z)=\mathbb{E}(YZ) - \mathbb{E}(Y)\mathbb{E}(Z)$, let’s call $W=f(Y,Z)=YZ$, using law of iterated expectations with a slight abuse of notation $\mathbb{E}(W)=\mathbb{E}(\mathbb{E}(W|Z=r)$, where the first expectation on right is with respect to the marginal of Z and inner expectation is with respect to conditional distribution of W with for a given Z=r. For the inner expectation, given a value of Z=r, the term in Z would have exactly $r$ $1$’s and $n-r$ $0$’s which would be multiplied with each $X_{i}$ term in Y so $W|(Z=r)=r(\sum_{i=1}^{n}X_{i})$ so that the inner expectation becomes $\mathbb{E}(W|Z=r)=r\mathbb{E}(\sum_{i=1}^{N}X_{i})$. The expectation on right has exactly $r$ times $1$’s and $n-r$ times $-1$’s corresponding to $X_{i}$ being positive $r$ times with expectation of $1$ and negative $n-r$ times with expectation of $-1$. So $\mathbb{E}(W|Z=r)=r(2r-n)=2r^{2}-rn$ Since Z$\sim$ Bin(n,$\frac{1}{2}$), $\mathbb{E}(Z)=\frac{n}{2}$, $\mathrm{Var}(Z)=\frac{n}{4}$ so $\mathbb{E}(Z^{2})=\frac{n}{4}+\frac{n^{2}}{4}=\frac{n(n+1)}{4}$ Hence the final expression becomes $\mathbb{E}(W)=2\mathbb{E}(r^{2})-n\mathbb{E}(r)=\frac{n^{2}+n}{2}-\frac{n^{2}}{2}=\frac{n}{2}$ And since $\mathbb{E}(Y)=0$ due to symmetric density around 0, $\mathrm{Cov}(Y,Z)=\mathbb{E}(W)-\mathbb{E}(Y)\mathbb{E}(Z)=\frac{n}{2}$ Is the above approach correct for finding the covariance between Y and Z? Any suggestions/corrections will helpful
Covariance between sum of iid random variables and sum of indicator functions The question is-     Let $X_1,X_2,..,X_n$ be iid random variables from a continuous distribution whose density is symmetric about $0$. Suppose $\mathbb{E}(|X_1|)=2$ and define $Y=\sum_{i=1}^{n}X_i$ and $Z=\sum_{i=1}^{n}I(X_i&gt;0)$. Then calculate covariance between $Y$ and $Z$.   My attempt:  $E(X_i)=0$ for all $i=1(1)n$ because $X$ is symmetric about $0$ and $E(|X|) $ exists.   Now,  $Cov (Y,Z)=E(YZ)-E(Y)E(Z)$ $=E(YZ)-0$ $=E[(\sum_{i=1}^{n}X_i)(\sum_{i=1}^{n}I(X_i&gt;0)]$  $=(\sum_{i=1}^{n}E[(X_i.I(X_i&gt;0))]$ $+\sum\sum_{i \neq j}E(X_i)E(I(X_j&gt;0)$ as $X_i,X_j$ are independent.   $=\sum_{i=1}^{n}E[(X_i.I(X_i&gt;0)] +0 $ as $E(X_i)=0$  $ =\sum_{i=1}^{n}\{E[X_i.I(X_i&gt;0)|I(X_i&gt;0)=1]×1/2] + E[X_i.I(X_i&gt;0)|I(X_i&gt;0)=0]×1/2]\}$  $=\sum_{i=1}^{n}E[X_i.I(X_i&gt;0)|I(X_i&gt;0)=1]×1/2] +0$  $=\sum_{i=1}^{n}E[X_i|X_i&gt;0]×1/2]$  $=2n×(1/2)$ $=n$  Is my reasoning correct ? Thanks in advance!
Are there names for consonant-shifts when suffixes are added? Let $A$ be an $n\times n$ complex nilpotent matrix. Then we know that because all eigenvalues of $A$ must be $0$, it follows that $\text{tr}(A^n)=0$ for all positive integers $n$.  What I would like to show is the converse, that is,      if $\text{tr}(A^n)=0$ for all positive integers $n$, then $A$ is nilpotent.   I tried to show that $0$ must be an eigenvalue of $A$, then try to show that all other eigenvalues must be equal to 0. However, I am stuck at the point where I need to show that $\det(A)=0$.  May I know of the approach to show that $A$ is nilpotent? From the man page on git-merge, there are a number of merge strategies you can use.     resolve -  This can only resolve two heads (i.e. the current branch and another branch you pulled from) using 3-way merge algorithm. It tries to carefully detect criss-cross merge ambiguities and is considered generally safe and fast. recursive -  This can only resolve two heads using 3-way merge algorithm. When there are more than one common ancestors that can be used for 3-way merge, it creates a merged tree of the common ancestors and uses that as the reference tree for the 3-way merge. This has been reported to result in fewer merge conflicts without causing mis-merges by tests done on actual merge commits taken from Linux 2.6 kernel development history. Additionally this can detect and handle merges involving renames. This is the default merge strategy when pulling or merging one branch. octopus -  This resolves more than two-head case, but refuses to do complex merge that needs manual resolution. It is primarily meant to be used for bundling topic branch heads together. This is the default merge strategy when pulling or merging more than one branches. ours -  This resolves any number of heads, but the result of the merge is always the current branch head. It is meant to be used to supersede old development history of side branches. subtree -  This is a modified recursive strategy. When merging trees A and B, if B corresponds to a subtree of A, B is first adjusted to match the tree structure of A, instead of reading the trees at the same level. This adjustment is also done to the common ancestor tree.   When should I specify something different than the default?  What scenarios are each best for? Proving that an integral domain has at most two elements that satisfy the equation $x^2 = 1$. Why every polynomial over the algebraic numbers $F$ splits over $F$? I read that if $F$ is the field of algebraic numbers over $\mathbb{Q}$, then every polynomial in $F[x]$ splits over $F$. That's awesome! Nevertheless, I don't fully understand why it is true. Can you throw some ideas about why this is true? Interpretation of simple predictions to odds ratios in logistic regression I'm somewhat new to using logistic regression, and a bit confused by a discrepancy between  my interpretations of the following values which I thought would be the same:    exponentiated beta values  predicted probability of the outcome using beta values.    Here is a simplified version of the model I am using, where undernutrition and insurance are both binary, and wealth is continuous:  Under.Nutrition ~ insurance + wealth   My (actual) model returns an exponentiated beta value of .8 for insurance, which I would interpret as:     "The probability of being undernourished for an insured individual is .8 times the probability of being undernourished for an uninsured individual."   However, when I calculate the difference in probabilities for individuals by putting in values of 0 and 1 into the insurance variable and the mean value for wealth, the difference in undernutrition is only .04. That is calculated as follows:   Probability Undernourished = exp(β0 + β1*Insurance + β2*Wealth) /                              (1+exp(β0 + β1*Insurance + β2*wealth))   I would really appreciate it if someone could explain why these values are different, and what a better interpretation (particularly for the second value) might be.     Further Clarification Edits As I understand it, the probability of being under-nourished for an uninsured person (where B1 corresponds to insurance) is:  Prob(Unins) = exp(β0 + β1*0 + β2*Wealth) /               (1+exp(β0 + β1*0+ β2*wealth))   While the Probability of being under-nourished for an insured person is:  Prob(Ins)= exp(β0 + β1*1 + β2*Wealth) /            (1+exp(β0 + β1*1+ β2*wealth))   The odds of being undernourished for an uninsured person compared to an insured person is:  exp(B1)   Is there a way to translate between these values (mathematically)? I'm still a bit confused by this equation (where I should probably be a different value on the RHS):  Prob(Ins) - Prob(Unins) != exp(B)   In layman's terms, the question is why doesn't insuring an individual change their probability of being under-nourished as much as the odds ratio indicates it does?  In my data, Prob(Ins) - Prob(Unins) = .04, where the exponentiated beta value is .8 (so why is the difference not .2?) How to handle dynamic changing ID's In XPath? I sadly haven't been able to answer this questions using Google. In beamer, I'd like to make the default font for the entire title page, as well as frame titles, to be the default font from the old  (example ). Keep values selected after form submission Use of substitution into the integral $\int_0^2 \frac{\arctan x}{x^2+2x+2}dx$ Intersection of finitely generated ideals Let $I$, $J$ be finitely generated ideals in a ring $A$ (commutative with identity). I know that the intersection need not be finitely generated: can somebody give me an example?   Thanks. Change of flavour, Weak interaction I couldn't find a straight and clear answer to this question on the internet: Why is the weak interaction (charged), the only interaction which can change the flavours of the quarks? I am to prove by induction that given that $a+1/a$ is an integer (i.e. belongs to Z  ) then $a^n+1/a^n$ is an integer too. I'm pretty much clueless here. Thanks in advance. Is there an efficient method of converting an integer into the written numbers, for example:  string Written = IntegerToWritten(21);   would return "Twenty One".  Is there any way of doing this that doesn't involve a massive look-up table? Instantiate a class with or without parentheses? Finding distance between consecutive points using ArcGIS Desktop? How do AD/AP boosts apply to abilities with long cast times, channels or animations? For example: I'm playing Janna in bot lane with Caitlyn. Caitlyn begins channeling Ace in the Hole to finish off an enemy. Will the AD buff from my Eye of the Storm apply extra damage to Caitlyn's ultimate if I cast at after she begins channeling? Similarly, if I see Caitlyn rev up to shoot Piltover Peacemaker, can I boost her AD after the animation begins? (If I remember correctly, Piltover Peacemaker has a quick cast time, but the spell animation is rather long, so it may be a different circumstance from the first example.)  Basically, I want to know if the AD is calculated at the start of a cast, at the end of a cast, or when the ability actually creates and object on the battlefield. If the $n^{th}$ partial sum of a series $\sum a_n$ is $S_n = \frac{n-1}{n+1}$, find $a_n$ and the sum. Calculate the sum of the infinite series $\sum_{n=0}^{\infty} \frac{n}{4^n}$ A previous problem had us solving $\sum_{n=0}^{\infty} \frac{1}{4^n}$ which I calculated to be $\frac{4}{3}$ using a bit of mathematical manipulation.   Wonderful. Thank you for all the prompt responses.  Could anyone suggest an alternate technique that does not involve differentiation? Question: Are there infinitely many primes of the form $4n+3$ and $4n+1$?  My attempt: Suppose the contrary that there exist finitely many primes of the form $4n+3$, say $k+1$ of them: $3,p_1,p_2,....,p_k$  Consider $N = 4p_1p_2p_3...p_k+3$, $N$ cannot be a prime of this form. So suppose that $N$=$q_1...q_r$, where $q_i∈P$  Claim: At least one of the $q_i$'s is of the form $4n+3$:  Proof for my claim: $N$ is odd $\Rightarrow q_1,...,q_r$ are odd $\Rightarrow q_i \equiv 1\ (\text{mod }4)$ or $q_i ≡ 3\ (\text{mod }4)$  If all $q_1,...q_r$ are of the form $4n+1$, then $(4n+1)(4m+1)=16nm+4n+4m+1 = 4(\cdots) +1$  Therefore, $N=q_1...q_r = 4m+1$. But $N=4p_1..p_k+3$, i.e. $N≡3\ (\text{mod }4)$, $N$ is congruent to $1\ \text{mod }4$ which is a contradiction.  Therefore, at least one of $q_i \equiv 3\ (\text{mod }4)$. Suppose $q_j\equiv 3\ (\text{mod }4)$  $\Rightarrow$ $q_j=p_i$ for some $1\leq i \leq k$ or $q_j =3$  If $q_j=p_i≠3$ then $q_j$ | $N = 4p_1...p_k + 3 \Rightarrow q_j=3$ Contradiction!  If $q_j=3$ ($\neq p_i$, $1\leq i \leq k$) then $q_j | N = 4 p_1...p_k + 3 \Rightarrow q_j=p_t$ for some $1 \leq i \leq k$ Contradiction!  In fact, there must be also infinitely many primes of the form $4n+1$ (according to my search), but the above method does not work for its proof. I could not understand why it does not work. Could you please show me?  Regards