Showing the sum of n independent Bernoulli trials follows Binomial distribution Suppose $U_1,...,U_n$ are independent Bernoulli random variables taking values $0$ or $1$ with $Pr(U_i=1) = \theta$ and $Pr(U_i=0)=1-\theta$ Let $S = U_1+...+U_n$ be the number of $U_i$ equal to one.  Show $S \sim Binomial(n, \theta)$  I'm unclear as to what I need to show in order to achieve this. Would it be enough to show: $(1)$ That the sample of space of $S$ is the same as a Binomial variable with such parameters. $(2)$ The probability of each element of the sample space and hence the probability distribution of $S$ is also the same as a Binomial variable with such parameters. Or is there something specific way to show that $S$ is a Binomial random variable?
Proof that a sum of Bernoulli rvs has Binomial distribution Let $\{X_n, n \geq 1\}$ be iid Bernoulli random variables with $\Pr(X_1 = 1) = p = 1 - \Pr(X_1 = 0)$ and let $S_n = \sum\limits_{i=1}^n X_i$ be the number of successes in $n$ trials. Show $S_n$ has a binomial distribution by the following methods:  1.) Prove for $n\geq0,$ $1\leq{k}\leq{n+1}$  $$\Pr(S_{n+1} = k) = p\Pr(S_n = k - 1) + q\Pr(S_n = k)\text{ where }q = 1-p.$$  2.) Solve the recursion using generating functions.  For the first method, I think I need to use convolution of $n + 1$ Bernoulli rvs, but I cannot immediately see the progression. For the second method, I don't exactly understand how to proceed either. This is problem 1.2 from Resnick's Adventures in Stochastic Processes.
Evaluate $\prod \frac {2k - 1} {2k}$ I came across to this: evaluate $$\prod_{k = 1}^{n} \frac {2k - 1} {2k}.$$  I brought it to a closed-form expression in asymptotics but I suspect my asymptotics is bad and I also want to see different solutions, hence the question.  My original solution: Write   $$\begin {eqnarray} \prod_{k = 1}^{n} \frac {2k - 1} {2k} &amp; = &amp; \exp \left (\sum_{k = 1}^{n} \log \left (1 - \frac {1} {2k}\right) \right) \nonumber \\ &amp; = &amp; \exp \left (- \sum_{k = 1}^{n} \sum_{m = 1}^{\infty} \frac {1} {(2k)^m m}\right). \end {eqnarray}$$  Let $$S = \sum_{m = 1}^{\infty} \frac {1} {(2k)^m m} \tag {1}.$$ Multiply both sides of $(1)$ by $2k$ to get $2k S &lt; S + 1$, and by $4k$ to get $4kS &gt; S + 2$. Hence, $$\frac {2} {4k - 1} &lt; S &lt; \frac {1} {2k - 1}.$$ Then, $$\frac {1} {2} \left( \log (4n - 1) - \log 3 \right) - 2 + O \left(\frac {1} {n^2}\right) &lt; \sum_{k = 1}^{n} \sum_{m = 1}^{\infty} \frac {1} {(2k)^m m} &lt; \frac {1} {2} \log (2n - 1) - 1 + O \left(\frac {1} {n^2}\right).$$ Hence, $$\sqrt {\frac {c} {2n - 1}} &lt; \prod_{k = 1}^{n} \frac {2k - 1} {2k} &lt; \sqrt {\frac {3 c^2} {4n - 1}},$$ where $c$ is a constant. Any better approach? How do I limit the running time of a BASH script I have a long running BASH script that I am running under CYGWIN on Windows.  I would like to limit the script to run for 30 seconds, and automatically terminate if it exceeds this limit. Ideally, I'd like to be able to do this to any command.  For example:  sh-3.2$ limittime -t 30 'myscript.sh'   or   sh-3.2$ limittime -t 30 'grep func *.c'   Under cygwin the ulimit command doesn't seem to work.   I am open to any ideas. Lock keys panel indicator for MATE Desktop I have no indicator LEDs on my keyboard to show whether Caps-Lock is on (I don't have Num-Lock and Scroll-Lock keys so the best option would be to have an indicator only for Caps Lock, but three indicators would be better than none)  I would really like to see the lock-keys status in the indicator panel so I can tell at a glance whether I'm typing my passwords correctly    I'm using Ubuntu MATE 16.04. I've seen  but it relates to Unity DE. Term for words like Snowmageddon, Nipplegate and even cheeseburger? I am trying to use a Bluetooth headset on an Ubuntu PC. I am able to connect phone to pc via BT. I can stream music to PC. But cannot hear call audio. I have checked in Android phone logs, and BT sco link is established. But when making a call or virtual call (play audio through sco path in Android phone) the audio is not audible in PC headset. SCO packets are NOT appearing in btmon logs either. Anyone successfully done this?  version- ubuntu 16.04 Installed- bluez, ofono, pulseaudio pactl sink: Name- bluez_sink.22_22_8E_DE_B9_2B,             Name: alsa_output.pci-0000_00_1b.0.iec958-stereo pactl source: Name-bluez_sink.22_22_8E_DE_B9_2B.monitor               Name: alsa_input.pci-0000_00_1b.0.analog-stereo Which command / configuration file controls the open file limits on OS X?  Is there a different command for OS X 10.5 / 10.6 / 10.7?  The options I explore below are ulimit, sysctl, and launchctl  "Too many open files" is apparently a common error on Leopard, perhaps other versions of OS X:        There are many (related?) ways to view the open file limits:  $ ulimit -a core file size          (blocks, -c) 0 data seg size           (kbytes, -d) unlimited file size               (blocks, -f) unlimited max locked memory       (kbytes, -l) unlimited max memory size         (kbytes, -m) unlimited open files                      (-n) 2048 pipe size            (512 bytes, -p) 1 stack size              (kbytes, -s) 8192 cpu time               (seconds, -t) unlimited max user processes              (-u) 512 virtual memory          (kbytes, -v) unlimited   $ launchctl limit cpu         unlimited      unlimited       filesize    unlimited      unlimited       data        unlimited      unlimited       stack       8388608        67104768        core        0              unlimited       rss         unlimited      unlimited       memlock     unlimited      unlimited       maxproc     1024           2048            maxfiles    2048           4096         $ sysctl -a | grep files kern.maxfiles = 32768 kern.maxfilesperproc = 16384 kern.maxfiles: 32768 kern.maxfilesperproc: 16384 kern.num_files: 2049   It has been claimed in some of the above posts that these can be modified with the following commands:  sudo launchctl limit maxfiles 16384 32768 sudo ulimit -n 32768 sudo sysctl -w kern.maxfilesperproc=16384 sudo sysctl -w kern.maxfiles=32768   However, out of the above commands, only the sysctl commands have any apparently effect (i.e. ulimit -n and launchctl limit show no change after the above commands have been entered, while sysctl -a does show the requested changes).  The corresponding locations to change these parameters for the OS are:  /etc/sysctl.conf /etc/launchd.conf   I also discovered one  which reads that ulimit only controls the current shell.  How can I adjust upwards the max files / max open files limits on macOS? Automate taking a screenshot of specified area How would I go about creating a 3D MMORPG Mouse Look? How would I go about creating a 3D MMORPG Mouse Look? I have created a 3D Space Rpg that is almost finished with success so far. However, I didn't have a clue, how I would attempt to make a Mouse Look method where if a user right clickes and then holds the right mouse button and moves it around the camera moves around with the mouse. The camera can not move away from your character/ship, it should act as if the character/ship is it's origin and that it rotates all around the origin.  I don't mind coding this with python either. Advice is welcome! Skins that cannot be in mystery gifts? Yesterday I had a discussion with some of my friends while playing league. It was about the contents of the mystery gifts and while I said there are restrictions, they were convinced that you can get absolutely every skin from a gift (including victorious, and really old ones).  Now while I'm pretty sure that there are restrictions (Triumphant ryze for example), I'm not really sure on which skins they affect.   What about the victorious, riot, legacy, pax and completely removed skins (Rusty BC, Black Ali, Urf WW)? Can you get those with a mistery gift or is it impossible to get those right now? I have a blender file where a sphere is orbiting a force field. I want it to be more red when it's closer to the center, and more blue when it's further. I already have the math figured out, I just need to know how to get x/y coordinates in nodes.  Here's the file: It'd be nice to see reputation updates in the app, as we get on both the desktop and mobile sites.  Mock-up of how this would look:        Other possible icon states:        While I understand reputation is shown in the feed, it's a bit unwieldy, and has no notification.   With this feature implemented, the feed could arguably lose both reputation and inbox items, and be left with the interesting questions that fill it up. This would make for a much more consistent UX across app and desktop. Why is uniform prior on log(x) equal to 1/x prior on x? I'm trying to understand Jeffreys prior. One application is for 'scale' variables like the standard deviation $\sigma$ (or its square, the variance $\sigma^2$) of Gaussian distributions. It is often said that using a uniform prior over $\sigma$ is not really non-informative and instead one should either:   Use instead $\ln \sigma$ as the free parameter, with a uniform prior (this is often called a log-uniform prior) Or keep using $\sigma$ as the free parameter but use $1/\sigma$ as the prior (which is not uniform).   Why are the above two methods/priors equivalent? I feel it has something to do with the fact that the derivative of ln $\sigma$ is $1/\sigma$ but I can't take the next step.   Also, why does this even matter, in simple language with minimal jargon? I see all these complicated explanations online involving the Fisher information matrix but in the end all I see is that the above log-uniform or $1/\sigma$ priors preferentially weight lower values of $\sigma$ more highly. Why? If possible, a simple analytic example or python snippet would be very helpful. Good-morning Math Exchange (and good evening to some!)  I have a very basic question that is confusing me.   At school I was told that $\sqrt {a^2} = \pm a$  However, does this mean that $\sqrt {a^2} = +2$ *and*$-2$ or does it mean: $\sqrt {a^2} = +2$ *OR*$-2$  Is it wrong to say 'and'? What are the implications of choosing 'and'/'or'  Any help would be greatly appreciated. Thanks in advance and enjoy the rest of your day :) Does anyone know how prove the following?   Suppose that $f,g$ are holomorphic functions on a non-empty open connected set $\Omega \subset \mathbb{C}$ and that $|f|^2+ |g|^2$ is constant on $\Omega$. Show that $f$ and $g$ are constant on $\Omega$. sudo -k vs. sudo -K I know what the man page has to say about the -K and -k :     ‑K       The ‑K (sure kill) option is like ‑k except that it removes the user's   cached credentials entirely and may not be used in conjunction with a   command or other option. This option does not require a password. Not   all security policies support credential caching.      ‑k[command]       When used alone, the ‑k (kill) option to sudo invalidates the user's   cached credentials. The next time sudo is run a password will be   required. This option does not require a password and was added to   allow a user to revoke sudo permissions from a .logout file. Not all   security policies support credential caching. When used in conjunction   with a command or an option that may require a password, the ‑k option   will cause sudo to ignore the user's cached credentials. As a result,   sudo will prompt for a password (if one is required by the security   policy) and will not update the user's cached credentials.   So if there is no need to use a command in conjunction with these options, am i correct in assuming K is always the better option to use rather that k? Show that there are exactly 16 pairs of integers $(x,y)$ such that $11x+8y+17=xy$. Help with math symbols in BibTeX Configure tab-switch hotkey in gnome-terminal I used to use Alt+number to switch between gnome-terminal tabs. In my recent 19.10 installation, this does not work. When I press Alt+1, instead of switching tab, the command line shows this: (arg: 1)   and if I press Alt+2, it becomes: (arg: 12)   I checked the options in gnome-terminal, it is set to use Alt+number to switch between tabs. I would like to know which application is hijacking the hotkey, and how to fix it. PS. I do NOT want to use Ctrl+PgUp/PgDn for this. Thanks. How to install pygments on windows 7 When I run LaTeX file its gives error as  "! Package minted Error: You must have pygmentize installed to use this package", you must have pygments installed. when I go through minted documentation minted itself required pygments, so Tex friend How do I install this pygment, I don't know the procedure to install. Please guid me or any link pygement.exe file Handling jQuery Component Collision In plugin development, what is the best practice to prevent jQuery component collision on the front end?  For instance, let's say I include the jQuery Apprise dialog in a plugin that loads this on the front-end for something, yet another plugin may do the same. Because this gets loaded and declared twice, or perhaps one is forked and customized while mine is not, we get Javascript errors on the frontend (I assume).  (Note that I'm doing the best practice of using the wp_register_script() and wp_enqueue_script() strategy via a wp_head() action event in order to load a jQuery component on the frontend.)