Imagine the following problem:  You listen to a radio station and take notes how often was each song played. How can you estimate based on your notes (e.g. 30 songs played once, 2 played twice, one song three times) how many songs has the radio station available when we assume all the songs are played with a uniform distribution?
If shuffle-playing playlist &times;100 resulted in [10 13 10  3  2  2] different songs being repeated [1 2 3 4 5 6] times, what is the estimate for the total number of songs? (assuming shuffle play was completely random)  Update: (R code)  k &lt;- 50 # k number of songs on the disk indexed 1:k n &lt;- 100 # n number of random song selections m &lt;- 20 # m number of repeat experiments colnum &lt;- 10 mat &lt;- matrix(data=NA,nrow=m,ncol=colnum) df &lt;- as.data.frame(mat) for(i in 1:m){   played &lt;- 1+floor(k*runif(n)) # actual song indices (1:k) selected    freq &lt;- sapply(1:k,function(x){sum(played==x)})   # = number of times song with index x is being played   histo &lt;- sapply(1:colnum,function(x){sum(freq==x)});   for(j in 1:colnum){    df[i,j] &lt;- histo[j]   } } df   Resulting in: e.g. 20 distributions (V1=number of single plays, V2=number of double plays, etc):     V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 1  15 13 11  1  2  2  0  0  0   0 2  15 12 10  1  4  0  1  0  0   0 3  12 14  7  6  3  0  0  0  0   0 4  17 16  6  4  2  0  1  0  0   0 5  17 10 12  5  0  0  1  0  0   0 6  13 15 11  6  0  0  0  0  0   0 7  10 14  9  3  2  1  1  0  0   0 8  12 17  5  6  3  0  0  0  0   0 9   9 19  8  3  1  2  0  0  0   0 10 13  9 11  6  1  0  1  0  0   0 11 16  9 12  5  2  0  0  0  0   0 12 15  9 11  6  2  0  0  0  0   0 13 19  9  7  4  4  1  0  0  0   0 14 17 11  4  7  3  1  0  0  0   0 15 11 20  8  1  3  1  0  0  0   0 16 14 12 10  5  0  2  0  0  0   0 17  9 12  8  7  3  0  0  0  0   0 18 10 15  9  4  2  0  1  0  0   0 19 14 11 12  7  0  0  0  0  0   0 20 16 14 11  3  1  1  0  0  0   0   Now I need to get from here to the Poisson modelling--my R is a bit rusty (?lmer)...--Any help would be appreciated...  Attempted Poisson modelling: disappointing fit?!  plot(1:colnum,df[1,1:colnum],ylim=c(0,30),    type="l",xlab="repeats",ylab="count") for(i in 1:m){   clr &lt;- rainbow(m)[i]   lines(1:colnum,df[i,1:colnum],type="l",col=clr)   points(1:colnum,df[i,1:colnum],col=clr) }  df.lambda=data.frame(lambda=seq(1,5,0.1),ssq=c(NA));df.lambda for(ii in 1:dim(df.lambda)[1]){   l &lt;- df.lambda$lambda[ii]       ssq &lt;- 0       for(i in 1:20){         for(j in 1:10){           ssq &lt;- ssq + (df[i,j] - n*dpois(j,l))^2         }       }       print(ssq)       df.lambda$lambda[ii] &lt;- l   df.lambda$ssq[ii] &lt;- ssq     }     df.lambda     lambda.est &lt;- df.lambda$lambda[which.min(df.lambda$ssq)] lambda.est # 2.4 points(x &lt;- 1:10, n*dpois(1:10,lambda.est),type="l",lwd=2)  100*dpois(1:10,3) n/lambda.est   the estimated lambda stays around 2.3, with an n estimate of around 43; the fitted curve seems very discrepant, and seems to worsen with rising n !?  Doesn't this have to do with the fact, that our repeats are different from the 'classical' Poisson distributions: it's not just ONE event that repeats itself x number of times, but the sum of repeats of different items (songs)?!
How do I create a Windows 7 USB installer with preinstalled software? I was wondering if it was possible to make a bootlable image of a Windows 7 Pro OEM Installation CD that I have and put it on an USB stick for faster/easier installation. I am asking because we have a couple of PC´s where I´d have to install the OS using the same key (MAK).  Also is it possible to kind of populate that image with software that would have to be installed anyways on all machines (like Chrome, Outlook, etc)?  It would be really helpful to just install a Windows 7 image with customized software already installed. I would just make an image of an OS and use that, but the hardware of the machines differ. My problem: Prove that a set of vectors $S$ is linearly independent if and only if any finite subset of $S$ is linearly independent.  I tried like this:  Suppose S is LI.Then the vector $0$ cannot be expressed as a linear sum of all elements of $S$.  How it follows that a finite subset is also LI from this fact. I think $S$ can be finite or infinite.  This is a question from the book Linear Algebra - Friedberg et al. FoxTrot Bill Amend Problems So I found this on the Wolfram website today:     So I was wondering about how one might be able to (if possible) solve those four problems by hand. Here are the problems, $\LaTeX$ed:    $ \lim_{x \to +\infty} \dfrac {\sqrt{x^3-x^2+3x}}{\sqrt{x^3}-\sqrt{x^2}+\sqrt{3x}} $ $ \displaystyle\sum_{k=1}^{\infty} \dfrac {(-1)^{k+1} k^2}{k^3+1} $  $ \dfrac {\mathrm{d}}{\mathrm{d}u} \left[ \dfrac {u^{n+1}}{(n+1)^2} \cdot \left[ (n+1) \ln u - 1 \right] \right] $  $ \displaystyle\int_0^{2\pi}\displaystyle\int_0^{\frac{\pi}{4}}\displaystyle\int_0^4 \left( \rho \cos \phi \right) \rho^2 \sin \phi \, \mathrm{d}\rho \mathrm{d}\phi \mathrm{d}\theta$     Ideas   The degree of the numerator is $\frac{3}{2}$. The degree of the denominator is $\frac{3}{2}$. The expression is of an indeterminate form, namely $\frac{\infty}{\infty}$, so we use l'Hoptial's Rule.  No ideas, really.  Derivatives are always pretty easy, although this one is a bit bashy. Basically bash Product and Chain Rules, etc.  Integration by Parts bash? The $\mathrm{d}\theta$ part is very trivial. I mean for the $\rho$ and $\phi$. Why is Lamarck's evolutionary theory considered incorrect? Many sources postulate without much argumentation that Lamarck's evolutionary theory is "obviously incorrect". A classic example provided in such sources is the one with giraffes, in which Lamarck argued that the necks of these animals became long as a result of continually stretching to reach high foliage. This mechanism for adaptive change in response to the environment is considered wrong.  Now the counterargument to Lamarck's ideas comprises modern findings in genetics. So it is stated that organisms pass down traits through predetermined genetic information, not based on environmental adaptations during their lifetime. Furthermore, genetic research shows that living organisms cannot alter their genetic material as needed.   Doesn't the latter contradict the evolutionary theory itself, which states that nature (i.e. environment) shapes species through natural selection in the environmental milieu? If it is not the environmental/natural factor that is responsible for genetic evolution, then what is? If genetic material were to be unchangeable, then how would adaptation to the environment and consequent evolutionary change would ever be possible? The genotype (following this logic) would remain the same. And lastly, maybe giraffes do not develop long necks at such a rapid pace (as Lamarck probably thought) by simply stretching their necks in one generation; however, what, if not neck stretching, is responsible for their consistently longer necks throughout thousands or millions of years? Hadn't the environment gradually shaped their genotype? Similarly, if I run more often, maybe my children will not become more fit, but isn't it just a matter of time (thousands of years) that if all of us consistently run a lot, then our offspring will eventually become more fit? Wouldn't our voluntary efforts eventually enhance our genetics? I do not see any problem with Lamarck's logic at all, except probably the time frame. There are similar questions for  and , but I'm after a Windows solution here.  The problem is as follows: I want to write several (js) script files in a folder, and have a  program monitor that folder for file changes and new files being added, and run a command whenever that happens (to compile them all into one single file).  The solution has to:   Monitor both file changes and new files being added, in a folder. Run a command only if there is any change.   It would be best if it either is a built-in solution (like a JScript or VBscript snippet), or something that does not require installation. Looking for a SF story regarding women growing things in their wombs I'm looking for the title and author of a short story or novelette that I read quite some time ago.   The main characters are two young women. One is taking correspondence courses, and is constantly being berated by the other one for hoping to rise above her station. They go out to pick up young men, to sleep with them, to get pregnant.  It's not a normal sort of pregnancy, though. The men have some sort of 'coded semen' which grow something other than a child in the woman's womb. It ends up being a product of some kind, which earns the woman money when it is 'born'. The one woman is very careful about who she chooses, as she can only do this so many times. The other... isn't so careful.   At the end, the careful, studious woman achieves what she has been working for - a letter from a government organisation that permits her to become the mother to a human being.  Thank you for reading my question. I've been looking for this story for years, now. If the earth would stop spinning, what would happen? How to handle UNABLE_LOCK_ROW errors when this is caused by a batch APEX job we are facing a serious issue. We have a batch APEX job running daily which makes updates on records fulfilling certain conditions. There is another job running parallel to this, in some cases updating or accessing to the same records than the batch job and hence, causing the error:     Update failed. First exception on row 400 with id XXX; first error:    UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record or 200    records:   So, I had then read that in order to fix this kind of error you should use FOR_UPDATE in your select statement (records that have to be updated). The problem is, that you can not use FOR UPDATE for batch jobs. We tested this and effectively, we get the error:     System.QueryException: Locking is implied for each batch execution and   therefore FOR UPDATE should not be specified      It will however lock the records within each execution of execute. See   QueryLocator.getQuery()usage:      You cannot use the FOR UPDATE keywords with a getQueryLocator query to   lock  a set of records. The start method automatically locks the set   of records in  the batch.   Could you find a solution to this?. We would like to handle this in the code itself, because we don't have the permission to schedule the batch job for another time as the another job. The Node Editor won't work for the object selected I'm still learning, but I'm trying to follow a tutorial to apply texture to a model. I only want to apply the texture to one object in the scene, so I selected it, unwrapped it, and painted over it. Now I selected it in the Edit Mode (I can't select it in the Object mode because all is locked together) and went into Node Editor, but the nodes are greyed out.  Why? Totally sweet horizontal rules in LaTeX Pass shell variable as a /pattern/ to awk Moment generating function of the inner product of two gaussian random vectors Can anybody please suggest how I can compute the moment generating function of the inner product of two Gaussian random vectors, each distributed as $\mathcal N(0,\sigma^2)$, independent of each other? Is there some standard result available for this? Any pointer is highly appreciated. How can we unlock an iPhone backup file if we don't know the password? What is the adjectival form for the word "integrity?" I'm looking for the adjectival form of &quot;integrity.&quot; Instead of &quot;Be a person of integrity,&quot; I'd like to say something like &quot;Be [one word I'm looking for]&quot; I did a  for this, but I also wanted to know what stackexchange folks would like to say. Why did Dumbledore tell Harry there were 6 Horcruxes when he already knew Harry was a horcrux? Harry: "He made seven Horcruxes?"   Dumbledore: "...Not seven Horcruxes: six. The seventh part of his soul, however maimed, resides inside his regenerated body..." (HP6, US Hardback, page 503).    I would think that Dumbledore had already known that there were 6 horcruxes:    the diary  Gaunt's ring  Salazar's locket Helga Hufflepuff's cup Nagini (the whole essence divided thing)   Now those are the five that he was sure of. He knew that when Riddle came to Hogwarts to ask for the DADA position, he was really there so he could hide a horcrux. (But he never got a chance to tell Harry that, right?) Did Dumbledore know of the diadem? Or did he just think Riddle wanted to hide the cup?   Did Dumbledore say there were 6 and not 7 because he didn't know about the diadem but did know about Harry being a horcrux? Or did he say there were 6 to ensure Harry didn't guess he was a horcrux? Sorry if this makes no sense.  I know that in the end there were 7 horcruxes and an 8th part of Voldemort's soul right? How can I remove malicious spyware, malware, adware, viruses, trojans or rootkits from my PC? Why is it so difficult to find the twitter account for a Stack Exchange site? I am not able to find a link to the twitter account of Academia SE (), for example, in the Academia SE main webpage.   Why are twitter links not included on the main site page of each Q&amp;A site in SE? How many research interests should be included in a statement of purpose/objective I am wondering how many research interest should be included in a statement of purpose. Is it better to include just one core interest or to include up to three as in my case? Viewshed analysis plugin on QGIS keeps resulting in errors I've been trying to test the Viewshed analysis plugin on QGIS 2.10, but it keeps giving back error messages. I've tried to reduce the radius area and have also reprojected both my DEM and my point shapefile to UTM, in order to avoid a possible memory error mentioned in another question regarding this plugin (that the using of geographic coordinates might cause a memory error).  Still, I keep getting Python error messages when I try to run it. Does anyone know whats going on? Is this plugin "broken"? Cannot install R-forge package using install.packages