How do you find the marginal distribution of a Poisson distribution given a gamma(a,b) prior?
I want to calculate the posterior distribution given a gamma-prior and a poisson likelihood. The task is from a textbook and I just have the solutions (without a walkthrough). Please find all given information in the following:  Given information:  $m$ countries each with a population of $n_i$; $y_i$ is the number of people having a disease; $y_i$ is a poisson random variable with mean $\frac{n_i*\lambda}{100}$  The prior distribution for $\lambda$: $\lambda \sim Gamma(a_0,b_0)$  Task:  Show that the posterior distribution is also a gamma distribution with $a_m = a_0 + \sum_{i = 1}^{m}y_i$ and $b_m = b_0 + \sum_{i = 1}^{m} \frac{n_i}{100}$  My solution:  $Posterior \propto Likelihood \times Prior$  $p(\theta|y) \propto \prod_{i=1}^{m}(\theta^{y_i}e^{-\theta})\times \theta^{a_0-1}e^{-b_0\theta}$  $p(\theta|y) \propto \theta^{\sum_{i = 1}^{m}y_i}e^{-m\theta}\times \theta^{a_0-1}e^{-b_0\theta}$  $p(\theta|y) \propto \theta^{\sum_{i = 1}^{m}y_i+a_0-1}e^{-\theta(m+b_0)}$  $a_m = a_0 + \sum_{i = 1}^{m}y_i$  $b_m = b_0 + m \neq b_0 + \sum_{i = 1}^{m} \frac{n_i}{100}$  I think I am doing a mistake, because I don't know how to incorporate the information that the mean of $y_i$ is given as $\frac{n_i*\lambda}{100}$. Or do I just have to transform $b_m$ somehow? Can someone may give me a hint?   Thank you already in advance!  Edit 1: Considering first advices  $Likelihood: p(y | \theta) \propto \prod_{i=1}^{m}(\frac{n_i\lambda}{100})^{y_i}e^{-\frac{n_i\lambda}{100}}$  $\propto \prod_{i = 1}^{m} ((\frac{n_i}{100})^{y_i})\lambda^{\sum_{i=1}^{m}y_i}e^{-\lambda\sum_{i=1}^{m}\frac{n_i}{100}}$  $\propto \lambda^{\sum_{i=1}^{m}y_i}e^{-\lambda\sum_{i=1}^{m}\frac{n_i}{100}}$  Is the transformation of $\prod_{i=1}^{m}$ I did from the first to the second step correct?
What is an alternative to execfile in Python 3? It seems they canceled in Python 3 all the easy way to quickly load a script by removing execfile()   Is there an obvious alternative I'm missing? I'm not sure if this is the right place to ask this question. I realise that this maybe a borderline philosophical question at this point in time, therefore feel free to close this question if you think that this is a duplicate or inappropriate for this forum. Anyway, I'm an electrical engineer and I have some basic knowledge of quantum mechanics. I know that Schrödinger's equation is deterministic. However, quantum mechanics is much deeper than that and I would like to learn more. If this question is not clearly answerable at this point than can anyone point out some recognized sources that try to answer this question. I would appreciate it if the source is scientific and more specifically, is related to quantum theory. This is an exercise from Chapter 3 of Golan's linear algebra book.  Problem: Show $\mathbb{Z}$ is not a vector space over a field.  Solution attempt:  Suppose there is a such a field and proceed by contradiction. I will write multiplication $FV$, where $F$ is in the field and $V$ is an element of $\mathbb{Z}$.   First we rule out the case where the field has characteristic 2. We would have   $$0=(1_F+1_F)1=1_F1+1_F1=2$$  a contradiction.  Now, consider the case where the field does not have characteristic 2. Then there is an element $2^{-1}_F$ in the field, and   $1=2_F(2^{-1}_F1)=2^{-1}_F1+2^{-1}_F1$  Now $2^{-1}_F1\in\mathbb{Z}$ as it is an element of the vector space, but there is no element $a\in\mathbb{Z}$ with $2a=1$, so we have a contradiction.  Is this correct? Repeating an equation including its content and number I would like to re-use equations with the same content and number. I know that the thmtools package has a restatable environment to do this for environments (like in ), but I would also like to do this with a single equation that is only part of some environment.  I had a look at the following questions which only aim at repeating the equation number but typing the whole equation twice (the first three) or repeat the content of the equation without a number (the last one):         Based on the answers provided there and on the  I tried to create a macro \restatableeq for restable equations like this:  \documentclass{article}  \usepackage{amsmath}  \newcommand{\restatableeq}[3]{\label{#3}#2\xdef#1{\unexpanded#2\unexpanded\tag{\unexpanded\ref{#3}}}}  \begin{document}  \begin{eqnarray} \restatableeq{\eqone}{This &amp; is &amp; eqation 1}{eq1}\\ Another &amp; simple &amp; equation \end{eqnarray}  \begin{eqnarray} One &amp; more &amp; equation\\ \restatableeq{\eqtwo}{This &amp; is &amp; eqation 2}{eq2} \end{eqnarray}  Here, we use (\ref{eq1}) and (\ref{eq2}) again: \begin{eqnarray*} \eqone\\ \eqtwo \end{eqnarray*}  \end{document}   Unfortunately, it does not work and yields:  ! Missing { inserted. &lt;to be read again&gt;                    T l.10 ...ableeq{\eqone}{This &amp; is &amp; eqation 1}{eq1}                                                   \\ ?   My guess is that the &amp; symbols are not treated as intended but I may well be wrong there.  How can I define a command like \restatableeq that allows me to re-use equations with the same content and number in a setting like in this example (and give it a label such that I can still use \ref as usual in addition to that)? Is there a symbol that looks like the element sign $\in $ but instead of being curved, looks more like a less than sign $&lt; $? I have trawled through hundreds of symbols and tried detexify. Markdown + Mathjax => PDF I've used LaTeX a lot in the past, but now, when comparing with StackExchange's great , I find it tedious, for short documents (&lt; 2 pages), to have to use pure LaTeX. For a short document, instead of having 30 lines as introduction: \begin{document} \documentclass[11pt,a4paper]{article} \usepackage[frenchb]{babel} \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \usepackage{amsfonts}  + &lt;lots of other things&gt; ...  I'd like to write my short document with MarkDown + Math, like on . Question: Is there an offline compiler such that compilemarkdown exercice.tex  would produce a PDF from this: #Title  Here is a *short document* including Markdown and Math, here is the equation:  $$f(x)=x^2$$  ___  Proof: ...   This is **bold**. Why does an argument similiar to 0.999...=1 show 999...=-1? I accept that two numbers can have the same supremum depending on how you generate a decimal representation. So $2.4999\ldots = 2.5$ etc. Can anyone point me to resources that would explain what the below argument that shows $999\ldots = -1$ is about? Here is the most usual proof I see that $0.999\ldots = 1$:  $x=0.999\ldots$ $10x=9.999\ldots$ $10x - x = 9$ $x=1$  Using this same argument template I can show $999\ldots=-1$:  $x= \ldots9999.0 $ $0.1x= \ldots9999.9$ $0.1x - x = 0.9$ $x=-1$  What might this mean? Edit from one of the comments: $$\sum_{k=0}^{\infty}{9 \cdot 10^k}=-1$$ What is butterfly lighting, and when do I use it? I often hear the term 'Butterfly Lighting' used when discussing high-fashion and glamor photography. How do I set up Butterfly Lighting, and when do I use it? ^@ spam in tty (but seems to be system-wide) I recently noticed some weird behavior on my GNU/Linux machine. I've been trying to narrow it down but I am unsure where to go next. My setup uses the following:   i3 gdm arch systemd grub2 pulseaudio 4.13.3-1-ARCH   Here is how it manifests iself:   when trying to resize panes in i3 (alt+right click and hold) the action will be randomly canceled (happens on key presses) alt+dragging windows meets a similar fate booting to tty periodically adds ^@s to the login prompt, I'd estimate them to be ~0.5s intervals in tty I can see those being passed to vim when I open the command bar (:) using a pager like less in tty mode and searching with / will result in  (?) being spammed htop's search (/) is instantly canceled by the periodic keypress  holding a key and trying to have it be repeated (such as holding space) will stop the other occurrences from happening (e.g. only one or two happen) any tooltip (such as chrome tooltips) get instantly closed because of key presses   Here is what I have tried:   tried switching DE temporarily (gnome, cinnamon, xfce) tried killing programs one by one until I was left with a tty session and essentially systemd services + pulseaudio tried booting on an arch livecd - problem does not manifest  overriding grub2 with init=/bin/bash drops me into a shell where the problem does not manifest I have tried pressing all keys to verify it wasn't a hardware problem, however previous steps point to it not being hardware I have made a diff of dmesg, from the init=/bin/bash and the regular boot - the main difference seems to be systemd being started in the regular boot Made a diff of lsmod from init=/bin/bash and regular boot, tried to rmmod modules that seemed related   My system is up to date, I'm not quite sure what other steps I can do to track this down. Any other debugging tips? How do people at Hogwarts usually tell the time? Charts from numbers not dynamically updating in Pages/Keynote I have the 2015 versions of Pages, Numbers, and Keynote on Yosemite.  I created a chart in numbers and then copied it to Pages or Keynote. I then want to be able to change the data in Numbers and see the chart updated in Pages or Keyonte. However, I don't see an option to "refresh".  Is there a way to dynamically link Numbers to Pages or Keynote? If I push or hit an object in space will it rotate or move along a straight line? If I push or hit an object in space (vacuum and no gravitation) in direction what is not going trough its centroid, will it rotate or move along in straight line?   I expect that on earth it will depend on what is less difficult for the object (rotation or linear movement). So the object will do some kind of combination of both movements (rotating and also moving along the direction of impulse or force).  But how could an object "decide" what to do in space, where is not resistance? How to find the working folder of a servlet based application in order to load resources This is the gift that my dad sent (to) me This is the gift that my dad sent me on my birthday.   Vs   This is the gift that my dad sent to me on my birthday.  Is to required?   Also   Presenting you guys, the trailer of the film.   Vs   Presenting to you guys, the trailer of the film.    Is to required? Physical Explanation for "Kolmogorov -5/3 spectrum" in Fluid Mechanics According to Kolmogorov, the energy spectrum function of a turbulent fluid is given as,  $E(k)=C\epsilon^{\frac{2}{3}}k^{\frac{-5}{3}}$  where $\epsilon$ is the energy flux and $k=\frac{2\pi}{r}$ where $r$ is the length scale.   The normal explanation I see in most physics texts and articles is that the -5/3 exponent is found purely through dimensional analysis. Obviously dimensional analysis is very useful, but often times there is a more physical explanation as well. Does anyone have any insights? What is the difference between 'tell' and 'say' Why should users have to press Return twice to insert new lines? When I post a question and want to add a new line, I have to press Return two times, or else the next text will appear on the same line.  Is this really supposed to behave this way? If so, why? 0:root@SERVER:/root # echo "something" | sed -e 's/^/\t/g' tsomething 0:root@SERVER:/root #    AIX/ksh .. why doesn't it works? I just want to put a "tab" before every line! Can I use 'in' instead of 'at'? -- "I have more books in my house." I am learning English using the Duolingo English course, one of correct solution was      I have more books at my house.   Can I use      I have more books in my house.   If it is OK, what is the difference between both? I have one feature-request with the objective of having duplicate questions with no answers:   To (try to) avoid people answering duplicate questions, add an alert that says the question has a probable duplicate if it has a close vote as Exact duplicate, asking the answerer to go to the original and answer there.   What do you think? My objective is letting the duplicate question exist for search purposes, but the answers centralized in the root question.