Rs. 100 have been returned to your child.   Rs. 100 has been returned to your child.      Which one of the above sentences is correct and why?
Which of these sentences is correct?     Rupees are interchangeable with dollars   or      Rupees is interchangeable with dollars.
How to compare Unicode strings in Javascript? How to calculate the exact probability that the second player wins? Consider a game that uses a generator which produces independent random integers between 1 and 100 inclusive. The game starts with a sum S = 0. The first player adds random numbers from the generator to S until S > 100 and records her last random number 'x'. The second player, continues adding random numbers from the generator to S until S > 200 and records her last random number 'y'. The player with the highest number wins, i.e. if y > x the second player wins. Is this game fair? Write a program to simulate 100,000 games. What is the probability estimate, based on your simulations, that the second player wins? Give your answer rounded to 3 places behind the decimal. For extra credit, calculate the exact probability (without sampling).     import random  CONST_TIMES = 100000 CONST_SMALL = 100 CONST_LARGE = 200  def playGame():     s = 0     while s &lt;= CONST_SMALL:          x = random.randint(1, CONST_SMALL)         s = s + x;     while s &lt;= CONST_LARGE:         y = random.randint(1, CONST_SMALL)         s = s + y     if x &lt; y:         return 's'     elif x == y:         return 'm'     else:         return 'f'  fst = sec = 0 for i in range(CONST_TIMES):     winner = playGame()     if winner == 'f':         fst = fst + 1     elif winner == 's':         sec = sec + 1 secWinPro = round(float(sec) / CONST_TIMES, 3)  print secWinPro   The simulation probability is about 0.524. I want to know how to calculate the exact probability. Meta sites in "Your Communities" display different reputation I have an Asus UL30JT. It has Nvidia Optimus technology which I am not really interested in. I currently rarely use this laptop with it being connected to power. And I want to be able to play video at high res, play games and do some OpenCL coding.  In the BIOS I switched it to NVIDIA only (non windows 7). Previously, this worked just fine, using the nvidia driver.  After upgrading everything was broken. I have added nomodeset and blacklist.nouveau=1 as kernel options. The nvidia drivers install without error. However they are not found/used.  jockey-text -l kmod:nvidia_310_updates - nvidia_310_updates (Proprietary, Enabled, Not in use) kmod:nvidia_304_updates - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use) kmod:nvidia_313_updates - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use) kmod:nvidia_310 - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use) kmod:nvidia_304 - NVIDIA binary Xorg driver, kernel module and VDPAU library (Proprietary, Disabled, Not in use)   Trying to load the module manually fails as well.  sudo modprobe nvidia FATAL: Module nvidia not found.   Xorg.0.log show the following:  [    12.028] Loading extension GLX [    12.028] (II) LoadModule: "nvidia" [    12.037] (WW) Warning, couldn't open module nvidia [    12.037] (II) UnloadModule: "nvidia" [    12.037] (II) Unloading nvidia [    12.037] (EE) Failed to load module "nvidia" (module does not exist, 0) [    12.037] (==) Matched nvidia as autoconfigured driver 0 [    12.037] (==) Matched nouveau as autoconfigured driver 1 [    12.037] (==) Matched vesa as autoconfigured driver 2 [    12.037] (==) Matched modesetting as autoconfigured driver 3 [    12.038] (==) Matched fbdev as autoconfigured driver 4 [    12.038] (==) Assigned the driver to the xf86ConfigLayout [    12.038] (II) LoadModule: "nvidia" [    12.038] (WW) Warning, couldn't open module nvidia [    12.038] (II) UnloadModule: "nvidia" [    12.038] (II) Unloading nvidia [    12.038] (EE) Failed to load module "nvidia" (module does not exist, 0) [    12.038] (II) LoadModule: "nouveau" [    12.039] (WW) Warning, couldn't open module nouveau   I have installed the kernel headers, of the correct kernel. I verified that the kernel options are in the grub configuration. I have purged all nvidia packages and tried to reinstall (multiple times...)  Currently I am at a loss. I have checked the following question:  But nothing there worked for me. PayPal API Listener Website Payments Standard URI I read in a CSV file for linking to a .shp file.   All the variables that are just numbers came in as text.   How do I change the text variables to numeric in QGIS? I am trying to list all the files from dir1, dir2, dir3 and dir4 which might be anywhere in as a sub directory of my cwd using the find command. I tried the following with no success:  find . -type f -regextype posix-egrep -regex 'dir1/.+|dir2/.+|dir3/.+|dir4/.+'   I tried posix-extended as well. How can I list these files? On some pages of my document LaTeX introduces a lot of spacing between my headline/paragraphs (around 5 times more than usual).  What is the reason for this and how can I avoid it? It seems it is trying to fill the page until the next chapter starts. Limit of $x\left(\left(1 + \frac{1}{x}\right)^x - e\right)$ when $x\to\infty$ I am stuck on how to calculate the following limit: $$\lim_{x\to\infty}x\left(\left(1 + \frac{1}{x}\right)^x - e\right).$$  Definitely, it has to be through l'Hôpital's rule. We know that $\lim_{x\to\infty} (1+(1/x))^x = e$. So, I wrote the above expression as $$\lim_{x\to\infty}\frac{\left(1 + \frac{1}{x}\right)^x - e}{1/x}.$$Both numerator and denominator tend to zero as x tends to infinity. I applied l'Hôpital's rule twice, but I got the limit equal to infinity which is clearly wrong. In the book, it says that the limit should be $-e/2$.  Any help please? Also, in case someone managed to solve it, please tell me which numerator and denominator did you apply your l'Hôpital's rule to in both cases? Thanks a lot  Also, guys can you tell me how to write equations in this forum? Thanks. Best WPF open source projects I have programmed with WPF for more than a year. When I started there weren't so many examples and guidelines to follow, now the situation is much more better.  I would like to ask you some help in listing the best WPF (open) source code examples or projects that you suggest to study in order to learn more about project structure, best practices, etc.  Thank you, Marco How does java do modulus calculations with negative numbers? Fermi in his lecture asserts:     The second law of thermodynamics rules out the possibility of constructing a perpetuum mobile of the second kind.   So, this means there can be no machine which just transforms all the heat energy gained by cooling surrounding bodies into mechanical work.  But how does actually the Second Law prohibit this?   The hot reservoir provides heat energy to the system. Does it cause a decrease in entropy of the universe(system + hot reservoir)? How? In order to receive heat wouldn't the system have to be cooler than the reservoir? If so, then entropy increases as the heat energy gets expelled from the reservoir at a higher temperature than the temperature the system receives the heat energy. Is it so?  I'm not getting how the Second Law nullifies the existence of this machine. Could anyone please explain how the Law prohibits the perpetual machine of the second kind? What makes Stealing Signs wrong? How did Luke know where to land on Dagobah? A good reference on optimal control theory Ok, so I am reading about decision making and I came across this subject. Fortunately it has a  , but the point is I want to see some examples, and learn to solve regular problems of this field. Of course I can go for the book by Pontryagin but then I don't think that would be an educative book. Does anyone has a suggestion? I would be happy if it also covers LQ problems. P.S. I studied math, therefore I appreciate a book with rigorous approach to the subject. Irreducible polynomial which is reducible modulo every prime How to show that $x^4+1$ is irreducible in $\mathbb Z[x]$ but it is reducible modulo every prime $p$?   For example I know that $x^4+1=(x+1)^4\bmod 2$. Also $\bmod 3$ we have that $0,1,2$ are not solutions of $x^4+1=0$ then if it is reducible the factors are of degree $2$. This gives that $x^4+1=(x^2+ax+b)(x^2+cx+d)$ and solving this system of equations $\bmod 3$  gives that $x^4+1=(x^2+x+2) (x^2+2x+2) \pmod 3$. But is there a simpler method to factor $x^4+1$ modulo a prime $p$? Unable to install LanguageTool 2.5 extension for LibreOffice 4.2 on Ubuntu 14.04 I am not able to install LanguageTool extension for LibreOffice. Getting exception when I try to install it.   p.s. Somebody says that the solution is installing openoffice.org-java-common package but Ubuntu 14.04 does not have this package in its repository.  System details:  OS: Ubuntu 14.04 LTS  LibreOffice: 4.2 (4.2.3.3)  LanguageTool: 2.5  Java: Oracle JDK 1.8.0_05     Exception message: How to add border to listview and different row colors at the same time How to typeset a file path? "invalid use of incomplete type" error with partial template specialization The following code:  template &lt;typename S, typename T&gt; struct foo {    void bar(); };  template &lt;typename T&gt; void foo &lt;int, T&gt;::bar() { }   gives me the error  invalid use of incomplete type 'struct foo&lt;int, T&gt;' declaration of 'struct foo&lt;int, T&gt;'   (I'm using gcc.) Is my syntax for partial specialization wrong? Note that if I remove the second argument:  template &lt;typename S&gt; struct foo {    void bar(); };  template &lt;&gt; void foo &lt;int&gt;::bar() { }   then it compiles correctly.