Here is a question from Indian Statistical Institute (ISI) Entrance Exam CSA-2020, Question 11: $\binom n0, \binom n1,..., \binom nn$ denote the binomial coefficients in the expansion of $(1 + x)^n \ \text{where} \   p &gt; 0$ is a real number and $q = 1 − p$ then $$  \sum\limits_{r=0}^n r^2 \binom nr p^{n-r}q^r  $$ is equal to $ (A)\ np^2q^2 \ (B)\ n^2p^2q^2 \ (C)\ npq + n^2p^2 \ (D)\ npq + n^2q^2 $  My Thoughts: (1) If I put the formula for $\binom nr$ in the given sum. I am getting $$  \sum\limits_{r=0}^n r^2 \frac{n!}{r!(n-r)!} p^{n-r}q^r  $$ How do I proceed after this?  Edit: Taking help from  and the comments below I wrote the following, although I am stuck in the last step, please help me out. $$ (1+x)^n=\sum\limits_{r=0}^n \binom nr x^r $$ Taking derivative on both sides we have: $$ n(1+x)^{n-1}=\sum\limits_{r=1}^n r\binom nr x^{r-1} $$ Multiplying both sides by $x$ we get: $$ nx(1+x)^{n-1}=\sum\limits_{r=1}^n r \binom nr x^r $$ Taking derivative another time: $$ n(1+x)^{n-1}+nx(n-1)(1+x)^{n-2}=\sum\limits_{r=1}^n r^2 \binom nr x^{r-1} $$ Multiplying both sides by $x$ we get: $$ nx(1+x)^{n-1}+nx^2(n-1)(1+x)^{n-2}=\sum\limits_{r=1}^n r^2 \binom nr x^r $$ Given that $p&gt;0$ and $q=1-p$ . So let $x=\frac qp$ then we have: $$ n\frac qp\left(1+\frac qp\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(1+\frac qp\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  n\frac qp\left(\frac{p+q}{p}\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(\frac{p+q}{p}\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  n\frac qp \left(\frac{1}{p}\right)^{n-1}+ n\left(\frac qp\right)^2(n-1)\left(\frac{1}{p}\right)^{n-2} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r \ \ \ \ \  [\text{Since}\ p+q=1] $$ $$ \implies  n\frac{q}{p^n}+ n(n-1)\frac{q^2}{p^n} = \sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  nq+ n(n-1)q^2 = p^n\sum\limits_{r=1}^n r^2 \binom nr \left(\frac qp \right)^r $$ $$ \implies  nq+ n(n-1)q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n(q-q^2)+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n\{(1-p)-(1-p)^2\}+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  n\{(1-p)-(1+p^2-2p)\}+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  np(1-p)+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ $$ \implies  npq+ n^2q^2 = \sum\limits_{r=1}^n r^2 \binom nr p^{n-r}q^r $$ Hence option (D) is correct.  This question is almost similar to  but is slightly different. So I have added this question.
Can this identity be derived from the binomial theorem?  $$n(n+1)2^{n-2} = \sum_{i=1}^{n}  i^2 \binom{n}{i}$$    I tried starting from $2^n = \displaystyle\sum_{i=0}^{n} \binom{n}{i}$ and dividing it by $4$ in order to get $2^{n-2}$.
Singular information matrix error in lrm.fit in R I am running an ordinal logistic regression in R and running into trouble when I include dummy variables.  My model works great with my first set of predictors.  Next I want to add dummy variables for each of the years represented in my dataset.    I created the dummy variables with car:recode in this manner (one statement like this for each of the 11 years)  fsd$admityear2000 &lt;- recode(fsd$ApplicationYear ,"2000=1;else=0")   The lrm model is specified as follows  library(Design) ddist&lt;- datadist(fsd) options(datadist='ddist') m4 &lt;- lrm(Outcome ~ relGPA + mcAvgGPA + Interview_Z + WorkHistory_years + GMAT + UGI_Gourman + admityear1999 + admityear2000 + admityear2001 + admityear2002 + admityear2003 + admityear2004 + admityear2005 + admityear2006 + admityear2007 + admityear2008 + admityear2009, data=fsd)   (sorry for all of the other random variables, but I don't want to introduce confusion by changing my code)  I get the error  singular information matrix in lrm.fit (rank= 22 ).  Offending variable(s): admityear2009 admityear2000 admityear1999  Error in lrm(Outcome ~ relGPA + mcAvgGPA + Interview_Z + WorkHistory_years +  :    Unable to fit model using “lrm.fit”   I understand that including all options of a dummy variable over-defines the model, but I get the error whether I include all 11 years or just 10.  I found a suggestion  to set the penalty parameter of lrm to a small positive value.  Setting it to 1 or 5 changes the error such that it only names one of the variables as offending.  The error doesn't go away even with penalty=100.  I'm pretty new to R, but loving the freedom so far.  Thanks for any help!  Responses and Lessons   Factors are awesome and I can't believe I didn't notice them earlier. Man that cleans up my code a lot.  Thanks! My DV, 'Outcome' is indeed ordinal and after making it a factor(), I also made it ordered(). The str() command is also awesome and this is what my data now looks like (with some of the non-relevant variables omitted)   output:  str(fsd)      Outcome      : Ord.factor w/ 3 levels "0"&lt;"1"&lt;"2" relGPA       : num   mcAvgGPA     : num  admitschool  : Factor w/ 4 levels "1","2","3","4" appyear      : Factor w/ 11 levels "1999","2000",..    both lrm() and polr() now run successfully, and they both deal with appyear by dropping some values of the factor.  lrm() drops 1999, 2000, and 2001 while polr() just drops 1999 and 2000.  lrm() gives no warnings while polr() says "design appears to be rank-deficient, so dropping some coefs."  This is an improvement, but I still don't understand why more than one value needs to be dropped. xtabs shows that there isn't full seperation right?   output:  xtabs(~fsd$appyear + fsd$Outcome)            fsd$Outcome fsd$appyear    0    1    2        1999 1207  123  418        2000 1833  246  510        2001 1805  294  553        2002 1167  177  598        2003 4070  158 1076        2004 2803  106 1138        2005 3749  513 2141        2006 4429  519 2028        2007 6134  670 1947        2008 7446  662 1994        2009 4411   86 1118 I have a shop created with drupal commerece modules,I enabled 2 currency in my shop , but only show one of them, I want to show price in 2 currency       something like this price :  10$  / 20 IRR I use multi currency module to achieve this job, but  I my problem is in payment  phase, I use multi currency module to achieve this job,in multicurrency  module's setting I don't want  use  synchronize method, if you want have two field in my product , one form $ and another for IRR, I did this job by this method     first enable IRR currency in  admin/commerce/config/currency  then in  admin/commerce/config/currency/handling under Enable dedicated price fields for Product check Iranian Rial  by doing this  another field added you my product ( ** Price for IRR** ), this is good , after this I enable  *currency selector * block ,in checking out process by switching the currency I don't see any change in current currency of billing and cart. :( why changing currency not changing cart currency? "need not to be neither atomic nor ordered" Is this double/triple negative grammatically sound?  Ordered operations require that space on disk is allocated sequentially, so spatial ordering corresponds to chronology of operations, but actual disk writes need not to be neither atomic nor ordered.   Explanation:   Words neither and nor emphasize on the fact that both conditions are (independently) allowed to remain unsatisfied, that both are optional. To be more formal, "need not be atomic and need not be ordered". But then again, it becomes a concoction of two negations joined by a conjunction. My grandparents bought a flight on United Airlines, as the one and same ticket, from Toronto, to ORD with one 55-minute layover, then to Maui. :     You won’t need to pay extra for airfare if you miss the flight, but on the other hand, you will most likely not be compensated by the airline for the incurred delay. It always depends on the amount of time, the reason for the delay and the airline’s policies. As soon as it’s weather-related, you won’t be getting a penny (and that’s normal: airlines can’t control the weather).    Yet they obviously prefer to avoid such charges from missing the 2nd flight.   Please see the titled question? Would they need to hotfoot or scamper from one gate to another, to not miss the 2nd flight? If yes to 2, can they request an airport electric shuttle cart now, before the flight? "did shoot" vs "shot" This morning I read this sentence (see ):     On July 24th and again on July 29th,   Egyptian police did shoot dead unarmed   African migrants attempting to cross   that border.   Why "did shoot" and not "shot"? Now that Lightning is here, what's the future of Visualforce? (in short - Visualforce vs Lightning) As a developer, just curious to know what's the future of Visualforce (pages, components, email templates, etc..) ??  I believe for sure there will be backward compatibility so that the existing ones will still run.  But what's gonna happen next (say after couple of releases when lightning becomes GA &amp; goes mainstream). ??    will Salesforce stop customers from using VF for new development ? will VF &amp; L work together (like embed one in another or call one from another) is it possible to migrate / upgrade existing VF to L without rewriting ?   Just a few questions i can think of now.. but in general if any of you know more details on these, please share with us..  Thanks When you boot from live CD, or doing the first boot after installing Ubuntu, splash screen looks awesome. But as soon as you enable nvidia-current driver, installed with apt-get, splash screen goes all crazy.  With crazy I mean that resolution is very low, font(I assume) is very weird and it all looks like it's been broken.  This happened with 10.04 and now again with 10.10.  How do I fix splash screen after enabling nvidia drivers? Is there an easy way to change filetype association? After the upgrade to 11.10 I've had the problems that    all music-files would open with banshee, which then crashed all folders would open with konsole   The first problem I  after installation of "ubuntu tweak" "> admin > filetype Associations".. Changed back to totem.  The second was somehow not accessible this way (did not give any possibility to add commands).  I've changed the line "inode/directory=nautilus-folder-hanlder.desktop" to "inode/directory=nautilus.desktop" from "/usr/share/applications/defaults.list" and now everything works fine.  Question: More convenient ways to do that? Why is my dual-core CPU recognized as a quad-core one? My processor is an . As you can see, it's 2 cores and 4 threads.  Although, both Ubuntu 11.04 and Windows 7 seem to think it's a quad-core CPU:      Why is this? Is it because there are 2 threads per core, dividing the CPU in 4 processing units? Calendar link to different page views I have custom fields in contacts form named checkbox1__c, checkbox11__c, checkbox12__c, checkbox13__c.  When I check checkbox1__c then I want checkbox11__c,  checkbox12__c,  checkbox13__c to be unchecked.  When I unchecked checkbox1__c then I want checkbox11__c, checkbox12__c, checkbox13__c to be checked.  Is there any way to do this by using validation-rules? If not no way to this by validation-rules, then what is the best way to do this? Why did the Emperor remain motionless while Darth Vader threw him off the balcony? I'm wondering whether this was a movie sin but his body position seemed to stay the same? Also why didn't he stop using Force Lightning? He continued to use it even as he was falling down.   I'm also wondering whether Palpatine meant to electrocute Vader or was it just a coincidence (because he kept firing Force Lightning) .  It makes no sense as he just stood there allowing Vader to throw him. nginx: Redirect https traffic without subdomain to subdomain (non-www to www) My current ssl certificate covers the subdomains www.example.com and static.example.com  So if a users try to access my site via  I want to redirect him to  .   How can I do that within in my nginx conf?  I know that similiar questions have been asked here, but I could not find the solution here. string array with garbage character at end I have a char array buffer that I am using to store characters that the user will input one by one.  My code below works but has a few glitches that I can't figure out:   when I execute a printf to see what's in Buffer, it does fill up but I get garbage characters at the end it won't stop at 8 characters despite being declared as char Buffer[8];   Can somebody please explain to me what is going on and perhaps how I could fix this? Thanks.  char Buffer[8]; //holds the byte stream int i=0;  if (/* user input event has occurred */)  {         Buffer[i] = charInput;         i++;          // Display a response to input         printf("Buffer is %s!\n", Buffer);  }   Output:   tagBuffer is 1┬┬w! tagBuffer is 12┬w! tagBuffer is 123w! tagBuffer is 1234! tagBuffer is 12345! tagBuffer is 123456=! tagBuffer is 1234567! tagBuffer is 12345678!  tagBuffer is 123456789! I tried the Chrome development version for a few days, didn't like it because my tabs became broken and wouldn't load properly. I changed back to the live version, but I forgot to uninstall the development version, which gave me 2 chrome icons on my task bar, but they would both load a broken version of Chrome. I then uninstalled Chrome through the control panel and reinstalled the live version, but I now have one of those broken links on my task bar (a blank page with a folded corner) that points to a version of Chrome that's no longer there. Is there a way to remove this icon? How to install driver for TP-Link TL-WN722N(EU)V2 on Ubuntu 17.04 Kylin I can not install the TP-LINK WN722N V2, which includes a 8188 EUS chip. Then I tried to install the backports v4.4.2,but   do not want to recognize either.  The TP-Link driver installation errors thrown out:  man@kman-livve:~$ cd '/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417' kman@kman-livve:~/Documents/Tplink ...$ sudo make  "******************************************" "NO SKRC,we will use default KSRC" "******************************************" make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.10.0-15-generic/build M=/home/kman/Documents/Tplink 722 N V2/rtl8188EUS_linux_v4.3.0.8_13968.20150417  modules make[1]: Entering directory '/usr/src/linux-headers-4.10.0-15-generic' arch/x86/Makefile:140: CONFIG_X86_X32 enabled but no binutils support make[1]: *** No rule to make target '722'.  Stop. make[1]: Leaving directory '/usr/src/linux-headers-4.10.0-15-generic' Makefile:1367: recipe for target 'modules' failed   A method to know him, I do not know about. Thanks  Model:TL-WN722N(EU)_V2_161112_Linux.zip Chipset:rtl8188EUS_linux_v4.3.0.8_13 Primitive of holomorphic Function $\frac{1}{z}$ on an Annulus. Given an Annulus with $A(0,r,R)$ show by considering Cauchy's Theorem for primitives that there is no holomorphic function with $f'(z)=\dfrac{1}{z}$.   I am struggling to picture this since but it seems like there are issues because $f(z)=\log z$ isn't well defined in the same range as $\dfrac{1}{z}$.  Am I looking to show that $\int_Ag(z)dz = 0$ where $g(z) = \dfrac{1}{z}$? how to sort file by DD-MM-YYYY dates in a file containing :  ... 18-11-2018:othercharacters 10-11-2018:othercharacters 03-10-2018:othercharacters 30-10-2018:othercharacters 27-09-2018:othercharacters 03-12-2018:othercharacters ...   the command :  sort -t- -k2 -k1    does not sort by date, what am I missing ? Conditional expectation on more than one sigma-algebra How to get a vertical bar which is longer than \mid ? sometimes when writing mathematical expression with partial derivatives, one needs to write a vertical bar afterwards and write the value at the which the partial derivatives are being computed as subscripts. See for example the bottom post here:    However, the \mid symbol doesn't produce a tall bar that corresponds to the size of the partial derivatives term. Is there a way to have a taller bar?   PS: Some other posts here mention \middle| but this doesn't compile on my computer.  Thanks in advance....