Generating families of lambda functions
What do (lambda) function closures capture?
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! Java Constructors I am trying to learn how to specify class constructors in Java. I am starting to understand that they specify the types of instance variables of objects made from that class. They also can be used to set the instance variable initial values. The follow example is from the Java tutorial on Sun's website:  public Bicycle(int startCadence, int startSpeed, int startGear) {     gear = startGear;     cadence = startCadence;     speed = startSpeed; }   Where in your classes source code should you put the constructor(s)?  Are these arguments the names of the variables?: (int startCadence, int startSpeed, int startGear) or are gear, cadence and speed the names of the variables?  What is the difference between (int startCadence, int startSpeed, int startGear) and gear, cadence and speed?  In the unlikely event that my instructor or any administrator from Salt Lake Community College ever comes across this question, let me make my intentions clear. This question is posted in the greatest spirit of academic honesty. I ask this question to seek general advice and help in understanding the proper way to use the Java programming language. I in no way use the work of others and represent it as my own work. I use the answers provided here as a general aid in my understanding. I do all my own work and do not copy work provided by people answering my question. I`m using Firefox Sync on a bunch of computers.   I would like to manage my account, by removing some computers. I can't find the place to do this, it should be on the Firefox Sync page, but the official page only has the privacy and download information. What tense should I use to describe something in the past but probably is still true? The title may be a bit confusing. See the below example:     The movie (was/is) so good.   The simplest guideline on deciding which tense to use, past tense or present tense, to describe an object comes down to whether the description was only true that that time or is true even to the present point of time.  But now we talking about literary work(movies,books,etc) of which quality tend to stay the same over time, which tense should we use? What to do with an additional answer which IMHO explains only a small portion of the question, while another answer explains more For the apple.stackexchange question  a 2nd answer was given, which relates to the question, but IMHO does not answer a majority portion of the question. Here some details:   The question is about, how to set the PATH variable in a unified manner. The  details how to change the file /etc/launch.conf. It is to note, that changing this file is needed for the overall answer. The author of the answer does make the valid point that, when he searched for, how to change /etc/launch.conf, the question came up. The  does not detail the change of /etc/launch.conf enough.   So, the general problem is: What to do when an additional answer explains only a small (but unique portion) of the question, while an earlier answer explains more (but not what the additional question explains).  Finally, I think I should note that I am the initial asker and poster of the 1st answer. Will taking a gap year after my Master's degree improve or degrade my potential of doing a PhD? Limits, find a limit that exist in absolute value but not outside the absolute value. Let I be an open interval that contains the point c and let f be a function that is defined on I except possibly at the point c. Suppose that lim |f(x)| as x->c exists. Give an example to show that lim f(x) as x->c may not exist.   Not really sure of an example for this? I tried to write , but I couldn't find any simple explanation page to link to. I ended up garbling a home-spun description of my own with a not-terribly-helpful image from 2012.  This  puts it better than I can:     As a new user in 2015 can there please be more information about what is WinterBash. The link took me to a bunch of stick figures running around making (I think) numbers (I think its a countdown clock). It doesn't explain the event or even what a hat is. – Ian Miller Dec 4 at 2:58   All I found on Meta was dead links. For example,  was downvoted to -2 and answered with a link to an FAQ page that no longer exists. Prove or Disprove: If every nontrivial subgroup of a group $G$ is cyclic, then $G$ is cyclic. Prove or Disprove: If every nontrivial subgroup of a group $G$ is cyclic, then $G$ is cyclic.    This is a question from page $181$, Chapter $3.4$ Elements of Modern Algebra ($8^{th}$ Edition) by Linda Gilbert.  My intuition tells me that the given statement is false, however, I cannot seem to find a rigorous argument (or counterexample) to disprove the statement. Can anyone please point me in the right direction?  I know that if a group $G$ is cyclic, then every subgroup is cyclic. This is not an if and only if statement - hence my intuition telling me the above mentioned statement is false. Spacing before and after section titles I know this subject has been mentioned before, but I'm still having a problem in creating a space under a section title. I used the titlesec package and then tried using the command \titlespacing{\section}...  This is my code. Can anybody help?  \documentclass[10pt]{book} \usepackage[utf8]{inputenc} \usepackage{fullpage} \usepackage[compact]{titlesec} \usepackage{setspace} \usepackage{sectsty} \chapterfont{\huge} \sectionfont{\Huge} \begin{document} \chapter*{Kapitel 1} \section*{Einleitung} \begin{large} \subsection*{1.1 Motivation} Correlations with unordered categorical variables Can future execution start before the synchronous execution is completed Is there a way for @future annotated method to start execution before the synchronous request which invokes it has completed.  In other words, do I have some guarantees that the timing will look like this:  -start sync---call future---end sync---execute future-&gt;   instead of like this:  -start sync---call future---execute future---end sync-&gt;   I couldn't find the execution order guarantees in the documentation, although  states:     The reason why sObjects can’t be passed as arguments to future methods   is because the sObject might change between the time you call the   method and the time it executes. In this case, the future method will   get the old sObject values and might overwrite them.  To work with   sObjects that already exist in the database, pass the sObject ID   instead (or collection of IDs) and use the ID to perform a query for   the most up-to-date record.   This can be read as saying that the future is not queued at the end of the transaction, otherwise Salesforce could guarantee that the sObject sent is the most recent version. And since it's queued during the transaction, it might imply that it also might execute and complete while the synchronous transaction is still running.  On the other hand,  implies that futures are only fired after the transaction completes:     Invoking Database.rollback not only rolls back inserts, but it goes   much, much further.   [...]   It also rolls back:      Calls to @future methods. Any methods called within the rolled back part of your script will not be invoked (also why @future doesn't start until your script completes). Computing: $\int_0^1 \sqrt[3]{x\log{\frac{1}x}} \, \mathrm dx$ Why could the pictures and paintings in Hogwarts talk and the photos of Harry's parents couldn't? How do I copy a string to the clipboard? How can I block all traffic *except* Tor? why __getitem__ cannot be classmethod? Can I skip over releases when upgrading? I am currently using Ubuntu 10.04. I know there is a 10.10 release, but can I upgrade directly to 11.04? Could you walk me through the steps please? Identifying and solving javax.el.PropertyNotFoundException: Target Unreachable For every prime of the form $2^{4n}+1$, 7 is a primitive root.