First, I am sorry if this is an obvious question, I am starting to study bayesian statistics (mainly for machine learning) and I was seeing the classic coin flip example using a Bernoulli distribution with parameter $q$. So I checked the math using an uniform prior ($P(q)=1$), and I was trying to see how the posterior would change after seeing for example $D=\{heads,tails\}$. So After computing the equations, I got that the posterior $P(q|D)=6(q-q^2)$. Then I did the same computation, but this time in 2 steps; that is, first I computed  $P(q|D)$ but only with $D=\{heads\}$ which was equal to $2q$. Then I computed the posterior again with $D=\{tails\}$ but this time using the posterior that I just obtained ($P(q)=2q$). And then I obtained the same posterior as before. My question is, is this always the case if we assume iid samples or just works for this simple case? Is this how real life systems are programmed (using the previous posterior distribution as prior)?  Thanks!
I am currently reading Murphy's ML: A Probabilistic Perspective. In CH 3 he explains that a batch update of the posterior is equivalent to a sequential update of the posterior, and I am trying to understand this in the context of his example.  Suppose $D_a$ and $D_b$ are two data sets and $\theta$ is the parameter to our model. We are trying to update the posterior $P(\theta \mid D_a, D_b)$. In a sequential update, he states that, $$ (1) \ \ \ \ \ \ \ \  P(\theta \mid D_{a}, D_{b}) \propto P(D_b \mid \theta) P(\theta \mid D_a) $$ However, I am slightly confused as to how he got this mathematically. Conceptually, I understand that he is saying the posterior $P(\theta \mid D_a)$ is now a prior used to update the new posterior, which includes the new data $D_b$, and is multiplying this prior with the likelihood $P(D_b \mid \theta)$. Expanding the last statement out, I have, $$  P(D_b \mid \theta) P(\theta \mid D_a) = P(D_b \mid \theta) P(D_a \mid \theta) P(\theta) $$  but are we allowed to say $P(D_a \mid \theta) P(D_b \mid \theta) = P(D_a, D_b \mid \theta)$ in order to make the connection in (1)?
Is "double hashing" a password less secure than just hashing it once? Is hashing a password twice before storage any more or less secure than just hashing it once?  What I'm talking about is doing this:  $hashed_password = hash(hash($plaintext_password));   instead of just this:  $hashed_password = hash($plaintext_password);   If it is less secure, can you provide a good explanation (or a link to one)?  Also, does the hash function used make a difference?  Does it make any difference if you mix md5 and sha1 (for example) instead of repeating the same hash function?  Note 1:  When I say "double hashing" I'm talking about hashing a password twice in an attempt to make it more obscured.  I'm not talking about the .  Note 2:  I know I need to add a random salt to really make it secure.  The question is whether hashing twice with the same algorithm helps or hurts the hash. Graph nodes coordinates evaluation In the sentence "the best choice would be...", what does "would" mean in the following sentence?     Questioner: Is this sentence correct?   'Finished eating, we went to the zoo'.      Answer: I'm afraid that is not correct. The phrase 'Finished eating' is a participle phrase with a passive meaning and you need an active meaning here. The best choice would be 'Having finished eating...'. Show the two fields are not isomorphic Let $p,q,r$ be prime integers with $q\neq r$. Let $\sqrt[p]q$ denote any root of $x^p-q$ and $\sqrt[p]r$ denote any root of $x^p-r$. Please show that $\mathbb{Q}(\sqrt[p]q)\neq\mathbb{Q}(\sqrt[p]r)$.  By Eisenstein we know the two polynomials are irreducible and so they are minimal polynomials and both have degree $p$. Is there a database of Linux compatible hardware? I want to know if there is a centralised community site where all Hardware is listed in terms of compatability with Linux. Something like AppDB for Wine. In university last semester I was asked to prove that $\sin1$ (1 radian that is) is irrational,  and ended up simply using the Taylor Series Expansion. This method provides a very quick solution, but I am curious as to whether anyone has a method for proving this without making use of the Taylor Series Expansion. I feel as though doing so must be possible using some number theory, but am low on ideas as to an alternative approach to the question.  Note:  If anyone is interested in my solution using Taylor Series Expansion (although it is not the focus of my question), here it is :      From    $$ \sin x = x - \frac{x^3}{3!} + \frac{x^5}{5!} -  \dots$$   We see that    $$ \alpha = \sin 1 = 1 - \frac{1^3}{3!} + \frac{1^5}{5!} -  \dots $$   Given integers $a$ and $b$, if $\alpha = \frac{a}{b}$ then it follows that $b!\alpha \in \mathbb{Z}$, and $b!\alpha = C + D$ where $C \in \mathbb{Z}$ and we have :   $$ D = \begin{cases} \pm(\frac{1}{b+1} - \frac{1}{(b+1)(b+2)(b+3)} + \dots) \text{    if $b$ is even}\\ \pm(\frac{1}{(b+1)(b+2)} - \frac{1}{(b+1)\dots(b+4)} + \dots ) \text{ if $b$ is odd}\\ \end{cases} $$   In each case we can see that $0 &lt; D &lt; 1$, giving us a contradiction.    Thus, we have that $\sin 1 $ is irrational.    $$ \blacksquare $$ Port forwarding with UFW I realize UFW is mainly just for enabling/disabling access on particular ports, but I'm trying to forward one port to another. I want any connection to port 1724 to be forwarded to 1723.   The file /etc/default/ufw already has DEFAULT_FORWARD_POLICY="ACCEPT". And I believe I need to uncomment net/ipv4/ip_forward=1 in /etc/ufw/sysctl.conf. Finally I need to edit /etc/ufw/before.rules to add an iptables rule.   And here is where I get lost because I can't find any documentation for this file. Where do I add the rule? And how exactly?  In particular:   On exactly which line do I add the rule? Do I put anything before or after it? Can someone help me figure out the big-O for the recurrence relation $T(n) = T(n^{1/2}) + 1$?  I didn't think the master theorem would work since it requires $T(n) = T(n/b)$... to have $b$ as a constant. I was wondering if anyone could shed some light on a method to approach this problem? (not looking for a solution) Probability Math Question...? Bag A contains 3 white and 2 red balls. Bag B contains 6 white and 3 red balls. One of the two bags will be chosen at random, and then two balls will be drawn from that bag at random without replacement. What is the probability that the two balls drawn will the be the same color? Express your answer as a common fraction. I'm going through MSIL and noticing there are a lot of  instructions in the MSIL.  The MSDN article says they take no action and are used to fill space if the opcode is patched. They're used a lot more in debug builds than release builds.  I know that these kinds of statements are used in assembly languages to align later instructions, but why are MSIL nops needed in MSIL?  (Editor's note: the accepted answer is about machine-code NOPs, not MSIL/CIL NOPs which the question originally asked about.) When does function composition commute? I've read that function composition "generally does not commute."  Not counting compositions involving the identity function, and compositions of a function and its inverse, are there examples of functions on the reals (for example) $f, g$ where $fg = gf$ outside of these cases? Find out trace of a given matrix $A$ with entries from $\mathbb{Z}_{227}$ Let $A$ be a $227\times 227$ matrix with entries in $\mathbb{Z}_{227}$ such that all of its eigen values are distinct. What would be its trace? I think it is zero by adding all 227 elements but i am not sure.  Edited: Here I have assumed that eigenvalues are in a base field. Evaluating $\int \frac{\sin\left(x\right)}{1+x^2}dx$ $$\int \frac{\sin\left(x\right)}{1+x^2}dx$$  I have tried to integrate by parts but it doesn't work. How do I evaluate it? Any advice, hint or well-thought solution will be appreciated. Ubuntu 18.04 opening system settings logs me out In drupal 7 you can do this to load an entity revision using  ($entity_type, $ids = FALSE, $conditions = array(), $reset = FALSE)  like this:  $old_revision = entity_load('node', array(), array('vid' =&gt; 123));   However now $conditions is being deprecated. Pretty much wherever you go you see people saying that you should use  instead of conditions, however that doesn't help in this case. You can use  to query revisions using EntityFieldQuery however it doesn't give you fully loaded node results so you then still have to load the entity and how do you load that revision of that entity without the conditions. Alphabetically display the items in itemize How to open a PDF file from terminal? I used to work on the Mac terminal before and I used:   open file2open.pdf   and the PDF file would be opened on preview or whatever my default viewer was. When I use it in the terminal in Ubuntu I get this error message:   Couldn't get a file descriptor referring to the console Power series of a function I am wondering if there are any functions $f(x)$ such that it cannot be expressed as a power series of $x$? This might turn out to be a silly question, but I can't think of one at the moment.   Thanks! What are the drawbacks with using UUID or GUID as a primary key? I would like to build a distributed system. I need to store data in databases and it would be helpful to use an  or a  as a primary key on some tables. I assume it's a drawbacks with this design since the UUID/GUID is quite large and they are almost random. The alternative is to use an auto-incremented INT or LONG.  What are the drawbacks with using UUID or GUID as a primary key for my tables?  I will probably use Derby/JavaDB (on the clients) and PostgreSQL (on the server) as DBMS. How to implement a single instance Java application?