Let X be a random variable whose PDF is $f(x)$, and $g$ a function of random variable X. I want to prove that $$E[g(X)] = \int{g(x)f(x)dx} $$ I've perfectly understood it in discrete case and I managed to prove also for continous case when $g$ is an increasing function. What is a formal proof for this formula? And what is a good intuition for it?
For random variable $X$ that follows some distribution, $f(x)$ is the probability density function of that distribution if and only if $$\mathbb{E}[\phi(X)] = \int_{-\infty}^\infty \phi(x) f(x)dx$$ for all functions $\phi$.  Context: My professor used this in lecture to demonstrate a way to find the distribution of $cX$ given random variable $X$ that follows a specific distribution.   What is the name of this theorem? Have I missed any qualifications/caveats? I am in particular curious about whether "for all functions" is correct. My professor mentioned "positive, bounded, deterministic functions," but I am not sure what he meant by that. Where can I find a proof of this theorem?
Friendly_Id and Reserved Words -- How can i replace the reserved word? What type of path in shebang is more preferable? In scripts, first line should specify the path to interpreter. But on different servers Linux, Unix, or BSD this path could be different.  What is more preferable?  #!/usr/bin/env bash    or  #!/bin/bash How to quickly send commands to nested tmux sessions? I have the following in my .tmux.conf  set -g prefix M-j bind-key j  send-prefix   I need to press (Atl+J) + (J) + bound-key to send something to the nested tmux session. I feel it is rather slow. Is there any better way? For example, I would love to be able to do (Alt+J) + (2x bound-key) to do stuff in the nested session. I constantly execute commands in the top tmux session instead of executing them in the nested one. Also, how come everybody binds prefix to C-a? I find it awfully slow and unpleasant to type this combination. Am I missing something? Why is there no overload of Interlocked.Add that accepts Doubles as parameters? Should I be concerned that the sill plate is not lined up with the foundation? I am in the process of building a one level home in PA. After the formed concrete walls were poured and the framing began, I noticed that on one side of the house that the sill plate was flush with the edge of the foundation wall in the rear, but, by the time the sill plate got to the front it was 2 1/2" away from the edge of the foundation wall. In summary, the sill plate walks from flush with the foundation wall at the rear to 2 1/2" at the front. This happens over about a 50' run.  Any thoughts or concerns would be appreciated. Any recommendations on what sorts of questions to ask when I meet the site supervisor on Monday? How do you access the Shrine of Winter? In Dark Souls 2 there is a 'Shrine of Winter' near Sinners Rise. When you approach the shrine it will not let you open the door and a message pops up that says      Seek Mightier Souls   What does this mean and how do you open this shrine? In general relativity (GR), spacetime is viewed as a differentiable manifold of dimension $D$ with a metric of Lorentzian signature $(-,+,+,...,+)$.  My question is why differentiable? bash - problems reading text file and printing line by line I'm mainly a C# developer, but I'm currently working on a project in Python.  How can I represent the equivalent of an Enum in Python? Install App Image such as beaker browser and pin it to dock (favorites) in Ubuntu 20.04? Does a sorcerer's metamagic work for non-sorcerer spells? Can a multiclass sorcerer/cleric use the Metamagic class ability with non-sorcerer spells? For example, using Twinned Spell when casting cure wounds to heal two creatures instead of just one? Windows 10 default programs keep changing Since the fall update last month, Windows 10 automatically keeps changing the default apps for certain types (mostly browser,pdf,mp3,jpg). I have tried changing them back from the Settings app as well as the Control Panel.  I have observed that this happens mostly while unzipping files using WinZip. Windows changes the default programs back to Microsoft recommended programs such as Edge, Photos, Groove etc.  Is there a way to restrict this from happening? Has anybody else encountered a similar situation? I couldn't find similar question anywhere so I'm asking this here. Proofs involving $ (A\setminus B) \cup (A \cap B)$ How to install Python and wxPython offline? I could not install my modem driver so I have to update and install applications offline. For this I want to use keryx but to install keryx, Python and wxPython have to be installed first. So how do I install Python and wxPython offiline on Ubuntu 13.04?  Note : I don't have internet connection in Ubuntu. So I'll have to download the required file from my Windows 7. Time Expressions with "in" I have seen some examples about using "in" with time expressions. They give some examples as shown below:     I will leave for vacation in a month. (Exactly one month from now I   will go on vacation.)      We’ll be there in an hour.  (Exactly one hour will go by and then we   will arrive.)   But these comments confused me. Then I looked the usage of "in" up in a dictionary and it says about usage of "in" with time expressions :"before or at the end of a particular period". I think the comments and the definition in the dictionary contradict each other?    I have examples of mine:     1- Dinner will be ready in ten minutes. (Maybe dinner will be   ready at the 5th minute? or 8th. Does it strictly mean dinner will be   ready at the end of the ten minutes?)      2- My letter arrived in two days. ( Does that mean it took   exactly two days to arrive? or Could it be just one day because he/she   doesnt remember the exact time?)      3- Imagine you are on the first day of a month and your friend says:   I will be going outside the country in this month. (Does that mean he/she could go tomorrow or ten days later or at the end of the   month?)      4- He can run a mile in 5 minutes. ( Does that mean he has to   spent entire 5 minutes to run a mile? Could it be 4 or 4.5 minutes?) What software works well for viewing massive TIFF images on Windows 7? Beamer: how to justify the whole text? Finding the unique rock with its weight I have 12 rocks, all have the same weight except for one rock, but I don‘t know which rock is. How do I know which rock is different from other, and also know that rock heavier or lighter, with maximum 3 comparating steps. My only tool is just a balance that can only compare the weight between the rocks. Proof of A ⊆ C and B ⊆ C ⇔ A ∪ B ⊆ C I know that this is valid because by thinking about it, you can see it's true, but I'm just not sure how I would go about actually proving it mathematically. I've kind of tried proof by contradiction, since that's what I use most of the time, but it doesn't seem to work.    In my mind, A ∪ B ⊆ C kind of just implies that A ⊆ C and B ⊆ C. An improved \rowstyle that takes the cell contents as an argument It is possible to format the column entries of a tabular in an argument-style fashion using the lrbox environment to   store the column cell in a box (say) \mybox; and supply \mybox as an argument to some other macro.   Here is a short example illustrating this fact*:  \documentclass{article} \usepackage{array}% http://ctan.org/pkg/array \begin{document} \newsavebox{\mybox} \begin{tabular}{c&gt;{\begin{lrbox}{\mybox}}c&lt;{\end{lrbox}\fbox{\usebox{\mybox}}}c}   One &amp; Two &amp; Three \\ \hline   1 &amp; 2 &amp; 3 \\   4 &amp; 5 &amp; 6 \\   7 &amp; 8 &amp; 9 \\ \hline \end{tabular} \end{document}     The above example uses the  to achieve this column-specific formatting. More specifically, each cell in the column is supplied as an argument to \fbox. Does there exist an equivalent automation that would yield    \documentclass{article} \begin{document} \begin{tabular}{ccc}   One &amp; Two &amp; Three \\ \hline   1 &amp; 2 &amp; 3 \\   \fbox{4} &amp; \fbox{5} &amp; \fbox{6} \\   7 &amp; 8 &amp; 9 \\ \hline \end{tabular} \end{document}   without having to specify \fbox for each entry in the row?  As a start, I know that the  provides \rowfont[&lt;alignment&gt;]{&lt;font specification&gt;}. However, this only applies macros &lt;font specification&gt; to each cell in a row and these macros can't take the cell contents as an argument. Moreover, you need to use the tabu environment in order to use this. So that's a little restricting. Also, trying to decipher the  macros for colouring a tabular or array row is just confusing.  The UK TeX FAQ entry on  modifies the row entries via column specifications and therefore requires the addition of "subtle" identifiers like  \begin{tabular}{|$l|^l|^l|}   to initiate $ and propagate ^ whatever row style is defined. Is there a way around this or at least a cleaner alternative that doesn't use columns to format entries in a row? In particular, a solution should provide an lrbox-style flexibility, since the contents of the cell in the to-be-styled row could be anything, even a paragraph (say).  * There are other alternatives, as indicated by the post .