text: # Moment generating function: why is $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^\frac{-(z-t)^2}{2} dz = 1$
  
  Problem: Z is normally distributed with mean $0$ standard deviation 1. Goal: obtain the moment generating function of Z.
  
  So I started with $$E[e^{tz}] = M_z(t)= \int_{-\infty}^{\infty}e^{tz}(\frac{1}{\sqrt{2\pi}}e^{\frac{-z^2}{2}})dz$$
  
  $$\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2}{2}-tz)} dz = \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2-2tz}{2})} dz$$ completing the squares in the exponent we get
  
  $$\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2-2tz+t^2}{2})}*e^{\frac{t^2}{2}} dz = \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})}*e^{\frac{t^2}{2}} dz$$
  
  then my notes says $e^{\frac{t^2}{2}} \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} dz$ where $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$ so the mgf is $e^{\frac{t^2}{2}}$.
  
  Why is $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$?
  
  I know that $\int_{-\infty}^{\infty}(\frac{1}{\sqrt{2\pi}}e^{\frac{-(x-\mu)^2}{2\sigma^2}})dx = 1$(prob. density function of a normal distribution) but no where in the problem did it mention $\mu = t$ in fact, $\mu=0$ how could $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$??
  
  -
  Put $\frac{z - t}{\sqrt{2}}$ as $x$, then your integral looks like $\int_{-\infty}^{\infty} \frac{1}{\sqrt{\pi}} exp(-x^2) dx$, this is just your old Gaussian Integral – TenaliRaman Nov 25 '12 at 18:17
  @TenaliRaman does $exp(a+b)$ mean $e^{a+b}$ – user133466 Nov 25 '12 at 18:29
  Yes. $exp(a + b)$ means $e^{a + b}$. – TenaliRaman Nov 26 '12 at 0:00
  
  $\mu$ is just a dummy variable, that can be replaced by anything, such has $t,z,s,\triangle\ldots$ What you in fact have, namely $$\frac{1}{\sqrt{2\pi}}e^{-\frac{(z-t)^2}{2}}$$ is just a normal random variable's density function with expected value $t$ and standard deviation $1$, which you integrate on the whole line.
  
  Note that the density function of a normal random variable with expected value $\mu$ and standard deviation $\sigma$ is $$\frac{1}{\sqrt{2\pi\sigma^2}}\text{e}^{-\frac{(x-\mu)^2}{2\sigma^2}}.$$ and that $\mu,\sigma$ are dummy variables and can be replaced by anything you want, namely $t=\mu, 1=\sigma,$ or $w=\sigma$.
  
  -
  what does R.V. stand for? – user133466 Nov 25 '12 at 18:19
  Random variable – Jean-Sébastien Nov 25 '12 at 18:19
  err... it's just no where does it say $mu = t$! the denominator fits because the problem stated that $\sigma = 1$ but its like asking me to take a leap when we replace $\mu = t$... – user133466 Nov 25 '12 at 18:24
  @user133466 I made a correction. $\mu$ isnt equal to $t$, but the integral you're left with is the integral of a normal distribution with mean $t$ and standard deviation $1$ – Jean-Sébastien Nov 25 '12 at 18:28
  this is easier to understand. thank you! – user133466 Nov 25 '12 at 18:34
explanation: The document contains a detailed mathematical derivation of the moment generating function (MGF) for a standard normal random variable \( Z \). The user poses a specific question about why the integral \(\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{\frac{-(z-t)^2}{2}} dz\) equals 1. The user also provides an answer to this question, explaining that the integral represents the probability density function (PDF) of a normal distribution with mean \( t \) and standard deviation 1, which integrates to 1 over the entire real line.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: # Moment generating function: why is $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^\frac{-(z-t)^2}{2} dz = 1$
  
  Problem: Z is normally distributed with mean $0$ standard deviation 1. Goal: obtain the moment generating function of Z.
  
  So I started with $$E[e^{tz}] = M_z(t)= \int_{-\infty}^{\infty}e^{tz}(\frac{1}{\sqrt{2\pi}}e^{\frac{-z^2}{2}})dz$$
  
  $$\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2}{2}-tz)} dz = \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2-2tz}{2})} dz$$ completing the squares in the exponent we get
  
  $$\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{-(\frac{z^2-2tz+t^2}{2})}*e^{\frac{t^2}{2}} dz = \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})}*e^{\frac{t^2}{2}} dz$$
  
  then my notes says $e^{\frac{t^2}{2}} \int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} dz$ where $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$ so the mgf is $e^{\frac{t^2}{2}}$.
  
  Why is $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$?
  
  I know that $\int_{-\infty}^{\infty}(\frac{1}{\sqrt{2\pi}}e^{\frac{-(x-\mu)^2}{2\sigma^2}})dx = 1$(prob. density function of a normal distribution) but no where in the problem did it mention $\mu = t$ in fact, $\mu=0$ how could $\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{(\frac{-(z-t)^2}{2})} =1$??
  
  -
  Put $\frac{z - t}{\sqrt{2}}$ as $x$, then your integral looks like $\int_{-\infty}^{\infty} \frac{1}{\sqrt{\pi}} exp(-x^2) dx$, this is just your old Gaussian Integral – TenaliRaman Nov 25 '12 at 18:17
  @TenaliRaman does $exp(a+b)$ mean $e^{a+b}$ – user133466 Nov 25 '12 at 18:29
  Yes. $exp(a + b)$ means $e^{a + b}$. – TenaliRaman Nov 26 '12 at 0:00
  
  $\mu$ is just a dummy variable, that can be replaced by anything, such has $t,z,s,\triangle\ldots$ What you in fact have, namely $$\frac{1}{\sqrt{2\pi}}e^{-\frac{(z-t)^2}{2}}$$ is just a normal random variable's density function with expected value $t$ and standard deviation $1$, which you integrate on the whole line.
  
  Note that the density function of a normal random variable with expected value $\mu$ and standard deviation $\sigma$ is $$\frac{1}{\sqrt{2\pi\sigma^2}}\text{e}^{-\frac{(x-\mu)^2}{2\sigma^2}}.$$ and that $\mu,\sigma$ are dummy variables and can be replaced by anything you want, namely $t=\mu, 1=\sigma,$ or $w=\sigma$.
  
  -
  what does R.V. stand for? – user133466 Nov 25 '12 at 18:19
  Random variable – Jean-Sébastien Nov 25 '12 at 18:19
  err... it's just no where does it say $mu = t$! the denominator fits because the problem stated that $\sigma = 1$ but its like asking me to take a leap when we replace $\mu = t$... – user133466 Nov 25 '12 at 18:24
  @user133466 I made a correction. $\mu$ isnt equal to $t$, but the integral you're left with is the integral of a normal distribution with mean $t$ and standard deviation $1$ – Jean-Sébastien Nov 25 '12 at 18:28
  this is easier to understand. thank you! – user133466 Nov 25 '12 at 18:34
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The document contains a detailed mathematical derivation of the moment generating function (MGF) for a standard normal random variable \( Z \). The user poses a specific question about why the integral \(\int_{-\infty}^{\infty}\frac{1}{\sqrt{2\pi}}e^{\frac{-(z-t)^2}{2}} dz\) equals 1. The user also provides an answer to this question, explaining that the integral represents the probability density function (PDF) of a normal distribution with mean \( t \) and standard deviation 1, which integrates to 1 over the entire real line.
  
  Label: question-and-answer