text:
Tango is a sad thought that is danced.think & dance

Bioinformatics and Genome Analysis Course. Izmir International Biomedicine and Genome Institute, Izmir, Turkey. May 2–14, 2016

# Christopher Hitchens—Out of Letters

## ASCII Art

The images shown here were created as part of my ASCII Art project, which extends ASCII art to include

• proportionally spaced fonts
• a variety of font weights in a single image
• both tone and structure of the image to select characters
• fixed strings to render an image in legible text

Applying the code to images of Hitchens was motivated by my own deep love of Hitchens and a typographic portrait of Christopher Hitchens, created out of Gill Sans letters by Miles Chic at Capilano University.

This adds to my growing shrines to Hitchens, including Merry Hitchmas! and hitchslap t-shirts.

## Christopher Hitchens in Letters and Words

All images are generated using Gotham, with up to 8 weights (Extra Light to Ultra). Each image includes size and characters used for the image. I give the absolute type size, though only useful to know in relative terms to the size of the image and other images drawn with the same method. The color of text in each layer is the same—black— but font weight may vary.

Some images are generated using more than one layer of ASCII. In some cases the characters used in each layer are different.

## basic ascii

As the font size is reduced, greater detail and contrast can be achieved.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 43pt set: . x 8 : * @ - \ | _space_ / (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 29pt set: . x 8 : * @ - \ | _space_ / (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 17pt set: . x 8 : * @ - \ | _space_ / (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: . x 8 : * @ - \ | _space_ / (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)

By setting the image with a fixed string, such as a short quote or longer body of text, detail is lost but the ASCII representation takes on more meaning.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: godisnotgreat (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 29pt set: godisnotgreat (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: Hitchslap 11 (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 5 layers (11pt -6deg, 17pt 6deg, 29pt -3deg, 43pt 3deg, 59pt 0deg) set: godisnotgreat (source from Christian Witkin/Twelve/Grand Central Publishing) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 7pt set: . x 8 : * @ - \ | _space_ / (source from Gasper Tringale) (zoom, source)

## multi-layered ascii art

Images take on detail when multiple rotated layers of text is used. Each of the images below is composed of more than one layer, starting with a 2-layer image which uses the uppercase alphabet at 0 and 90 degrees.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers (0deg, 90deg) set: A-Z (source from HBO) (zoom, source)

Meaning can be added to the image by using different text in each layer. In the examples below, I set the same image using the pair "Godisnotgreat" (at 0 degrees) and "religionpoisonseverything" (at 90 degrees). In the second example, I use the unlikely combination of "Jesus" and "Mohammad"—inspired by Jesus and Mo.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: Godisnotgreat. 0deg Relionpoisonseverything. 90deg (source from HBO) (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: Jesus 0deg Mohammad 90deg (source from HBO) (zoom, source)

When rotated layers contain punctuation, very high level of detail can be achieved.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: . : - + * _space_ 0deg / 90deg (zoom, source)

The image below is made out of layers that contain only forward (/) and back (\) slashes.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: \ / (zoom, source)

The image below is made using only the period character in three layers rotated at -45, 0 and 45 degrees. Although the image looks like a pixelated version of the original—it is more than that. It is a typeset representation that uses 8 weights of Gotham. Character spacing between periods is informed by font metrics.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: . (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 2 layers set: 8 X x | ^ : . - = + ' " @ \ / | * ~ , # (source from The Australian) (zoom, source)

## hitchens at the podium

The three images below show the difference between using a variety of punctuation characters and setting an image using a block of text. The first image uses "8 X x" and common punctuation.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: 8 X x | ^ : . - = + ' " @ \ / | * ~ , # (zoom, source)

I use hitchslap 9 for the first image below, and all the hitchslaps for the second image. When setting an image in using a block of text, the choice of character at any position is fixed and only the font weight is allowed to vary. When the text is relatively short (e.g. hitchslap 9 is 544 characters and is repeated 50 times in the image), rivers of space appear in the image.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: Hitchslap 9 (zoom, source)
Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: all Hitchslaps (zoom, source)

In both cases, the image is very recognizable.

## recursive ascii art

When an image of text is set with the text itself, you have recursive ASCII art. Below is hitchslap 2, set with itself. In the image, the font is Gotham and the text used to asciify the image is also Gotham.

It makes ordinary moral people, compels them, forces them, in some cases orders them do disgusting wicked unforgivable things. There's no expiation for the generations of misery and suffering that religion has inflicted in this way and continues to inflict. And I still haven't heard enough apology for it. — Christopher Hitchens

The quote is 307 characters long and is repeated 391 times in the image.

Christopher Hitchens ASCII Art. method: Gotham font, 8 weights, 11pt set: Hitchslap 2 (source from hitchslap 2) (zoom, source)

In principle, the process of asciifying text with text can be repeated, by using the asciified image as input for asciification with progressively smaller text.

# Gene Volume Control

Thu 11-06-2015

I was commissioned by Scientific American to create an information graphic based on Figure 9 in the landmark Nature Integrative analysis of 111 reference human epigenomes paper.

The original figure details the relationships between more than 100 sequenced epigenomes and genetic traits, including disease like Crohn's and Alzheimer's. These relationships were shown as a heatmap in which the epigenome-trait cell depicted the P value associated with tissue-specific H3K4me1 epigenetic modification in regions of the genome associated with the trait.

Figure 9 from Integrative analysis of 111 reference human epigenomes (Nature (2015) 518 317–330). (details)

As much as I distrust network diagrams, in this case this was the right way to show the data. The network was meticulously laid out by hand to draw attention to the layered groups of diseases of traits.

Network diagram redesign of the heatmap for a select set of traits. Only relationships with –log P > 3.9 are displayed. Appears on Graphic Science page in June 2015 issue of Scientific American. (details)

This was my second information graphic for the Graphic Science page. Last year, I illustrated the extent of differences in the gene sequence of humans, Denisovans, chimps and gorillas.

# Sampling distributions and the bootstrap

Thu 11-06-2015

The bootstrap is a computational method that simulates new sample from observed data. These simulated samples can be used to determine how estimates from replicate experiments might be distributed and answer questions about precision and bias.

Nature Methods Points of Significance column: Sampling distributions and the bootstrap. (read)

We discuss both parametric and non-parametric bootstrap. In the former, observed data are fit to a model and then new samples are drawn using the model. In the latter, no model assumption is made and simulated samples are drawn with replacement from the observed data.

Kulesa, A., Krzywinski, M., Blainey, P. & Altman, N (2015) Points of Significance: Sampling distributions and the bootstrap Nature Methods 12:477-478.

Krzywinski, M. & Altman, N. (2013) Points of Significance: Importance of being uncertain. Nature Methods 10:809-810.

# Bayesian statistics

Thu 30-04-2015

Building on last month's column about Bayes' Theorem, we introduce Bayesian inference and contrast it to frequentist inference.

Given a hypothesis and a model, the frequentist calculates the probability of different data generated by the model, P(data|model). When this probability to obtain the observed data from the model is small (e.g. alpha = 0.05), the frequentist rejects the hypothesis.

Nature Methods Points of Significance column: Bayesian Statistics. (read)

In contrast, the Bayesian makes direct probability statements about the model by calculating P(model|data). In other words, given the observed data, the probability that the model is correct. With this approach it is possible to relate the probability of different models to identify one that is most compatible with the data.

The Bayesian approach is actually more intuitive. From the frequentist point of view, the probability used to assess the veracity of a hypothesis, P(data|model), commonly referred to as the P value, does not help us determine the probability that the model is correct. In fact, the P value is commonly misinterpreted as the probability that the hypothesis is right. This is the so-called "prosecutor's fallacy", which confuses the two conditional probabilities P(data|model) for P(model|data). It is the latter quantity that is more directly useful and calculated by the Bayesian.

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.

# Bayes' Theorem

Wed 22-04-2015

In our first column on Bayesian statistics, we introduce conditional probabilities and Bayes' theorem

P(B|A) = P(A|B) × P(B) / P(A)

This relationship between conditional probabilities P(B|A) and P(A|B) is central in Bayesian statistics. We illustrate how Bayes' theorem can be used to quickly calculate useful probabilities that are more difficult to conceptualize within a frequentist framework.

Nature Methods Points of Significance column: Bayes' Theorem. (read)

Using Bayes' theorem, we can incorporate our beliefs and prior experience about a system and update it when data are collected.

Puga, J.L, Krzywinski, M. & Altman, N. (2015) Points of Significance: Bayes' Theorem Nature Methods 12:277-278.


text:
# Exact Differential Equations 2

In here, we discussed that a first-order differential equation $M(x,y)dx+N(x,y)dy=0$ is exact if and only if $\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}$ in which case we can solve the exact equation by finding a potential $U$ such that $M(x,y)dx+N(x,y)dy=dU$. Let $\frac{\partial M}{\partial y}\ne\frac{\partial N}{\partial x}$ and multiply the equation by a function $\mu(x,y)$ (which is unbeknownst to us at the moment). $$\mu(x,y)M(x,y)dx+\mu(x,y)N(x,y)dy=0$$ Assume that this new equation is exact. Then $$\frac{\partial \mu M}{\partial y}=\frac{\partial \mu N}{\partial x}$$ which is equivalent to $$\label{eq:exact}N\frac{\partial\mu}{\partial x}-M\frac{\partial\mu}{\partial y}=\mu\left(\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}\right)$$ Let us consider a simple case $\mu=\mu(x)$. Then \eqref{eq:exact} reduces to $$\label{eq:exact2}\frac{d\mu}{dx}=\frac{\mu\left(\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}\right)}{N}$$ If the RHS of \eqref{eq:exact2} depends only on the $x$ variable, \eqref{eq:exact2} is a separable equation $$\frac{d\mu}{\mu}=\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}dx$$ and $\mu(x)$ is found by $$\mu(x)=\exp\left[\int\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}dx\right]$$ Similarly, if $\mu=\mu(y)$ then $$\mu(y)=\exp\left[-\int\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{M}dx\right]$$ provided $\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{M}$ depends only on the $y$ variable.

Example. Solve the equation $$(x^2-y)dx+(x^2y^2+x)dy=0$$

Solution. $\frac{\partial M}{\partial y}=-1$, $\frac{\partial N}{\partial x}=2xy^2+1$. $\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}=-\frac{2}{x}$ so $\mu(x)=\frac{1}{x^2}$. Now, \begin{align*}\mu Mdx+\mu Ndy&=\left(1-\frac{y}{x^2}\right)dx+\left(y^2+\frac{1}{x}\right)dy\\&=dx+y^2dy+\frac{xdy-ydx}{x^2}=0\end{align*} Since the last term is $d\left(\frac{y}{x}\right)$, by integrating we find the solution $$3x^2+xy^3+3y-Cx=0$$

Revisiting First-Order Linear Differential Equations

A first-order linear differential equation $\frac{dy}{dx}+P(x)y=Q(x)$ can be written as $$(P(x)y-Q(x))dx+dy=0$$ Let $M=Py-Q$ and $N=1$. Then $\frac{\partial M}{\partial y}=P$ and $\frac{\partial N}{\partial x}=0$ so $$\mu=e^{\int\frac{\frac{\partial M}{\partial y}-\frac{\partial N}{\partial x}}{N}dx}=e^{\int P(x)dx}$$ Now let $$\mu(P(x)y-Q(x))dx+\mu dy=dU$$ for some scalar function $U$. Then $$\frac{\partial U}{\partial x}=\mu Py-\mu Q,\ \frac{\partial U}{\partial y}=\mu$$ $$U(x,y)=\int_0^y\mu dy+\varphi(x)=\mu y+\varphi(x)$$ and $$\frac{\partial U}{\partial x}=\mu’y+\varphi'(x)=\mu Py+\varphi'(x)=\mu Py-\mu Q$$ Thus $\varphi'(x)=-\mu Q$ and hence $\varphi(x)=-\int\mu Qdx$. Since $\varphi(x)$ contains an arbitrary constant, we can set $U(x,y)=0$ for the general solution i.e. $\mu y-\int\mu Qdx=0$ and thereby $$y=\frac{\int\mu Qdx}{\mu}$$

# Exact Differential Equations 1

A first-order differential equation $$M(x,y)dx+N(x,y)dy=0$$ is called an exact differential equation is there is a scalar function $U(x,y)$ such that $$M(x,y)dx+N(x,y)dy=dU$$ The solution is then $U(x,y)=C$ where $C$ is a constant.

Theorem. Suppose that $M(x,y)$ and $N(x,y)$ have continuous partial derivatives in an open region $\mathcal{R}$. Then the equation $$M(x,y)dx+N(x,y)dy=0$$ is exact if and only if $$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}$$ for all $(x,y)\in\mathcal{R}$.

Proof. Suppose that $$M(x,y)dx+N(x,y)dy=0$$ is exact. Then there exists a scalar function $U(x,y)$ such that $$M(x,y)dx+N(x,y)dy=dU$$ Thus $\frac{\partial U}{\partial x}=M(x,y)$ and $\frac{\partial U}{\partial y}=N(x,y)$. Now, $$\frac{\partial M}{\partial y}=\frac{\partial^2U}{\partial y\partial x}=\frac{\partial^2U}{\partial x\partial y}=\frac{\partial N}{\partial x}$$ since $M$ and $N$ have continuous partial derivatives. Conversely suppose that $$\frac{\partial M}{\partial y}=\frac{\partial N}{\partial x}$$ for all $(x,y)\in\mathcal{R}$. Since $\frac{\partial U}{\partial x}=M$, $$U(x,y)=\int_{x_0}^x M(x,y)dx+\varphi(y)$$ So \begin{align*}\frac{\partial U}{\partial y}&=\frac{\partial}{\partial y}\int_{x_0}^x M(x,y)dx+\varphi(y)\\&=\int_{x_0}^x \frac{\partial M}{\partial y}dx+\varphi'(y)\\&=\int_{x_0}^x \frac{\partial N}{\partial x}dx+\varphi'(y)\\&=N(x,y)-N(x_0,y)+\varphi'(y)\end{align*} Since $\frac{\partial U}{\partial y}=N$, we have $$\varphi'(x)=N(x_0,y)$$ and so $\varphi(y)$ is found to be $$\varphi(y)=\int_{y_0}^y N(x_0,y)dy+C$$ where $C$ is a constant. Therefore, $$U(x,y)=\int_{x_0}^x M(x,y)dx+\int_{y_0}^yN(x_0,y)dy+C$$ This completes the proof.

Remark. Let $\mathbf{F}(x,y)=M(x,y)\mathbf{i}+N(x,y)\mathbf{j}$. Then $M(x,y)dx+N(x,y)dy$ being an exact differential is equivalent to $\mathbf{F}$ being conservative, because $M(x,y)dx+N(x,y)dy=dU$ if and only if $\mathbf{F}=\nabla U$. A scalar function $U(x,y)$ such that $\mathbf{F}=\nabla U$ is called a potential energy function or shortly a potential in physics. Also $\mathbf{F}\cdot d\mathbf{r}=M(x,y)dx+N(x,y)dy$ so $\mathbf{F}\cdot d\mathbf{r}=dU$ means that the work done by the force $\mathbf{F}$does not depend on the particle’s path but only depends on the initial point and the terminal point of the particle’s path.

Remark. Let us consider a complex differential $f(z)dz$. Let $z=x+iy$ and $f(z)=u(x,y)+iv(x,y)$ where $u(x,y)$ and $v(x,y)$ are scalar functions. Then $$f(z)dz=(u+iv)(dx+idy)=(udx-vdy)+i(vdx+udy)$$ This complex differential is exact if and only if both $udx-vdy$ and $vdx+udy$ are exact i.e. $u$ and $v$ satisfy \begin{aligned}\frac{\partial u}{\partial x}&=\frac{\partial v}{\partial y}\\\frac{\partial v}{\partial x}&=-\frac{\partial u}{\partial y}\end{aligned}\label{eq:cauchy-riemann} \eqref{eq:cauchy-riemann} are called the Cauchy-Riemann equations.  If $u$ and $v$ satisfy the Cauchy-Riemann equations \eqref{eq:cauchy-riemann}, they both satisfy Laplace’s equation $$\nabla^2\varphi=\frac{\partial^2\varphi}{\partial x^2}+\frac{\partial^2\varphi}{\partial y^2}=0$$ i.e. $u$ and $v$ are harmonic functions, in particular $v$ is called the harmonic conjugate of $u$. Furthermore $f(z)=u(x,y)+iv(x,y)$ is analytic meaning $\frac{df}{dz}$ exist and is given by $\frac{df}{dz}=\frac{\partial u}{\partial x}+i\frac{\partial v}{\partial x}$. Conversely, if $f(z)=u(x,y)+iv(x,y)$ is analytic then $v$ is a harmonic conjugate of $u$. For more details about harmonic functions see my lecture note here. Functions of a Complex Variable studies differentiation and integrations of complex analytic functions. Laplace’s equation is related to a minimum electrostatic energy. If $\mathbf{E}$ is the electrostatic force field, then in terms of the static potential energy $\varphi$, $\mathbf{E}=\nabla\varphi$. If one imposes the requirement that the static potential energy (associated with the field) in a given volume be a minimum, then it can be shown using Calculus of Variations that $\varphi$ satisfies $\nabla^2\varphi=0$. For details see page 943 of George Arfken, Mathematical Methods for Physicists, 3rd Edition, Academic Press, 1985.

Example.  Show that each equation is exact and find solution.

1. $2xydx+(x^2-2y)dy$
2. $(7x+3y)dx+(3x-5y)dy=0$

Solution.

1. $M=2xy$ and $N=x^2-2y$. Since $\frac{\partial M}{\partial y}=2x=\frac{\partial N}{\partial x}$, the equaiton is exact. Let $U$ be a scalar function such that $2xydx+(x^2-2y)dy=dU$. Then $\frac{\partial U}{\partial x}=2xy$, $\frac{\partial U}{\partial y}=x^2-2y$. From $\frac{\partial U}{\partial x}=2xy$, we get \begin{align*}U(x,y)&=\int_0^x\frac{\partial U}{\partial x}dx+\varphi(y)\\&=\int_0^x 2xydx+\varphi(y)\\&=x^2y+\varphi(y)\end{align*} Differentiating $U$ with respect to y  $$\frac{\partial U}{\partial y}=x^2+\varphi'(y)$$ Since we also have $\frac{\partial U}{\partial y}=x^2-2y$, $\varphi'(y)=-2y$ and $$\varphi(y)=\int_0^y -2ydy+C_1=-y^2+C_1$$ Therefore $U(x,y)=x^2y-y^2+C_1$. The solution is $x^2y-y^2+C_1=C_2$ which can then be written as $x^2y-y^2=C$.
2. Left as exercise for readers. The answer is $$\frac{7}{2}x^2+3xy-\frac{5}{2}y^2=C$$

Remark. The equation in #2 is also homogeneous so of course it can be solved as one. $$f(u)=-\frac{M(1,y)}{N(1,y)}=-\frac{7+3u}{3-5u}$$ and so \begin{align*}\int\frac{du}{f(u)-u}&=-\int\frac{5u-3}{5u^2-6u-7}du\\&=-\frac{1}{2}\int\frac{10u-6}{5u^2-6u-7}du\\&=-\frac{1}{2}\ln(5u^2-6u-7)\\&=\ln\frac{1}{\sqrt{5u^2-6u-7}}\end{align*} Hence the solution is $$x=C_1e^{\int\frac{du}{f(u)-u}}=\frac{C_1}{\sqrt{5u^2-6u-7}}$$ which can be written as $$5x^2y^2-6xy-7x^2=C_2$$ Notice that this is equivalent to the solution given above.

# Bernoulli’s Differential Equations

Bernoull’s differential equation $$\label{eq:bernoulli}\frac{dy}{dx}+P(x)y=Q(x)y^n$$ is nonlinear for $n\ne 0, 1$. Assume $n>1$ and multiply \eqref{eq:bernoulli} by $\frac{1}{y^n}$. $$\label{eq:bernoulli2}\frac{1}{y^n}\frac{dy}{dx}+P(x)\frac{1}{y^{n-1}}=Q(x)$$ Let $z=\frac{1}{y^{n-1}}$. Then \begin{align*}\frac{dz}{dx}&=\frac{dz}{dy}\frac{dy}{dx}\\&=(1-n)\frac{1}{y^n}\frac{dy}{dx}\end{align*} The equation \eqref{eq:bernoulli2} is reduced to the linear equation $$\label{eq:bernoulli3}\frac{dz}{dx}+(1-n)P(x)z=(1-n)Q(x)$$

Example. Solve the Bernoulli’s equation $$\frac{dy}{dx}-\frac{3}{x}y=-x^3y^2$$

Solution. The equation can be written as $$\frac{1}{y^2}\frac{dy}{dx}-\frac{3}{x}\frac{1}{y}=-x^3$$ Let $z=\frac{1}{y}$. Then $\frac{dz}{dx}=-\frac{1}{y^2}\frac{dy}{dx}$ and subsequently we obtain the first-order linear differential equation $$\frac{dz}{dx}+\frac{3}{x}z=x^3$$ The integrating factor $\mu(x)$ is given by $$\mu(x)=e^{\int\frac{3}{x}dx}=e^{\ln x^3}=x^3$$ and thus the solution $z(x)$ is $$z(x)=\frac{\int\mu Qdx}{\mu}=\frac{\int x^6dx}{x^3}=\frac{\frac{x^7}{7}+C}{x^3}$$ Since $z=\frac{1}{y}$, the final answer can be written as $$y\left(\frac{x^7}{7}+C\right)=x^3$$

# Homogeneous Differential Equations

Definition. A function $M(x,y)$ of two variables $x$ and $y$ is said to be homogeneous if for any parameter $\lambda$ $$M(\lambda x,\lambda y)=\lambda^n M(x,y)$$ The number $n$ is called the degree of the homogeneous function $M(x,y)$.

A first-order differential equation $$M(x,y)dx+N(x,y)dy=0$$ is said to be a homogeneous differential equation if both $M(x,y)$ and $N(x,y)$ are homogeneous functions of the same degree.

Solving Homogeneous Differential Equations

Consider a homogeneous differential equation $$M(x,y)dx+N(x,y)dy=0$$ For the parameter $\lambda=\frac{1}{x}$ we obtain $$\label{eq:homeq}\frac{dy}{dx}=-\frac{M\left(1,\frac{y}{x}\right)}{N\left(1,\frac{y}{x}\right)}$$ Let $u=\frac{y}{x}$. Then $y=ux$ and $\frac{dy}{dx}=x\frac{du}{dx}+u$. Since the RHS of \eqref{eq:homeq} can be considered as a function of $u$, say $f(u)$ we have $$x\frac{du}{dx}+u=f(u)$$ This is a separable equation as it can be written as $$\frac{du}{f(u)-u}=\frac{dx}{x}$$ and by integrating we find the solution $$\label{eq:homeq2}x=C\exp\left[\int\frac{du}{f(u)-u}\right]$$ Let $F(u)=\int\frac{du}{f(u)-u}$. Then \eqref{eq:homeq2} can be written as $$x=Ce^{F(u)}=Ce^{F\left(\frac{y}{x}\right)}$$

Example. Solve $(y-x)ydx+x^2dy=0$.

format: plain


text:
# C#LeetCode刷题之#830-较大分组的位置（Positions of Large Groups）

In a string S of lowercase letters, these letters form consecutive groups of the same character.

For example, a string like S = “abbxxxxzyy” has the groups “a”, “bb”, “xxxx”, “z” and “yy”.

Call a group large if it has 3 or more characters.  We would like the starting and ending positions of every large group.

The final answer should be in lexicographic order.

Input: “abbxxxxzzy”

Output: [[3,6]]

Explanation: “xxxx” is the single large group with starting  3 and ending positions 6.

Input: “abc”

Output: []

Explanation: We have “a”,”b” and “c” but no large group.

Input: “abcdddeeeeaabbbcd”

Output: [[3,5],[6,9],[12,14]]

Note:  1 <= S.length <= 1000

```public class Program {

public static void Main(string[] args) {
string S = string.Empty;

S = "abbxxxxzzy";
var res = LargeGroupPositions(S);
ShowArray(res);

S = "abcdddeeeeaabbbcd";
res = LargeGroupPositions2(S);
ShowArray(res);

}

private static void ShowArray(IList<IList<int>> array) {
foreach(var list in array) {
foreach(var index in list) {
Console.Write(\$"{index} ");
}
}
Console.WriteLine();
}

private static IList<IList<int>> LargeGroupPositions(string S) {
var result = new List<IList<int>>();
var last = '\0';
var startIndex = -1;
var endIndex = -1;
for(var i = 0; i < S.Length; i++) {
if(S[i] != last || i == S.Length - 1) {
endIndex = i - 1;
if(i == S.Length - 1 && S[i] == last) endIndex = i;
if(endIndex - startIndex + 1 >= 3) {
var item = new List<int>();
}
startIndex = i;
}
last = S[i];
}
return result;
}

private static IList<IList<int>> LargeGroupPositions2(string S) {
var result = new List<IList<int>>();
for(var i = 0; i < S.Length; i++) {
var next = i + 1;
var dic = new Dictionary<int, int>();
while(next < S.Length && S[next] == S[i]) {
if(next - i >= 2) {
dic[i] = next;
}
next++;
}
if(dic.TryGetValue(i, out int value)) {
result.Add(new int[] { i, value });
i = next - 1;
//循环内部更改循环计数是一种不好的做法，切记切记
//如果不是必需，请勿模仿此做法
}
}
return result;
}

}```

```3 6
3 5 6 9 12 14```


text:
# PDE with NDSolve gives solution despite not enough boundary conditions [duplicate]

For a given PDE, uniqueness of the solution requires boundary/initial conditions, the exact type of conditions depending on the particular PDE under consideration. For example consider the wave equation in 2 dimensions:

$u_{tt}(t,x)=c^2 u_{xx}(t,x)$

where $c>0$, we take $x\in[0,L]$ with $L>0$ and $t>0$. Then for instance we get a unique solution if we specify the functions $u(0,x)$, $u_t(0,x)$, $u(t,0)$ and $u(t,L)$ (with special care to choose these functions consistently). Mathematica behaves as expected in this case (i.e. it gives me a solution and no error/warnings).

However, if I don't specify part of the boundary conditions, say I don't fix the value of $u(t,L)$, then Mathematica gives no error (nor warning) and gives a solution for $u(t,x)$.

How is this possible? We don't expect such problems to have a unique solution, so is Mathematica implicitly choosing the missing boundary condition? Or is Mathematica using a property of numerical solutions to PDE that I am missing?

Examples:

With all the boundary conditions:

NDSolve[{
Derivative[2, 0][u][t, x] == 2 Derivative[0, 2][u][t, x],
u[0, x] == 0,
Derivative[1, 0][u][0, x] == 1,
u[t, 0] == Sin[t],
u[t, 5] == (1/3) Sin[3 t]},
u, {t, 0, 10}, {x, 0, 5}]

The same as above but with one boundary condition dropped:

NDSolve[{
Derivative[2, 0][u][t, x] == 2 Derivative[0, 2][u][t, x],
u[0, x] == 0,
Derivative[1, 0][u][0, x] == 1,
u[t, 0] == Sin[t]},
u, {t, 0, 10}, {x, 0, 5}]

## marked as duplicate by zhk, m_goldberg, xzczd, happy fish, MarcoBMar 31 '17 at 7:24

• Please give the code for an example so that others can easily confirm what you are saying. – C. E. Mar 30 '17 at 14:29
• I'd be happy to, but copy/pasting Mathematica code in code environment gives the full input form which is hardly readable. How to proceed? – Bru Mar 30 '17 at 14:59
• Make the code as simple as possible (choose the most simple PDE etc., the wave equation should be fine) and then post that. We can demand nothing more. – C. E. Mar 30 '17 at 15:04
• The code is very simple. But it is the copy/paste procedure that produces extra things. I tried all the options for the copy command in Mathematica (copy as plain text, copy as input, ...) it always gives nasty things. For instance, ∂ gives PartialD and so on. – Bru Mar 30 '17 at 15:15
• The way to copy code properly is introduced in this post. Then, I should say I'm surprised that in this case the bcart warning doesn't pop up, I've included this in the previous question, thanks for pointing out. – xzczd Mar 31 '17 at 3:44

Comment

ClearAll["Global*"];
c = 1;
pde = {D[u[t, x], t, t] == c^2 D[u[t, x], x, x]};

ics = {u[0, x] == 0, Derivative[1, 0][u][0, x] == 1};

bcs1 = {u[t, 0] == Sin[t], u[t, 5] == 1/3 Sin[3*t]};

bcAll1 = Flatten[{ics, bcs1}, 1];

sol1 = NDSolve[{pde, bcAll1}, {u}, {t, 0, 10}, {x, 0, 5}];

When you drop out one of the boundary condition, NDSolve artificially choose one for it. Now the real question is, what type of bc that could be? To this, I do not know the answer.

The same type of question has been asked here, but with no real answer.

You have left out this u[t, 5] == 1/3 Sin[3*t] and interestingly, NDSolve solve the pde without any warning, while making an artificial replacement for it.

bcs2 = {u[t, 0] == Sin[t]};

bcAll2 = Flatten[{ics, bcs2}, 1];

sol2 = NDSolve[{pde, bcAll2}, {u}, {t, 0, 10}, {x, 0, 5}];
`


text:
# Angle Pairs

## Understand complementary angles as angles whose sum is 90 degrees and supplementary angles as angles whose sum is 180 degrees.

%
Progress

MEMORY METER
This indicates how strong in your memory this concept is
Progress
%
Geometry Definitions and Introduction to Proof

Unknown Complementary Angle Word Problem with Algebra
Teacher Contributed
The measures of two complementary angles are $\left(3x+6{\right)}^{\circ }$$( 3x + 6)^\circ$, and $\left(3x-6{\right)}^{\circ }$$(3x -6)^\circ$. What is the measure of the larger angle?
qid: 100076
Reviews


text:
PicaJet Forum has been moved to daminion.net/forum!
PicaJet User Forum
PicaJet - Digital Photo Management Software

Author Message
bernie
Guest

 Posted: Wed Mar 16, 2005 8:39 am    Post subject: network usability One more thing I´d like to know about this phantastic picture orgninizer is if it is possible to change the path to the library relating directories, so that each network member uses the same library. Thanks for any reply!
Anthony
Guest

 Posted: Sat Apr 09, 2005 12:20 am    Post subject: Is there an answer to this...? I also would like to know if this is possible. I have 2 PCs. Using the Family license, each copy of PicaJet would use the same database that was relocated (which it allows) to a central network drive. I would understand that only one program could be running (access it) at any given time. Is this possible.....? Thanks, Anthony
Alex
PicaJet Team

Joined: 18 Feb 2005
Posts: 340

 Posted: Sat Apr 09, 2005 7:58 am    Post subject: To use the same database for different computers is possible. But there are some conditions. 1. All photos must be imported from network paths "\\PC1\Photos" e.g. even if this folder (Photos) is at your computer ("D:\Photos" e.g.). 2. Exclusive using database at the same time (Only one person may use database at the same time). We have not enough tested for the multiuser mode. 3. Database must be shared at the network path.
Guest

 Posted: Wed Aug 03, 2005 7:49 pm    Post subject: Hello, what if i watned to get this to work on more then 5 computers, i was thinking about 10 computers for my company. Now if i got 2 family licenses would i still be able to put the database on the network on a server and have each person be able to access the database and make changes from both family licenses. I understand that only one person at a time would be able to access teh database but is it possible? If not when is your company going to come out with teh Network version for teh PicaJet?? ? We really need a photo organizer and so far this is the best that i have found. we are ready to spend extra for a network version as it would be more expensive. Thank you
Ascaaear

Joined: 22 Jun 2006
Posts: 15

Alex
PicaJet Team

Joined: 18 Feb 2005
Posts: 340

 Posted: Mon Dec 18, 2006 7:02 am    Post subject: Here is some recommendation to use PicaJet DB from two computers: Current version of PicaJet might be used on a network with some limitations: - Database must be placed in the shared folder (for example: \\server\PhotoBase\). - Images should be imported using the network paths (for example: \\server\photos15\) - Highly recommended do not write any "datas" simultaneously by several users per time. - if two users change any "datas" simultaneously, PicaJet might work unstable and all the category structure changes by another user will be visible after restarting the PicaJet.
Ascaaear

Joined: 22 Jun 2006
Posts: 15

 Posted: Tue Dec 19, 2006 1:32 pm    Post subject: Hi The actually problem is that something seems to deny the access to the shared location. I still get this message in the error report. Message : iDB Engine Error # 11013 Table 'O:\Picajet db\Lars Bilder\picabase.TDI'. Access denied. I use Zone Alarm btw, do I have to do something special to make it work through the software firewall? Any suggestions?
Alex
PicaJet Team

Joined: 18 Feb 2005
Posts: 340

 Posted: Wed Dec 20, 2006 7:22 am    Post subject: When this message is appears?
Ascaaear

Joined: 22 Jun 2006
Posts: 15

 Posted: Sun Jan 14, 2007 11:42 am    Post subject: Sorry for late reply... i got it when PicaJet are initialized, so i doesn come as far as using PicaJet
Alex
PicaJet Team

Joined: 18 Feb 2005
Posts: 340

 Posted: Mon Jan 15, 2007 2:19 pm    Post subject: Try to recovery database. Run PicaJet with "recovery nological" parameters: 1. Start > Run 2. Type "C:\Program Files\Picajet\Picajet.exe" recovery nological
 Display posts from previous: All Posts1 Day7 Days2 Weeks1 Month3 Months6 Months1 Year Oldest FirstNewest First
 All times are GMT Page 1 of 1

 Jump to: Select a forum PicaJet - Digital Photo Organizer----------------AnnouncementsGeneral DiscussionFeature request & suggestionsProblems and TroubleshootingLanguage SupportOther Questions and AnswersPlugins RoboImport / RoboFolder----------------General DiscussionLanguage Support
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


text:
# Friday, October 7, 2011 Logical theorems and more proofs

## 1Logical theorems¶

A logical theorem (in $\Sigma$) is a $\Sigma$-formula $\Phi$ such that there can be a formal proof with last line $\vdash \Phi$.

Gödel's incompleteness threorem says that nothing can algorithmically decide whether or not $\Phi$ is a logical theorem. (Notably, there are algorithms for deciding if $\Phi$ is a tautology, or formula, etc.)

### 1.1Proof of a logical theorem¶

$$\forall x Px \iff \neg \exists x \neg Px$$

Sequent Justification/rule
(1) $Px ,\,\neg Px \vdash Py \land \neg Py$ Tautology (due to material implication, $\bot \to$ anything)
(2) $\forall x Px \vdash Px$ $\forall$-elimination
(3) $\forall x Px,\,Px,\,\neg Px \vdash Py \land \neg Py$ Monotonicity from (1)
(4) $\forall x Px ,\,\neg Px \vdash Px$ Monotonicity from (2)
(5) $\forall x Px ,\,\neg Px \vdash Py \land \neg Py$ Transitivity using (3), (4)
(6) $\forall xPx,\,\exists x \neg Px \vdash Py \land \neg Py$ $\exists$-elimination
(7) $\forall x Px \vdash \neg\exists x \neg Px$ Contradiction from (6)
(8) $\vdash \forall x Px \to \neg \exists x \neg Px$ Deduction from (7)
Now we need to get the other side: $\leftarrow$ basically
(9) $\neg Px \vdash \neg Px$ Tautology
(10) $\neg Px \vdash \exists x \neg Px$ $\exists$-introduction from (9)
(11) $\vdash \neg Px \to \exists x \neg Px$ Deduction from (10)
(12) $\neg Px \to \exists x \neg Px \vdash \neg \exists x \neg Px \to Px$ Tautology, using contrapositives1
(13) $\vdash \neg \exists x \neg Px \to Px$ Transitivity using (11) and (12)
(14) $\neg \exists x \neg Px \vdash Px$ Deduction from (13)
(15) $\neg \exists \neg P x \vdash \forall x Px$ $\forall$-introduction from (14)
(16) $\vdash \neg \exists x \neg Px \to \forall x Px$ Deduction from (15)
(17) $\forall x Px \to \exists x \neg Px,\, \neg \exists x \neg Px \to \forall x Px \vdash \forall x Px \iff \neg \exists x \neg Px$ Tautology (connecting lines (1)-(8) and (9)-(16))
(18) $\forall x Px \to \neg \exists x \neg Px \vdash \neg \exists x \neg Px \to \forall x Px$ Monotonicity from (16)
(19) $\forall x Px \to \neg \exists x \neg Px \vdash \forall x Px \iff \neg \exists x \neg Px$ Transitivity using (17) and (18)
(20) $\vdash \forall x Px \iff \neg \exists x \neg Px$

### 1.2Proof of another logical theorem¶

$$\forall x \forall y Pxy \iff \forall y \forall x Pxy$$

where $P$ is a binary predicate symbol. Again, we first prove the $\to$, then the $\leftarrow$.

Sequent Justification/rule
(1) $\forall x \forall y Pxy \vdash \forall y Pxy$ $\forall$-elimination
(2) $\forall y Pxy \vdash Pxy$ $\forall$-elimination
(3) $\forall x \forall y Pxy, \,\forall y Pxy \vdash Pxy$ Monotonicity from (2)
(4) $\forall x \forall y Pxy \vdash Pxy$ Transitivity using (1), (3)
(5) $\forall x \forall y Pxy \vdash \forall x Pxy$ $\forall$-introduction from (4)
(6) $\forall x \forall y Pxy \vdash \forall y \forall x Pxy$ $\forall$-introduction from (5)
(7) $\vdash \forall x \forall y Pxy \to \forall y \forall x Pxy$ Deduction from (6)
... Same thing for (8)-(13), just switch the order on the left
(14) $\vdash \forall y \forall x Pxy \to \forall x \forall y Pxy$ Deduction from (13)
(15) $\forall x \forall y Pxy \to \forall y \forall x Pxy,\, \forall y \forall x Pxy \to \forall x \forall y Pxy \vdash \forall x \forall y Pxy \iff \forall y \forall x Pxy$ Tautology
(16) $\forall y \forall x Pxy \to \forall x \forall y Pxy \vdash \forall x \forall y Pxy \to \forall y \forall x Pxy$ Monotonicity from (7)
(17) $\forall y \forall x Pxy \to \forall x \forall y Pxy \vdash \forall x \forall x Pxy \iff \forall y \forall x Pxy$ Transitivity using (7), (16)
(18) $\vdash \forall x \forall y Pxy \iff \forall y \forall x Pxy$ Transitivity using (14), (17)2

Note that $\exists x \forall y Pxy$ and $\forall y \exists x Pxy$ are not the same thing. However, $\exists x \exists y Pxy \iff \exists y \exists x Pxy$ is true.

### 1.3When something isn't a logical theorem¶

$$(\exists x Px \land \exists x Qx) \to \exists x (Px \land Qx)$$

This is not "sound" so we shouldn't be able to prove it. In fact, we should be able to come up with an empirical counterexample, and we can: if $Px$ means $x$ is a peach, and $Qx$ means $x$ is a quince, then if the theorem is sound there should be something that is both a quince and a peach. But there isn't.

1. $\neg A \to B \vdash \neg B \to A$. It's legitimate.

2. Bet you never thought the proof could be so long


text:
## Because God needs a new parking lot

Posted on March 18th, 2011 at 23:06 by John Sinteur in category: Pastafarian News

[Quote]:

Members of the small congregation at Houston Unity Baptist Church said when they refused to give the pastor their tax refunds; he refused to give them their Communion.

Some members of the church spoke with FOX 26 anonymously.

"He said for all those who are getting a tax refund, ‘How many are you are going to give it to the church’?" James said.

Write a comment

## Identifying photocopy machine poses problem for Cuyahoga County official

Posted on March 18th, 2011 at 21:57 by John Sinteur in category: News

[Quote]:

What is a photocopier?

That seems like such a simple question.

## A boy’s own guide to building a giant creepy eyeball that follows you round the room

Posted on March 18th, 2011 at 20:33 by John Sinteur in category: awesome

[Quote]:

There was a lot of excitement in the Technology Studio this week when a nice man with a van dropped off three large flight cases containing something rather special: a spherical display system called a Puffersphere. Pufferfish, the company which invented them, has been kind enough to lend us one for a week.

[..]

For the next step, the Kinect

Write a comment

 Comments: Sue W on March 19th, 2011 at 15:03: That is farking creepy! Coming soon to a mall near you, I’m sure.

## うんち・おならで例える原発解説

Posted on March 18th, 2011 at 19:52 by John Sinteur in category: News

Write a comment

## Pastor jailed for trafficking African child ‘slaves’

Posted on March 18th, 2011 at 19:49 by John Sinteur in category: Pastafarian News

[Quote]:

A church pastor has been jailed for 11 and a half years after being found guilty of trafficking children into the UK for use as domestic "slaves" at her home in Barking, east London.

Write a comment

## CNN Sending Eight Times More Staff to Royal Wedding Than to Japan

Posted on March 18th, 2011 at 18:50 by John Sinteur in category: News

[Quote]:

This crazy statistic comes from the Wall Street Journal’s Amy Chozick and Cecile Rohwedder, who discovered, as proof of the media madness that will be Prince William and Kate Middleton’s wedding, "CNN alone will have a team of roughly 400 reporters, cameramen and crew assigned to the wedding." To compare: A group of just 50 CNN employees, one-eighth the size of the anticipated wedding fleet, are currently on the ground in Japan covering the aftermath of the earthquake and the continuing nuclear containment problem.

No wonder I prefer Al Jazeera…

Write a comment

 Comments: Andre on March 19th, 2011 at 0:26: It perfectly correlates to how many people will be following either event. And, shockingly, I cannot say I blame them anymore. Kharkov on March 19th, 2011 at 4:47: While I’m not overly sympathetic here, it should be noted that one will be a drawn-out, tedious experience with a lot of standing around in a very crowded place where none of the natives can be understood by you and some of the places are areas you really wouldn’t want to go to… and the other place is in Japan.

## Pope’s visit debt: now overdue

Posted on March 18th, 2011 at 18:22 by John Sinteur in category: Pastafarian News

[Quote]:

According to a Government response to a parliamentary question from NSS honorary associate Baroness Turner of Camden, the Catholic Church has not yet paid the £6.3 million it owes the British taxpayer for debts incurred during the visit of the pope last September.

The Church had promised to pay the money back by 1 March, but responding to Baroness Turner, the Foreign and Commonwealth Minister Lord Howell of Guildford, said his office sent the invoice to the Catholic Bishops Conference of England and Wales on 25 February 2011. “We expect to receive the funds in due course,” he said. The NSS is monitoring the situation and will ask for a subsequent question to be tabled if the money is not paid in good time.

Write a comment

 Comments: Spaceman Spiff on March 18th, 2011 at 19:55: Well, they could put a lien on the church’s properties… then foreclose! Works for me!

## Haley donor replaces Darla Moore on USC Board of Trustees

Posted on March 18th, 2011 at 18:17 by John Sinteur in category: News

[Quote]:

Governor Nikki Haley has removed philanthropic businesswoman Darla Moore from the University of South Carolina Board of Trustees, and replaced her with a donor to Haley’s gubernatorial campaign.

Haley spokesman Rob Godfrey said Moore’s removal happened on March 10, but was not made public until Tuesday. "As is the case with many of our appointees, the governor looked for a fresh set of eyes to put in a critical leadership position –- a governor’s appointee to the USC board," said Godfrey.

That "fresh set of eyes" is Lexington attorney Thomas Cofield, a Columbia native and USC graduate who Haley appointed to Moore’s former seat. State ethics reports show Cofield gave $4,500 to Haley’s gubernatorial campaign. Write a comment ## U.N. Security Council approves no-fly zone over Libya Posted on March 18th, 2011 at 9:14 by John Sinteur in category: News [Quote]: The U.N. Security Council Thursday gave the go-ahead to Britain and France – backed by the U.S. and at least two Arab nations – to launch airstrikes to enforce a no-fly zone over Libya and to protect civilians in rebel-held areas from forces loyal to dictator Moammar Gadhafi. [..] The resolution’s key provision also authorized countries enforcing the zone “to take all necessary measures . . . to protect civilians and civilian populated areas under threat of attack . . . including Benghazi,” but it ruled out a foreign occupation force “of any form on any part of Libyan territory.” it basically means “you have the right to aerially bombard the shit out of every military target you can find”. This is not a war to save people. If we cared about that we would be intervening in Cote D’Ivoire, where there has been horrible violence on the same level as that in Libya. The problem here is that Tripoli is 226 miles away from the EU. Write a comment  Comments: Mykolas on March 18th, 2011 at 11:40: John, notwithstanding the hypocrisy of this, (and you might as well add Zimbabwe, Bahrain, etc. to the list that includes Cote D’Ivoire), it does not mitigate the fact the action is needed here (also). Maybe the fact that this time there was no unilateral cowboy action as seen so many times before, it will serve as a model for resolving other venues of injustice. Although I must add that as to likelihood of such action in other venues, well, I remain cynical. Paul Jay on March 18th, 2011 at 16:55: Save the oil! uh People.. ## Cartoons Posted on March 18th, 2011 at 9:05 by John Sinteur in category: Cartoon Write a comment  Comments: Nik on March 18th, 2011 at 15:14: I knew that the quake moved the whole island of Japan, but I never picked up on the “FOX” news that it has also flipped the Earth’s Magnetic Poles! Or did it only rotate Japan by 180 deg.? (See the sherffius21-23 cartoon) John Sinteur on March 18th, 2011 at 16:58: Nik, you’ve heard of a place called California, right? SjG on March 19th, 2011 at 1:21: Hey, if I live in Sendai now, why is good Japanese food so expensive? ## The New York Times Paywall Is … Weird Posted on March 18th, 2011 at 8:50 by John Sinteur in category: News [Quote]: The paywall is certainly being set high enough that a lot of regular readers will not subscribe. These are readers who would normally link to the NYT from their blogs, who would tweet NYT articles, who would post those articles on Facebook, and so on. As a result, not only will traffic from these readers decline, but so will all their referral traffic, too. The NYT makes more than$300 million a year in digital ad revenue, so even a modest decline in pageviews, relative to what the site could have generated sans paywall, can mean many millions of dollars foregone. On top of that, the paywall itself cost somewhere over $40 million to develop. [Quote]: Wait, wait, wait. Times spent$40 million to implement this paywall? Are the developers’ keyboards gold plated with diamond encrusted function keys? I mean the specs are as follows:

– If they subsribe, let them in.

Okay, so you have some routing rules in what constitutes an article, and granted there can be some complex logic in what I’m sure is a very complex distribution system. Still, I can’t imagine it taking more than 20 competent, senior developers a years work to get this going. This isn’t 1965 anymore, we have high level languages.

Eh, I’ve seen enough of these implementations to know better:

– $15mil McKinsey Consulting for coming up with ways to “monetize new media, cross-platform technologies” (read: a hundred PowerPoints where the solution is charge more than the fucking pay subscribers, yes more than it costs to have someone deliver a physical product to your house every Sunday). –$5mil to lawyers at some firm that I’m sure someone at AboveTheLaw is both snarking at and secretly resenting they never got an offer to.

– $15mil for data center expansions, and I’m going to go out on a limb and assume that Cisco/HP/Oracle sold them on some sort of new “modular” or “pod” data center that, if you squint, manages to save money. Hey we’re at$35mil. So yeah, \$5mil for this sounds about right.

Write a comment

 Comments: Steffen on March 18th, 2011 at 11:29: Reminds me of the german government labor offices, who had the plan to employ a huge internet search service for open job positions nationwide. The project failed miserably. At the end, it cost several 100 million euros in taxpayer money. All for a system which was extremely slow, crashed regularly, the user interface was cumbersome, and it assigned job positions which didn’t match qualifications at all. Who was responsible for this textbook example of a failed software project? Accenture (the former Arthur Andersen consulting, who were involved in the Enron scandal, btw) And nobody should be wondering that Accenture got the contract under very dubious circumstances …

## Japan: Hopes fade for finding more survivors – The Big Picture

Posted on March 18th, 2011 at 8:43 by John Sinteur in category: Great Picture

[Quote]:

As officials desperately tried to prevent disaster at a damaged nuclear facility, hopes faded for finding survivors amid the rubble as snow and cold blanketed the areas most affected by the earthquake and tsunami in northeast Japan. Residents were allowed back into damaged areas for the first time since the disaster to inspect what might be left of their homes. And flights out of Japan were full as foreign nationals and others left the country. The Big Picture continues special daily coverage of the disaster through tomorrow, with later updates anticipated as events merit. — Lane Turner (27 photos total)

25
A couple cross a large intersection in front of blacked out light displays in Tokyo’s Ginza district March 17. In the famous shopping mecca – and elsewhere in the nation’s capital – public apprehension over a brewing nuclear disaster is draining the streets and stores of the crowds that normally define this dynamic, densely packed city. (Gregory Bull/AP) #

Write a comment

## RSA Breached: SecureID Affected

Posted on March 18th, 2011 at 7:43 by John Sinteur in category: Security

[Quote]:

You will see this all over the headlines during the next days, weeks, and maybe even months. RSA, the security division of EMC, announced they were breached and suffered data loss.

Before the hype gets out of hand, here’s what we know, what we don’t, what you need to do, and some questions we hope are answered:

What we know

According to the announcement, RSA was breached in an APT attack (we don’t know if they mean China, but that’s well within the realm of possibility) and material related to the SecureID product was stolen.

The exact risk to customers isn’t clear, but there does appear to be some risk that the assurance of your two factor authentication has been reduced.

I wondered why my fob has been 8008135 all day.

Write a comment

## Fukushima on Thursday: Prospects starting to look good

Posted on March 18th, 2011 at 7:42 by John Sinteur in category: News

[Quote]:

The story of the quake- and tsunami-stricken Fukushima Daiichi nuclear powerplant continues to unfold, with reports suggesting that the situation with respect to the three damaged reactors at the plant may soon be stabilised without serious consequences. The focus of attention has now moved to problems at a pool used to keep spent fuel rods cool. There remain no indications that anyone has yet suffered any radiation health effects, and the prospect is growing that this will remain the case.

Write a comment


text:
vec_as_index() has been renamed to vec_as_location() and is deprecated as of vctrs 0.2.2.

Usage

vec_as_index(i, n, names = NULL)

Arguments

i

An integer, character or logical vector specifying the locations or names of the observations to get/set. Specify TRUE to index all elements (as in x[]), or NULL, FALSE or integer() to index none (as in x[NULL]).

n

A single integer representing the total size of the object that i is meant to index into.

names

If i is a character vector, names should be a character vector that i will be matched against to construct the index. Otherwise, not used. The default value of NULL will result in an error if i is a character vector.


text:
# R/data.R In washdata: Urban Water and Sanitation Survey Dataset

################################################################################
#
#' Urban Water and Sanitation Survey Dataset
#'
#'
#' @docType data
#' @name washdata
#' @keywords internal
#'
#
"_PACKAGE"

################################################################################
#
#' Population Data for Dhaka, Bangladesh
#'
#' Grid-based population of Dhaka, Bangladesh
#'
#' @format A data frame with four variables:
#' \describe{
#' \item{\code{psu}}{primary sampling unit (PSU) ID}
#' \item{\code{zone}}{survey enumeration area}
#' \item{\code{type}}{slum (1) or non-slum (2)}
#' \item{\code{pop}}{population}
#' }
#'
#' @examples
#' popBGD
#
"popBGD"

################################################################################
#
#' WASH Survey Raw Data for Dhaka, Bangladesh
#'
#' WASH survey raw data collected by WSUP in Dhaka, Bangladesh
#'
#' @format A data frame with 217 variables and 1282 entries:
#' \describe{
#' \item{\code{country}}{Country}
#' \item{\code{ccode}}{Country Code}
#' \item{\code{zone}}{Enumeration Area}
#' \item{\code{type}}{Sampling Point Type}
#' \item{\code{hhid}}{Household ID}
#' \item{\code{uniqueID}}{Unique ID}
#' \item{\code{month}}{Month of Survey}
#' \item{\code{year}}{Year of Survey}
#' \item{\code{deployment}}{Deployment}
#' \item{\code{enumerator}}{Enumerator}
#' \item{\code{status}}{Status}
#' \item{\code{responseCode}}{Response Code}
#' \item{\code{draftDate}}{Drafted On}
#' \item{\code{submissionDate}}{Submitted On}
#' \item{\code{surveyType}}{Survey type}
#' \item{\code{psu}}{primary sampling unit (PSU) ID}
#' \item{\code{latitude}}{PSU ID  Location Answered   latitude}
#' \item{\code{longitude}}{PSU ID  Location Answered   longitude}
#' \item{\code{accuracy}}{PSU ID  Location Answered   accuracy}
#' \item{\code{altitude}}{PSU ID  Location Answered   altitude}
#' \item{\code{area1}}{Thana}
#' \item{\code{area1Other}}{Thana  Other  please specify     specify}
#' \item{\code{area2}}{Ward}
#' \item{\code{slum}}{Slum}
#' \item{\code{gender}}{Respondent gender}
#' \item{\code{landOwnStatus}}{What is the respondent land ownership status}
#' \item{\code{nWomen}}{Number of adult women  aged 16 to  60}
#' \item{\code{nMen}}{Number of adult men  aged 16 to  60}
#' \item{\code{nOldWomen}}{Number of older women  aged _60}
#' \item{\code{nOldMen}}{Number of older men  aged _60}
#' \item{\code{nGirls}}{Number of girls  aged 4 15}
#' \item{\code{nBoys}}{Number of boys  aged 4 15}
#' \item{\code{nInfants}}{Number of infants  _3}
#' \item{\code{nMobility}}{How many people with reduced mobility are there in this household}
#' \item{\code{water1}}{Main source of drinking water}
#' \item{\code{water2}}{Main source of drinking water  Other  please specify     specify}
#' \item{\code{water3}}{Is the service provision formal or informal}
#' \item{\code{water4}}{Is the service provision formal or informal   Don t Know}
#' \item{\code{water5}}{Is main source of drinking water a WSUP supported facility}
#' \item{\code{water6}}{Is main source of drinking water a WSUP supported facility   Don t Know}
#' \item{\code{water7}}{Typical number of hours per day that water is available}
#' \item{\code{water8}}{Typical number of hours per day that water is available  Don t Know}
#' \item{\code{water9}}{Typical days per week that water is available}
#' \item{\code{water10}}{Typical days per week that water is available  Don t Know}
#' \item{\code{water11}}{Is water typically available and sufficient throughout the whole year}
#' \item{\code{water12}}{Is water typically available and sufficient throughout the whole year   Comments}
#' \item{\code{water13}}{Is water typically available and sufficient throughout the whole year   Don t Know}
#' \item{\code{water14}}{How long does it take to go there  get water  and come back}
#' \item{\code{water15}}{How long does it take to go there  get water  and come back   Don t Know}
#' \item{\code{water16}}{Are you satisfied that the distance between your main water source and your home is acceptable}
#' \item{\code{water17}}{Are you satisfied that the distance between your main water source and your home is acceptable   Don t Know}
#' \item{\code{water18}}{Do you consider that the queuing time at your main water source is acceptable}
#' \item{\code{water19}}{Do you consider that the queuing time at your main water source is acceptable   Not Applicable}
#' \item{\code{water20}}{Do you consider that the queuing time at your main water source is acceptable   Don t Know}
#' \item{\code{water21}}{Which household member s  usually collect the water}
#' \item{\code{water22}}{Which household member s  usually collect the water   Other  please specify     specify}
#' \item{\code{water23}}{Typical amount of water used by your household  per person per day}
#' \item{\code{water24}}{Typical amount of water used by your household  per person per day   Don t Know}
#' \item{\code{water25}}{Do you consider the amount of water supplied from your primary water source to be sufficient to meet your household_s requirements each day}
#' \item{\code{water26}}{Do you consider the amount of water supplied from your primary water source to be sufficient to meet your household_s requirements each day   Don t Know}
#' \item{\code{water27}}{Do you also use water from other water sources}
#' \item{\code{water28}}{Do you also use water from other water sources   Don t Know}
#' \item{\code{water29}}{Which is your usual secondary water source}
#' \item{\code{water30}}{Which is your usual secondary water source   Other  please specify     specify}
#' \item{\code{water31}}{Which is your usual secondary water source   Don t Know}
#' \item{\code{water32}}{Typical amount of money spent on water per week  magnitude}
#' \item{\code{water33}}{Typical amount of money spent on water per week  units}
#' \item{\code{water34}}{Typical amount of money spent on water per week  Don t Know}
#' \item{\code{water35}}{Are you satisfied with the price of your main water source}
#' \item{\code{water36}}{Are you satisfied with the price of your main water source   Don t Know}
#' \item{\code{water37}}{Would you be willing to invest in improving your drinking water source}
#' \item{\code{water38}}{Would you be willing to invest in improving your drinking water source   Comments}
#' \item{\code{water39}}{Would you be willing to invest in improving your drinking water source   Don t Know}
#' \item{\code{water40}}{Are you satisfied with the quality of your main water source}
#' \item{\code{water41}}{Are you satisfied with the quality of your main water source   Don t Know}
#' \item{\code{water42}}{What would increase your satisfaction}
#' \item{\code{water44}}{What would increase your satisfaction   Don t Know}
#' \item{\code{water45}}{Are you satisfied with the water pressure of your main water source}
#' \item{\code{water46}}{Are you satisfied with the water pressure of your main water source   Don t Know}
#' \item{\code{water47}}{Who do you talk to if there is a problem with the water supply}
#' \item{\code{water48}}{Who do you talk to if there is a problem with the water supply    Other  please specify     specify}
#' \item{\code{water49}}{Who do you talk to if there is a problem with the water supply    Not Applicable}
#' \item{\code{water50}}{Who do you talk to if there is a problem with the water supply    Don t Know}
#' \item{\code{water51}}{Previous source of drinking water}
#' \item{\code{water52}}{Previous source of drinking water  Other  please specify     specify}
#' \item{\code{water53}}{Previous source of drinking water  Don t Know}
#' \item{\code{water54}}{Typical amount of money spent per week on the previous water source  magnitude}
#' \item{\code{water55}}{Typical amount of money spent per week on the previous water source  units}
#' \item{\code{water56}}{Typical amount of money spent per week on the previous water source  Don t Know}
#' \item{\code{water57}}{Why do you use the WSUP supported facility instead of the facility you used before}
#' \item{\code{water58}}{Why do you use the WSUP supported facility instead of the facility you used before   Other  please specify     specify}
#' \item{\code{water59}}{Why do you use the WSUP supported facility instead of the facility you used before   Don t Know}
#' \item{\code{san1}}{Usage arrangement for household_s sanitation facility}
#' \item{\code{san2}}{Usage arrangement for household_s sanitation facility  Other  please specify     specify}
#' \item{\code{san3}}{Usage arrangement for household_s sanitation facility  Don t Know}
#' \item{\code{san4}}{How many people share use of the communal   shared toilet}
#' \item{\code{san5}}{How many people share use of the communal   shared toilet   Don t Know}
#' \item{\code{san6}}{What kind of toilet facility do members in your household usually use}
#' \item{\code{san7}}{What kind of toilet facility do members in your household usually use   Other  please specify     specify}
#' \item{\code{san8}}{What kind of toilet facility do members in your household usually use   Don t Know}
#' \item{\code{san9}}{Where does your toilet flush to}
#' \item{\code{san11}}{Where does your toilet flush to   Don t Know}
#' \item{\code{san12}}{Is main sanitation  facility a WSUP supported facility}
#' \item{\code{san13}}{Is main sanitation  facility a WSUP supported facility   Not Applicable}
#' \item{\code{san14}}{Is main sanitation  facility a WSUP supported facility   Don t Know}
#' \item{\code{san15}}{Is water available at the sanitation facility}
#' \item{\code{san16}}{Is water available at the sanitation facility   Don t Know}
#' \item{\code{san17}}{Are you satisfied with the status of the hand washing facilities at the sanitation facility}
#' \item{\code{san18}}{Are you satisfied with the status of the hand washing facilities at the sanitation facility   Don t Know}
#' \item{\code{san19}}{What would increase your satisfaction  1}
#' \item{\code{san21}}{What would increase your satisfaction   Don t Know  1}
#' \item{\code{san22}}{Is there an electric light in the sanitation facility}
#' \item{\code{san23}}{Is there an electric light in the sanitation facility   Don t Know}
#' \item{\code{san24}}{Does the sanitation facility have a lockable door}
#' \item{\code{san25}}{Does the sanitation facility have a lockable door   Don t Know}
#' \item{\code{san26}}{Does the sanitation facility have a container for menstrual hygiene management}
#' \item{\code{san27}}{Does the sanitation facility have a container for menstrual hygiene management   Don t Know}
#' \item{\code{san28}}{The last time your youngest child passed stools  what was done to dispose of the stools}
#' \item{\code{san29}}{The last time your youngest child passed stools  what was done to dispose of the stools   Not Applicable}
#' \item{\code{san30}}{The last time your youngest child passed stools  what was done to dispose of the stools   Don t Know}
#' \item{\code{san31}}{How long does it take to go there  queue for the toilet  if applicable  and come back}
#' \item{\code{san32}}{How long does it take to go there  queue for the toilet  if applicable  and come back   Don t Know}
#' \item{\code{san33}}{Typical amount of money spent on the main sanitation facility per week  magnitude}
#' \item{\code{san34}}{Typical amount of money spent on the main sanitation facility per week  units}
#' \item{\code{san35}}{Typical amount of money spent on the main sanitation facility per week  Don t Know}
#' \item{\code{san36}}{Are you satisfied with the price of the sanitation facility}
#' \item{\code{san37}}{Are you satisfied with the price of the sanitation facility   Don t Know}
#' \item{\code{san38}}{Did you make an initial investment in the sanitation facility}
#' \item{\code{san39}}{Did you make an initial investment in the sanitation facility    Don t Know}
#' \item{\code{san40}}{How much was the initial investment   magnitude}
#' \item{\code{san41}}{How much was the initial investment   units}
#' \item{\code{san42}}{How much was the initial investment   Don t Know}
#' \item{\code{san43}}{Would you be willing to invest in improved sanitation facilities}
#' \item{\code{san44}}{Would you be willing to invest in improved sanitation facilities   Comments}
#' \item{\code{san45}}{Would you be willing to invest in improved sanitation facilities   Don t Know}
#' \item{\code{san46}}{Are you satisfied with the cleanliness of the sanitation facilities}
#' \item{\code{san47}}{Are you satisfied with the cleanliness of the sanitation facilities   Don t Know}
#' \item{\code{san48}}{What would increase your level of satisfaction}
#' \item{\code{san49}}{What would increase your level of satisfaction   Other  please specify     specify}
#' \item{\code{san50}}{What would increase your level of satisfaction   Don t Know}
#' \item{\code{san51}}{Is everyone in the household able to get to the sanitation facility and use it}
#' \item{\code{san52}}{Is everyone in the household able to get to the sanitation facility and use it   Don t Know}
#' \item{\code{san53}}{Who is not using them}
#' \item{\code{san54}}{Who is not using them   Other  please specify     specify}
#' \item{\code{san55}}{Who is not using them   Don t Know}
#' \item{\code{san56}}{Why not}
#' \item{\code{san57}}{Why not   Other  please specify     specify}
#' \item{\code{san58}}{Why not   Don t Know}
#' \item{\code{san59}}{Do all household members usually use the available sanitation facilities}
#' \item{\code{san60}}{Do all household members usually use the available sanitation facilities   Don t Know}
#' \item{\code{san61}}{Who is not using them  1}
#' \item{\code{san62}}{Who is not using them   Other  please specify     specify 1}
#' \item{\code{san63}}{Who is not using them   Don t Know  1}
#' \item{\code{san64}}{Why are they not using the facilities}
#' \item{\code{san65}}{Why are they not using the facilities   Don t Know}
#' \item{\code{san66}}{Who do you talk to if there is a problem with the sanitation facility}
#' \item{\code{san67}}{Who do you talk to if there is a problem with the sanitation facility   Other  please specify     specify}
#' \item{\code{san68}}{Who do you talk to if there is a problem with the sanitation facility   Not Applicable}
#' \item{\code{san69}}{Who do you talk to if there is a problem with the sanitation facility   Don t Know}
#' \item{\code{san70}}{Do the women and girls in your household feel safe using the sanitation facilities during the day and night}
#' \item{\code{san71}}{Do the women and girls in your household feel safe using the sanitation facilities during the day and night  Don t Know}
#' \item{\code{san72}}{Why not  1}
#' \item{\code{san73}}{Why not   Don t Know  1}
#' \item{\code{san74}}{Do the women and girls in the household feel comfortable using the sanitation facilities during menstruation}
#' \item{\code{san75}}{Do the women and girls in the household feel comfortable using the sanitation facilities during menstruation   Not Applicable}
#' \item{\code{san76}}{Why not  2}
#' \item{\code{san77}}{Why not   Other  please specify     specify 1}
#' \item{\code{san78}}{Why not   Don t Know  2}
#' \item{\code{san79}}{What materials are used by the women girls of your house during their menstruation cycle}
#' \item{\code{san80}}{What materials are used by the women girls of your house during their menstruation cycle   Other  please specify     specify}
#' \item{\code{san81}}{How is the cloth washed}
#' \item{\code{san82}}{How is the cloth washed   Other  please specify     specify}
#' \item{\code{san83}}{Where do you dispose of the used napkin pad}
#' \item{\code{san84}}{Where do you dispose of the used napkin pad   Other  please specify     specify}
#' \item{\code{san85}}{When should you wash your hands}
#' \item{\code{san87}}{When should you wash your hands   Don t Know}
#' \item{\code{san88}}{Can you show me where you wash your hands}
#' \item{\code{san89}}{Can you show me where you wash your hands   Not Applicable}
#' \item{\code{wash60}}{Can you show me where you store your drinking water}
#' \item{\code{wash61}}{Can you show me where you store your drinking water   Not Applicable}
#' \item{\code{wash62}}{Can you show me where you store your drinking water   Don t Know}
#' \item{\code{san90}}{How often do you empty your pit septic tank}
#' \item{\code{san91}}{How often do you empty your pit septic tank   Other  please specify     specify}
#' \item{\code{san92}}{How often do you empty your pit septic tank   Not Applicable}
#' \item{\code{san93}}{How often do you empty your pit septic tank   Don t Know}
#' \item{\code{san94}}{How much does it cost to empty   magnitude}
#' \item{\code{san95}}{How much does it cost to empty   units}
#' \item{\code{san96}}{How much does it cost to empty   Not Applicable}
#' \item{\code{san97}}{How much does it cost to empty   Don t Know}
#' \item{\code{san98}}{Who empties the pit}
#' \item{\code{san99}}{Who empties the pit   Other  please specify     specify}
#' \item{\code{san100}}{Who empties the pit   Not Applicable}
#' \item{\code{san101}}{Who empties the pit   Don t Know}
#' \item{\code{san102}}{Who pays for the pit to be emptied}
#' \item{\code{san103}}{Who pays for the pit to be emptied   Other  please specify     specify}
#' \item{\code{san104}}{Who pays for the pit to be emptied   Not Applicable}
#' \item{\code{san105}}{Who pays for the pit to be emptied   Don t Know}
#' \item{\code{san106}}{Are you satisfied with the pit emptying service}
#' \item{\code{ppi1}}{How many   household members are 12 years old or younger}
#' \item{\code{ppi2}}{Do all   household members ages 6 to 12 currently attend a school educational   institution}
#' \item{\code{ppi3}}{X   In the   past year  did any household member ever do work for which he she was paid on   a daily basis}
#' \item{\code{ppi4}}{How many   rooms does your household occupy  excluding rooms used for business}
#' \item{\code{ppi5}}{What is the main construction material of the walls of the main room}
#' \item{\code{ppi6}}{Does the household own any televisions}
#' \item{\code{ppi7}}{How many fans does the household own}
#' \item{\code{ppi8}}{How many mobile phones does the household own}
#' \item{\code{ppi9}}{Does the household own any bicycles  motorcycle scooters  or motor cars etc}
#' \item{\code{ppi10}}{Does the household own  or rent sharecrop mortgage in or out  51 or more decimals of cultivable agricultural land  excluding uncultivable land and dwelling house homestead land}
#' \item{\code{ppi11}}{Does the household own  or rent sharecrop mortgage in or out  51 or more decimals of cultivable agricultural land  excluding uncultivable land and dwelling house homestead land    Time Answered}
#' }
#'
#' @examples
#' surveyDataBGD
#'
#
"surveyDataBGD"

################################################################################
#
#' WASH Survey Indicators Data for Dhaka, Bangladesh
#'
#' WASH survey indicators data calculated from survey raw data
#'
#' @format A data frame with 162 variables and 1282 entries
#'
#' @examples
#' indicatorsDataBGD
#'
#
"indicatorsDataBGD"

################################################################################
#
#' PPI Look-up Table for Bangladesh
#'
#' PPI look-up table for Bangladesh to calculate PPI score
#'
#' @format A data frame with 10 variables and 101 entries
#'
#' @examples
#' ppiMatrixBGD
#'
"ppiMatrixBGD"

## Try the washdata package in your browser

Any scripts or data that you put into this service are public.

washdata documentation built on Oct. 23, 2020, 8:16 p.m.


text:
essay-online

# How to solve exponential problems

Aug 27, 2018 · section 6-3 : just work it out and remember to “flip writing essay plans over” (invert) the number if it has a negative exponent. so, we have: create an account create tests & flashcards. don’t be scared by the fact dissertation template that the exponent is negative. such that mean is equal to 1/ λ, and variance is equal to 1/ λ 2 calculation of paper writing services best the exponential distribution (step how to solve exponential problems by step) step 1: how to solve exponential problems something always grows in relation to creativity and writing its current value, such as always how to solve exponential problems doubling. mobile notice. before attemptng to solve rational exponential equations like $$x ^{\frac{2}{3}} 1 = 65$$, you claims in argumentative writing should be comfortable simplify fraction exponents like $$27^{\frac 2 3 }$$ solve exponential sample apa papers equations such as $$9^x = 27^2$$ understand what a multiplicative inverse solving exponential equations with the same base – pike page 1 of 3 solving exponential problems with the same base deciding how to solve exponential equations 2x when asked to solve an exponential equation such as how to solve exponential problems 2x 6 = 32 or 5 –3 = 18, the first thing we need to do is to decide which way is the “best” way to solve the conclusion of education essay problem solving exponential growth problems using differential equations. in this case, both personal narrative essay examples sides have the same exponent, and this gre argument essay template means the bases must be equal. so, we have: wikihow staff example of an abstract paper how to solve algebraic how to close a paragraph in an essay problems with exponents:.

## 6 thoughts on “How to solve exponential problems”

1. Taylor says:

I loved as much as you will receive carried out right here. The sketch is tasteful, your authored material stylish. nonetheless, you command get got an shakiness over that you wish be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this hike.

2. Isaiah says:

3. Gabriella says:

Stunning story there. What happened after? Thanks!

4. Brianna says:

The very root of your writing whilst sounding agreeable in the beginning, did not sit perfectly with me personally after some time. Someplace throughout the paragraphs you actually managed to make me a believer but just for a while. I still have got a problem with your leaps in assumptions and you would do well to fill in those gaps. In the event you actually can accomplish that, I would undoubtedly be amazed.

5. Angelina says:

Together with every thing which appears to be building throughout this area, a significant percentage of viewpoints tend to be quite radical. Even so, I am sorry, but I do not subscribe to your whole plan, all be it exciting none the less. It would seem to us that your opinions are actually not entirely rationalized and in simple fact you are generally your self not even completely certain of the argument. In any case I did enjoy looking at it.

6. Sean says:

There are some interesting deadlines on this article but I don’t know if I see all of them heart to heart. There is some validity however I’ll take hold opinion until I look into it further. Good article , thanks and we wish more! Added to FeedBurner as well


text:
# Getting started with Bayesian variable selection using JAGS and rjags

#### Bayesian variable selection

In a previous post I gave a quick introduction to using the rjags R package to access the JAGS Bayesian inference from within R. In this post I want to give a quick guide to using rjags for Bayesian variable selection. I intend to use this post as a starting point for future posts on Bayesian model and variable selection using more sophisticated approaches.

I will use the simple example of multiple linear regression to illustrate the ideas, but it should be noted that I’m just using that as an example. It turns out that in the context of linear regression there are lots of algebraic and computational tricks which can be used to simplify the variable selection problem. The approach I give here is therefore rather inefficient for linear regression, but generalises to more complex (non-linear) problems where analytical and computational short-cuts can’t be used so easily.

Consider a linear regression problem with n observations and p covariates, which we can write in matrix form as

$y = \alpha \boldmath{1} + X\beta + \varepsilon,$

where $X$ is an $n\times p$ matrix. The idea of variable selection is that probably not all of the p covariates are useful for predicting y, and therefore it would be useful to identify the variables which are, and just use those. Clearly each combination of variables corresponds to a different model, and so the variable selection amounts to choosing among the $2^p$ possible models. For large values of p it won’t be practical to consider each possible model separately, and so the idea of Bayesian variable selection is to consider a model containing all of the possible model combinations as sub-models, and the variable selection problem as just another aspect of the model which must be estimated from data. I’m simplifying and glossing over lots of details here, but there is a very nice review paper by O’Hara and Sillanpaa (2009) which the reader is referred to for further details.

The simplest and most natural way to tackle the variable selection problem from a Bayesian perspective is to introduce an indicator random variable $I_i$ for each covariate, and introduce these into the model in order to “zero out” inactive covariates. That is we write the ith regression coefficient $\beta_i$ as $\beta_i=I_i\beta^\star_i$, so that $\beta^\star_i$ is the regression coefficient when $I_i=1$, and “doesn’t matter” when $I_i=0$. There are various ways to choose the prior over $I_i$ and $\beta^\star_i$, but the simplest and most natural choice is to make them independent. This approach was used in Kuo and Mallick (1998), and hence is referred to as the Kuo and Mallick approach in O’Hara and Sillanpaa.

#### Simulating some data

In order to see how things work, let’s first simulate some data from a regression model with geometrically decaying regression coefficients.

n=500
p=20
X=matrix(rnorm(n*p),ncol=p)
beta=2^(0:(1-p))
print(beta)
alpha=3
tau=2
eps=rnorm(n,0,1/sqrt(tau))
y=alpha+as.vector(X%*%beta + eps)

Let’s also fit the model by least squares.

mod=lm(y~X)
print(summary(mod))

This should give output something like the following.

Call:
lm(formula = y ~ X)

Residuals:
Min       1Q   Median       3Q      Max
-1.62390 -0.48917 -0.02355  0.45683  2.35448

Coefficients:
Estimate Std. Error t value Pr(>|t|)
(Intercept)  3.0565406  0.0332104  92.036  < 2e-16 ***
X1           0.9676415  0.0322847  29.972  < 2e-16 ***
X2           0.4840052  0.0333444  14.515  < 2e-16 ***
X3           0.2680482  0.0320577   8.361  6.8e-16 ***
X4           0.1127954  0.0314472   3.587 0.000369 ***
X5           0.0781860  0.0334818   2.335 0.019946 *
X6           0.0136591  0.0335817   0.407 0.684379
X7           0.0035329  0.0321935   0.110 0.912662
X8           0.0445844  0.0329189   1.354 0.176257
X9           0.0269504  0.0318558   0.846 0.397968
X10          0.0114942  0.0326022   0.353 0.724575
X11         -0.0045308  0.0330039  -0.137 0.890868
X12          0.0111247  0.0342482   0.325 0.745455
X13         -0.0584796  0.0317723  -1.841 0.066301 .
X14         -0.0005005  0.0343499  -0.015 0.988381
X15         -0.0410424  0.0334723  -1.226 0.220742
X16          0.0084832  0.0329650   0.257 0.797026
X17          0.0346331  0.0327433   1.058 0.290718
X18          0.0013258  0.0328920   0.040 0.967865
X19         -0.0086980  0.0354804  -0.245 0.806446
X20          0.0093156  0.0342376   0.272 0.785671
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Residual standard error: 0.7251 on 479 degrees of freedom
Multiple R-squared: 0.7187,     Adjusted R-squared: 0.707
F-statistic:  61.2 on 20 and 479 DF,  p-value: < 2.2e-16

The first 4 variables are “highly significant” and the 5th is borderline.

#### Saturated model

We can fit the saturated model using JAGS with the following code.

require(rjags)
data=list(y=y,X=X,n=n,p=p)
init=list(tau=1,alpha=0,beta=rep(0,p))
modelstring="
model {
for (i in 1:n) {
mean[i]<-alpha+inprod(X[i,],beta)
y[i]~dnorm(mean[i],tau)
}
for (j in 1:p) {
beta[j]~dnorm(0,0.001)
}
alpha~dnorm(0,0.0001)
tau~dgamma(1,0.001)
}
"
model=jags.model(textConnection(modelstring),
data=data,inits=init)
update(model,n.iter=100)
output=coda.samples(model=model,variable.names=c("alpha","beta","tau"),
n.iter=10000,thin=1)
print(summary(output))
plot(output)

I’ve hard-coded various hyper-parameters in the script which are vaguely reasonable for this kind of problem. I won’t include all of the output in this post, but this works fine and gives sensible results. However, it does not address the variable selection problem.

#### Basic variable selection

Let’s now modify the above script to do basic variable selection in the style of Kuo and Mallick.

data=list(y=y,X=X,n=n,p=p)
init=list(tau=1,alpha=0,betaT=rep(0,p),ind=rep(0,p))
modelstring="
model {
for (i in 1:n) {
mean[i]<-alpha+inprod(X[i,],beta)
y[i]~dnorm(mean[i],tau)
}
for (j in 1:p) {
ind[j]~dbern(0.2)
betaT[j]~dnorm(0,0.001)
beta[j]<-ind[j]*betaT[j]
}
alpha~dnorm(0,0.0001)
tau~dgamma(1,0.001)
}
"
model=jags.model(textConnection(modelstring),
data=data,inits=init)
update(model,n.iter=1000)
output=coda.samples(model=model,
variable.names=c("alpha","beta","ind","tau"),
n.iter=10000,thin=1)
print(summary(output))
plot(output)

Note that I’ve hard-coded an expectation that around 20% of variables should be included in the model. Again, I won’t include all of the output here, but the posterior mean of the indicator variables can be interpreted as posterior probabilities that the variables should be included in the model. Inspecting the output then reveals that the first three variables have a posterior probability of very close to one, the 4th variable has a small but non-negligible probability of inclusion, and the other variables all have very small probabilities of inclusion.

This is fine so far as it goes, but is not entirely satisfactory. One problem is that the choice of a “fixed effects” prior for the regression coefficients of the included variables is likely to lead to a Lindley’s paradox type situation, and a consequent under-selection of variables. It is arguably better to model the distribution of included variables using a “random effects” approach, leading to a more appropriate distribution for the included variables.

#### Variable selection with random effects

Adopting a random effects distribution for the included coefficients that is normal with mean zero and unknown variance helps to combat Lindley’s paradox, and can be implemented as follows.

data=list(y=y,X=X,n=n,p=p)
init=list(tau=1,taub=1,alpha=0,betaT=rep(0,p),ind=rep(0,p))
modelstring="
model {
for (i in 1:n) {
mean[i]<-alpha+inprod(X[i,],beta)
y[i]~dnorm(mean[i],tau)
}
for (j in 1:p) {
ind[j]~dbern(0.2)
betaT[j]~dnorm(0,taub)
beta[j]<-ind[j]*betaT[j]
}
alpha~dnorm(0,0.0001)
tau~dgamma(1,0.001)
taub~dgamma(1,0.001)
}
"
model=jags.model(textConnection(modelstring),
data=data,inits=init)
update(model,n.iter=1000)
output=coda.samples(model=model,
variable.names=c("alpha","beta","ind","tau","taub"),
n.iter=10000,thin=1)
print(summary(output))
plot(output)

This leads to a large inclusion probability for the 4th variable, and non-negligible inclusion probabilities for the next few (it is obviously somewhat dependent on the simulated data set). This random effects variable selection modelling approach generally performs better, but it still has the potentially undesirable feature of hard-coding the probability of variable inclusion. Under the prior model, the number of variables included is binomial, and the binomial distribution is rather concentrated about its mean. Where there is a general desire to control the degree of sparsity in the model, this is a good thing, but if there is considerable uncertainty about the degree of sparsity that is anticipated, then a more flexible model may be desirable.

#### Variable selection with random effects and a prior on the inclusion probability

The previous model can be modified by introducing a Beta prior for the model inclusion probability. This induces a distribution for the number of included variables which has longer tails than the binomial distribution, allowing the model to learn about the degree of sparsity.

data=list(y=y,X=X,n=n,p=p)
init=list(tau=1,taub=1,pind=0.5,alpha=0,betaT=rep(0,p),ind=rep(0,p))
modelstring="
model {
for (i in 1:n) {
mean[i]<-alpha+inprod(X[i,],beta)
y[i]~dnorm(mean[i],tau)
}
for (j in 1:p) {
ind[j]~dbern(pind)
betaT[j]~dnorm(0,taub)
beta[j]<-ind[j]*betaT[j]
}
alpha~dnorm(0,0.0001)
tau~dgamma(1,0.001)
taub~dgamma(1,0.001)
pind~dbeta(2,8)
}
"
model=jags.model(textConnection(modelstring),
data=data,inits=init)
update(model,n.iter=1000)
output=coda.samples(model=model,
variable.names=c("alpha","beta","ind","tau","taub","pind"),
n.iter=10000,thin=1)
print(summary(output))
plot(output)

It turns out that for this particular problem the posterior distribution is not very different to the previous case, as for this problem the hard-coded choice of 20% is quite consistent with the data. However, the variable inclusion probabilities can be rather sensitive to the choice of hard-coded proportion.

#### Conclusion

Bayesian variable selection (and model selection more generally) is a very delicate topic, and there is much more to say about it. In this post I’ve concentrated on the practicalities of introducing variable selection into JAGS models. For further reading, I highly recommend the review of O’Hara and Sillanpaa (2009), which discusses other computational algorithms for variable selection. I intend to discuss some of the other methods in future posts.

#### References

O’Hara, R. and Sillanpaa, M. (2009) A review of Bayesian variable selection methods: what, how and which. Bayesian Analysis, 4(1):85-118. [DOI, PDF, Supp, BUGS Code]
Kuo, L. and Mallick, B. (1998) Variable selection for regression models. Sankhya B, 60(1):65-81.

### darrenjw

I am Professor of Stochastic Modelling within the School of Mathematics & Statistics at Newcastle University, UK. I am also a computational systems biologist.

## 23 thoughts on “Getting started with Bayesian variable selection using JAGS and rjags”

1. The approach of introducing 0-1 indicators in Bayesian model selection goes back well before 1998. I think it’s a bit much to say that Kuo and Mallick introduced such an idea.

1. OK – fair comment – I’ve changed “introduced” to “used”. The point is that it is important to distinguish between the many closely related but subtly different models for BVS, and for that I’m following the terminology of O’Hara and Sillanpaa.

2. The first time that the zero-one indicators are used are in SSVS (George and McCullogh, 1993, Jasa) which is slightly different that KM. Also see the work of Dellaportas Forster and Ntzoufras (2002) in Stats+Comp that compares the methods and introduces a more efficient gibbs sampler for variable selection. Also the same group has published a paper in 2000 with BUGS code and I have a paper in 2003 in JSS explaining in detail how you can implement these methods in BUGS. Chapter 11 in my book also illustrates how you can implement the variable selection Gibbs samplers in WinBUGS. Finally, In a recent tutorial for WinBUGS in WIRES Computational Statistics we explain how Lasso methods and Lasso based variable selection can be implemented in WinBUGS.

Regards

Ioannis

3. Sameer says:

Great post (even if I got here more >1 year later)!

It did make me wonder whether a Bayes Factor can be constructed from the indicator variables for model selection?
If instead of choosing pind=0.2 but rather 0.5 so that model priors were equal, would the ratio of ind[j]==1 to ind[j]==0 be the Bayes Factor for a model including variable j?

Thanks for the great blogging!

1. Zhuoyu says:

Great post even another one more year later. And I have the same question. How to calculate Bayes Factor here? Thank Darren’s great blogging and Sameer’s question. If you have figure out the answer, please share it with me.

1. The question isn’t very well posed. A Bayes factor compares 2 models, but here we have 2^p models, and it isn’t very clear why we’d be interested in specifically comparing any two of them.

4. Is there a good review paper for the history and progress of variable selection?

1. I just saw the O’Hara reference :v but if anyone knows of any others too…

5. Fangfang says:

Hello, thank you for your great post related to the Bayesian variable selection for linear models. I have a question, in the last section, you used Beta(2,8) prior for the inclusion probability p, it seems that often no-informative prior uniform(0,1) is imposed for p, here I understand that you want to learn about degree of sparsity so instead you use Beta prior, do you know any reference paper that mentioned Beta prior is reasonable to be used even if you don’t know any prior information for p?

1. The beta distribution is conjugate in this context. Note that the Uniform(0,1) is a special case of the beta, so you are using a beta if you use the Uniform(0,1).

1. Fangfang says:

Thank you for your reply. I have one more question, why do you use Beta(2,8) rather than other Beta distribution, say, Beta(1,8), Beta(0.5,0.5), Unif(0,1)?
Right now I am doing some data analysis, I need to justify that I could choose the prior Beta(2,8) for inclusion probability p, since I found that the results are a little different if I use different beta distributions as prior for inclusion probability.

2. No deep reason. It has a smallish mean, and the right kind of shape – not too concentrated.

2. See Scott and Berger 2010 “BAYES AND EMPIRICAL-BAYES MULTIPLICITY ADJUSTMENT
IN THE VARIABLE-SELECTION PROBLEM” for comparisons between a uniform and beta prior. By integrating out the inclusion probability p it is interesting to consider the marginal prior distribution induced over the model space. See figure 1 for the log prior vs model size. Uniform prior favours relatively small and large models, for which the latter could be considered undesirable.

6. Thanks for a nice and clear tutorial. What happens if the model is binomial? Can this approach still be used? I would imagine that the prior on the inclusion probability differs for a binomial model?

1. Sure, the same approach should work for a binomial GLM.

7. Ok, thank for the answer. I am wondering, because in my model (binomial), the betas are totally different when the Indicator is included compared with the model without indicators (when using the last approach for indicators that you have presented here).

This site uses Akismet to reduce spam. Learn how your comment data is processed.


text:
# How does this capillary-action setup not become a perpetual motion machine?

If you have a very thin glass tube and you place it into water, let's say the water in the tube rises to the height of $x$ mm from the surface of the water. What would happen if you poked a hole in the tube at a height $n$ where $n<x$ and coated the sides of the hole with hydrophobic material so water could more easily slip through it. Wouldn't the water just cascade outward? And then the capillary action of the water would pull up more water, causing, in my mind, a perpetual motion machine? Energy conservation is raising its eyebrows at me now but doesn't offer me any help. Please evaluate this scenario and show me why it can't happen.

• The second law is the definition of temperature and you didn't mention temperature anywhere in your question, so obviously it can't apply. What does apply is simple energy conservation. – CuriousOne Jun 8 '15 at 15:39
• @CuriousOne :P My bad again, I'll edit that. – HyperLuminal Jun 8 '15 at 15:41
• @HyperLuminal : More on capillary-action and perpetual motion. – Qmechanic Jun 8 '15 at 16:05
• @Qmechanic The link leads nowhere? – HyperLuminal Jun 8 '15 at 16:08
• physics.stackexchange.com/q/89223/8851 "How is the water meniscus at the edge of a capillary tube", physics.stackexchange.com/q/88544/8851 "Capillary tube of insufficient length" may be more relevant. It deals not with the case of a hole on the tube, but with a shorter tube, but that's close enough. – b_jonas Jun 8 '15 at 16:56