text:
# American Institute of Mathematical Sciences

September  2010, 26(3): 1101-1117. doi: 10.3934/dcds.2010.26.1101

## Pointwise estimates of solutions for the Euler-Poisson equations with damping in multi-dimensions

 1 Department of Mathematics, Shanghai Jiao Tong University, Shanghai 200240, China 2 Department of Mathematics, Shanghai Jiao Tong University, 800 Dong Chuan Road, 200240, Shanghai

Received  January 2009 Revised  August 2009 Published  December 2009

The global existence and pointwise estimates of the Cauchy problem for the Euler-Poisson equation with damping in multi-dimensions are considered. Based on the analysis of Green function, and using the special structure of the system together with weighted energy method, we obtain the global existence of the classical solution. What's more important, is that we derive a detailed, pointwise description of asymptotic behavior of the solutions of the Cauchy problem. Then we obtain the optimal $L^p(R^n)\ (p>\frac{n}{n-1})$ convergence rate of the solutions.
Citation: Zhigang Wu, Weike Wang. Pointwise estimates of solutions for the Euler-Poisson equations with damping in multi-dimensions. Discrete & Continuous Dynamical Systems - A, 2010, 26 (3) : 1101-1117. doi: 10.3934/dcds.2010.26.1101
 [1] Qiwei Wu, Liping Luan. Large-time behavior of solutions to unipolar Euler-Poisson equations with time-dependent damping. Communications on Pure & Applied Analysis, , () : -. doi: 10.3934/cpaa.2021003 [2] Alberto Bressan, Wen Shen. A posteriori error estimates for self-similar solutions to the Euler equations. Discrete & Continuous Dynamical Systems - A, 2021, 41 (1) : 113-130. doi: 10.3934/dcds.2020168 [3] Yuxi Zheng. Absorption of characteristics by sonic curve of the two-dimensional Euler equations. Discrete & Continuous Dynamical Systems - A, 2009, 23 (1&2) : 605-616. doi: 10.3934/dcds.2009.23.605 [4] Juntao Sun, Tsung-fang Wu. The number of nodal solutions for the Schrödinger–Poisson system under the effect of the weight function. Discrete & Continuous Dynamical Systems - A, 2021  doi: 10.3934/dcds.2021011 [5] Kazunori Matsui. Sharp consistency estimates for a pressure-Poisson problem with Stokes boundary value problems. Discrete & Continuous Dynamical Systems - S, 2021, 14 (3) : 1001-1015. doi: 10.3934/dcdss.2020380 [6] Zhilei Liang, Jiangyu Shuai. Existence of strong solution for the Cauchy problem of fully compressible Navier-Stokes equations in two dimensions. Discrete & Continuous Dynamical Systems - B, 2020  doi: 10.3934/dcdsb.2020348 [7] Bahaaeldin Abdalla, Thabet Abdeljawad. Oscillation criteria for kernel function dependent fractional dynamic equations. Discrete & Continuous Dynamical Systems - S, 2020  doi: 10.3934/dcdss.2020443 [8] Yue-Jun Peng, Shu Wang. Asymptotic expansions in two-fluid compressible Euler-Maxwell equations with small parameters. Discrete & Continuous Dynamical Systems - A, 2009, 23 (1&2) : 415-433. doi: 10.3934/dcds.2009.23.415 [9] Huiying Fan, Tao Ma. Parabolic equations involving Laguerre operators and weighted mixed-norm estimates. Communications on Pure & Applied Analysis, 2020, 19 (12) : 5487-5508. doi: 10.3934/cpaa.2020249 [10] Weisong Dong, Chang Li. Second order estimates for complex Hessian equations on Hermitian manifolds. Discrete & Continuous Dynamical Systems - A, 2020  doi: 10.3934/dcds.2020377 [11] Jian-Xin Guo, Xing-Long Qu. Robust control in green production management. Journal of Industrial & Management Optimization, 2020  doi: 10.3934/jimo.2021011 [12] Md. Masum Murshed, Kouta Futai, Masato Kimura, Hirofumi Notsu. Theoretical and numerical studies for energy estimates of the shallow water equations with a transmission boundary condition. Discrete & Continuous Dynamical Systems - S, 2021, 14 (3) : 1063-1078. doi: 10.3934/dcdss.2020230 [13] Li Cai, Fubao Zhang. The Brezis-Nirenberg type double critical problem for a class of Schrödinger-Poisson equations. Electronic Research Archive, , () : -. doi: 10.3934/era.2020125 [14] Haiyu Liu, Rongmin Zhu, Yuxian Geng. Gorenstein global dimensions relative to balanced pairs. Electronic Research Archive, 2020, 28 (4) : 1563-1571. doi: 10.3934/era.2020082 [15] Yifan Chen, Thomas Y. Hou. Function approximation via the subsampled Poincaré inequality. Discrete & Continuous Dynamical Systems - A, 2021, 41 (1) : 169-199. doi: 10.3934/dcds.2020296 [16] Shuai Huang, Zhi-Ping Fan, Xiaohuan Wang. Optimal financing and operational decisions of capital-constrained manufacturer under green credit and subsidy. Journal of Industrial & Management Optimization, 2021, 17 (1) : 261-277. doi: 10.3934/jimo.2019110 [17] Linglong Du, Min Yang. Pointwise long time behavior for the mixed damped nonlinear wave equation in $\mathbb{R}^n_+$. Networks & Heterogeneous Media, 2020  doi: 10.3934/nhm.2020033 [18] Klemens Fellner, Jeff Morgan, Bao Quoc Tang. Uniform-in-time bounds for quadratic reaction-diffusion systems with mass dissipation in higher dimensions. Discrete & Continuous Dynamical Systems - S, 2021, 14 (2) : 635-651. doi: 10.3934/dcdss.2020334 [19] Mingchao Zhao, You-Wei Wen, Michael Ng, Hongwei Li. A nonlocal low rank model for poisson noise removal. Inverse Problems & Imaging, , () : -. doi: 10.3934/ipi.2021003 [20] Hai-Liang Li, Tong Yang, Mingying Zhong. Diffusion limit of the Vlasov-Poisson-Boltzmann system. Kinetic & Related Models, , () : -. doi: 10.3934/krm.2021003

2019 Impact Factor: 1.338


text:
Equation Mode / LaTeX support bo198214 Administrator Posts: 1,616 Threads: 102 Joined: Aug 2007 08/07/2007, 02:23 PM (This post was last modified: 06/20/2010, 07:29 AM by bo198214.) Dear users, this forum is LaTeX enabled, a major advancement for writing formulas than discussing everything in ASCII as is necessary in newsgroups. You can put formulas into your postings as in the following example: Code:$$x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$$ yields $x=\frac{-b\pm\sqrt{b^2-4ac}}{2a}$ For a list of the LaTeX possibilities, see the mimetex tutorial. Note however that mimetex does not support all LaTeX commands. edgar Newbie Posts: 1 Threads: 0 Joined: Aug 2007 08/09/2007, 01:06 PM Unlike some other forum I remember, you even see your TeX in the preview. $\int_0^\infty e^{-x^2}\,dx$ So you can fix your mistakes before actually posting it. G. Edgar Ohio State Univ MphLee Long Time Fellow Posts: 367 Threads: 28 Joined: May 2013 05/26/2013, 05:36 PM There is a way to use the mathfrak style in the forum? for example here I write "\mathscr S=\mathfrak S" and the result is the same $\mathscr S=\mathfrak S$ MSE MphLee Mother Law $$(\sigma+1)0=\sigma (\sigma+1)$$ S Law $$\bigcirc_f^{\lambda}\square_f^{\lambda^+}(g)=\square_g^{\lambda}\bigcirc_g^{\lambda^+}(f)$$ tommy1729 Ultimate Fellow Posts: 1,739 Threads: 382 Joined: Feb 2009 01/19/2021, 12:05 AM Tex sometimes gives problems. those are often related to added spaces ( pressing space or enter ) within or around the tex message. On smartphones this issue rarely occurs but on laptops and desktops this can make the tex invisible or added "??". Well my experience lately. So I thought I should share it. regards tommy1729 JmsNxn Ultimate Fellow Posts: 1,056 Threads: 121 Joined: Dec 2010 01/19/2021, 03:27 AM (01/19/2021, 12:05 AM)tommy1729 Wrote: Tex sometimes gives problems. those are often related to added spaces ( pressing space or enter ) within or around the tex message. On smartphones this issue rarely occurs but on laptops and desktops this can make the tex invisible or added "??". Well my experience lately. So I thought I should share it. regards tommy1729 It's always been that way tommy, you have to fine tune your latex to this forum, lol. I secretly wish this forum was coded using MathJax. « Next Oldest | Next Newest »

 Possibly Related Threads… Thread Author Replies Views Last Post Displaying LaTeX used on Forum Daniel 2 628 07/12/2022, 12:33 PM Last Post: Daniel \Ueta Should be Added to This Forum's LaTeX. Catullus 3 1,071 06/30/2022, 10:05 PM Last Post: MphLee Browsers supporting Latex Daniel 7 1,090 06/30/2022, 05:48 AM Last Post: JmsNxn Night Mode Catullus 0 426 06/16/2022, 03:33 AM Last Post: Catullus Stop using Mimetex and replace it with a more modern Latex solution Ember Edison 11 4,822 01/07/2022, 01:37 PM Last Post: Gottfried

Users browsing this thread: 1 Guest(s)

format: plain


text:
hi, my question is: the equation of a curve is $y = (x - 8)(x - 2)$ find the gradient of the curve
a) at the point where the curve crosses the y-axis,
b) at each of the points where the curve crosses the x-axis

for a) i expanded the brackets then differentiated:

$x^2 - 2x - 8x + 16 \implies x^2 - 10x + 16 \implies \frac{dy}{dx} = 2x - 10$ since x is zero on the y-axis the answer must be -10 and my book confirms this.

for b) i just made it $2x - 10 = 0 \implies 2x = 10 \implies x = 5$ but i don't think this is going in the right direction as the answer the book gives is "6 and -6"

could someone show me how its done please?

thanks, mark

2. Originally Posted by mark
hi, my question is: the equation of a curve is $y = (x - 8)(x - 2)$ find the gradient of the curve
a) at the point where the curve crosses the y-axis,
b) at each of the points where the curve crosses the x-axis

for a) i expanded the brackets then differentiated:

$x^2 - 2x - 8x + 16 \implies x^2 - 10x + 16 \implies \frac{dy}{dx} = 2x - 10$ since x is zero on the y-axis the answer must be -10 and my book confirms this.

for b) i just made it $2x - 10 = 0 \implies 2x = 10 \implies x = 5$ but i don't think this is going in the right direction as the answer the book gives is "6 and -6"

could someone show me how its done please?

thanks, mark
HI

y=(x-8)(x-2)

The curve cuts the x-axis at x=8 and x=2

So substitute 8 and 2 respectively into the equation of gradient u got .


text:
# A conjecture about the entropy of matrix vector products

Consider a random $m$ by $n$ partial circulant matrix $M$ whose entries are chosen independently and uniformly from $\{0,1\}$ and let $m < n$. Now consider a random $n$ dimensional vector $v$ whose entries are also chosen independently and uniformly from $\{0,1\}$. Let $N = Mv$ where multiplication is performed over the reals.

The matrices $M$ and $N$ are discrete random variables. Recall that the Shannon entropy for a discrete random variable $Z$ is $H(Z) = -\sum_z P(Z=z)\log_2{P(Z=z)}$. In the case where $P(Z=z)=0$ for some values $z$, the corresponding term in the sum is taken to be $0$.

We therefore know that the (base $2$) Shannon entropy $H(M) = H(v) = n$. The fact that $H(M) = n$ is a direct result of the fact that the entire matrix is defined by its first row.

If $m = \lfloor 10n/\ln{n} \rfloor$ then I would like to make the following conjecture.

Conjecture: For all sufficiently large $n$, $H(N) \geq n/10$.

The value $10$ is chosen somewhat arbitrarily to be a sufficiently large constant.

Is this a known problem and/or can anyone see a way to approach it? Is it in fact true?

• Do you insist that $M$ has the first $m$ rows of the circulant matrix, or are you fine with $M$ having random $m$ rows of the full matrix? – Mert Sağlam Apr 19 '16 at 19:48
• @MertSaglam It should be the first $m$ rows of a full matrix. – Anush Apr 20 '16 at 7:58
• Just in case this question is coming from another source, I realized talking with a colleague today that this precise question also appears in streaming algorithms literature. If so, I can point to the paper conjecturing this when it becomes available. – Mert Sağlam Apr 22 '16 at 22:21

This is not an answer, just a long comment.

As pointed out by John Mangual, this game is similar to Mastermind. In fact, it is even more similar to the game defined by Erdos and Renyi here: http://www.renyi.hu/~p_erdos/1963-12.pdf. In your language their game is the following: We are given the first row of the matrix $M$, denoted by $M'$, (so $m=1$) but what we multiply it with, $X$, is not a vector, but an $n\times a$ matrix. Our goal is to reconstruct $M$ from $N=M'X$. They show that this can be done whp if $X$ is a random matrix and $a\ge 10n/\log n$. Of course if $M$ can be reconstructed whp, that also implies that $H(N)\ge (1-\epsilon)n$.

So one possible way to answer your question would be to show that their theorem holds even in the case when $X$ is a circulant matrix, as this is equivalent to $X$ being a vector and $M$ being circulant.

new part

So suppose we want to compute the probability that for two different random vectors, denoted by $v$ and $u$, multiplying them with the rotations of a random vector $r$ we get the same values, i.e., if the rotations of $r$ are denote by $r_1,\ldots,r_k$, then what is the chance that for all $i$ we have $vr_i=ur_i$. For any $i$, this is like a random walk, as $v$ and $u$ are also random, so $Pr[vr_i=ur_i]\approx 1/\sqrt n$. Now I claim that this statement is true even in the following conditional form if $k$ is small enough: $Pr[vr_i=ur_i\mid \forall j\ne i: vr_j=ur_j]\approx 1/\sqrt n.$

I don't think this is that hard to prove, but I cannot see a solution now.

• A very nice observation but do you have any ideas for how to try to show their theorem holds when $X$ is circulant? This seems highly un-obvious, at least to me. – felix Jul 30 '14 at 16:12
• @felix: No, at least until now. – domotorp Jul 30 '14 at 17:42
• Your "new part" looks like the core of the problem but I have to admit, looks no easier to me. It will be great if you (or anyone) has any ideas about this new formulation. – Anush Aug 3 '14 at 20:29
• Do you think it would be acceptable to pose your formulation as a new question? I have no ideas for how to approach it. – Anush Aug 26 '14 at 14:53
• @domotorp Looks like it wasn't so simple after all! – felix Sep 17 '14 at 20:47

This reminds me a bit of the game of mastermind.

Since your matrix is circulant, this entire matrix is determined by the first row ${\bf m}$, the vector $X$ and the shift map taking $T:(m_1, \dots, m_n) \mapsto (m_2, \dots, m_n, m_1)$

You are given $m$ numbers (please excuse the notation clash): $T^i({\bf m})\cdot {\bf X}$ for $i = 1, \dots, m$ so there are at most $m \log n$ bits of information.

The bound $\log n \cdot \tfrac{10n}{\log n} \geq H(N) \geq \tfrac{n}{10}$ is consistent with your problem, at least.

• There is a trivial upper bound of $H(N) \leq 2n$. – felix Jul 28 '14 at 17:47

One approach is computer exploration: write a program to plot a few points, and plot of the functions you want to compare to on the same graphics.

I wrote a quick Sage program to compute and plot the entropy H(Z(n,m)) for all 0 <= m <= n <= 10, and I added the plots of (x=t, y=t, z=t) and (x=t, y=sqrt(t), z=t/10). You can add a plot for (x=t, y=t/ln(t), z=t/10), and/or modify the others to find something closer to the graph.

For n > 10 plotting points from exhaustive computations becomes very slow...

Massive speedups are certainly possible with a better program and/or using Cython or a faster programming language, but in any case the number of cases grows so fast that more efficient code will only get you so far.

The next trick is to replace exhaustive enumeration by random sampling, which might give you a rough idea of the graph in a larger range.

Of course, besides this exploration, a clever way to estimate H(Z(n,m)), in general or along a curve (n, m(n)), would better answer your question, but failing that, pictures are always nice.

In case it's any interest, Here is the Sage code I wrote.

from collections import defaultdict

def h(d):
sn = 0r
sl = 0r
for n in d.itervalues():
if n:
nn = RDF(n)
sl += nn * nn.log2()
sn += nn
if sn:
return sn.log2() - sl/sn
return RDF.one()

def hh(n):
xn = xrange(n)
xnn = xrange(n+1)
cp = CartesianProduct(*((0r,1r),)*n)
dd = [defaultdict(int) for _ in xnn]
for y in cp:
for x in cp:
z = tuple(sum(x[(i+k)%n]*y[i] for i in xn) for k in xn)
for m in xnn:
dd[m][z[:m]] += 1r
return [h(d) for d in dd]

hhh = []
nmax = 10
for k in xrange(nmax):
hhh.append(hh(k))

ph = []
for n,hh in enumerate(hhh):
for m, h in enumerate(hh):
ph.append((n,m,h))

fx = lambda x: x
fy = lambda x: sqrt(x)
fz = lambda x: x/10

gx = lambda x: x
gy = lambda x: x
gz = lambda x: x

Gf = parametric_plot3d((fx,fy,fz),(0,n),color='red')
Gg = parametric_plot3d((gx,gy,gz),(0,n),color='red')
Gh = point3d(ph,size=3)
G = Gf + Gg + Gh
G.show(viewer='tachyon')
G.show()


text:
# 4.4E:

## Area and Arc Length in Polar Coordinates

### Exercise $$\PageIndex{1}$$

For the following exercises, determine a definite integral that represents the area.

1) Region enclosed by $$\displaystyle r=4$$

2) Region enclosed by $$\displaystyle r=3sinθ$$

3) Region in the first quadrant within the cardioid $$\displaystyle r=1+sinθ$$

4) Region enclosed by one petal of $$\displaystyle r=8sin(2θ)$$

5) Region enclosed by one petal of $$\displaystyle r=cos(3θ)$$

6) Region below the polar axis and enclosed by $$\displaystyle r=1−sinθ$$

7) Region in the first quadrant enclosed by $$\displaystyle r=2−cosθ$$

8) Region enclosed by the inner loop of $$\displaystyle r=2−3sinθ$$

9) Region enclosed by the inner loop of $$\displaystyle r=3−4cosθ$$

10) Region enclosed by $$\displaystyle r=1−2cosθ$$ and outside the inner loop

11) Region common to $$\displaystyle r=3sinθ$$ and $$\displaystyle r=2−sinθ$$

12) Region common to $$\displaystyle r=2$$ and $$\displaystyle r=4cosθ$$

13) Region common to $$\displaystyle r=3cosθ$$ and $$\displaystyle r=3sinθ$$

Solution 2: $$\displaystyle \frac{9}{2}∫^π_0sin^2θdθ$$,

Solution 4: $$\displaystyle \frac{3}{2}∫^{π/2}_0sin^2(2θ)dθ$$,

Solution 6: $$\displaystyle \frac{1}{2}∫^{2π}_π(1−sinθ)^2dθ$$,

Solution 8: $$\displaystyle ∫^{π/2}_{sin^{−1}(2/3)}(2−3sinθ)^2dθ$$,

Solution 10: $$\displaystyle ∫^π_0(1−2cosθ)^2dθ−∫^{π/3}_0(1−2cosθ)^2dθ$$,

Solution 12: $$\displaystyle 4∫^{π/3}_0dθ+16∫^{π/2}_{π/3}(cos^2θ)dθ$$

### Exercise $$\PageIndex{2}$$

For the following exercises, find the area of the described region.

14) Enclosed by $$\displaystyle r=6sinθ$$

15) Above the polar axis enclosed by $$\displaystyle r=2+sinθ$$

16) Below the polar axis and enclosed by $$\displaystyle r=2−cosθ$$

17) Enclosed by one petal of $$\displaystyle r=4cos(3θ)$$

18) Enclosed by one petal of $$\displaystyle r=3cos(2θ)$$

19) Enclosed by $$\displaystyle r=1+sinθ$$

20) Enclosed by the inner loop of $$\displaystyle r=3+6cosθ$$

21) Enclosed by $$\displaystyle r=2+4cosθ$$ and outside the inner loop

22) Common interior of $$\displaystyle r=4sin(2θ)$$ and $$\displaystyle r=2$$

23) Common interior of $$\displaystyle r=3−2sinθ$$ and $$\displaystyle r=−3+2sinθ$$

24) Common interior of $$\displaystyle r=6sinθ$$ and $$\displaystyle r=3$$

25) Inside $$\displaystyle r=1+cosθ$$ and outside $$\displaystyle r=cosθ$$

26) Common interior of $$\displaystyle r=2+2cosθ$$ and $$\displaystyle r=2sinθ$$

Solution 14: $$\displaystyle 9π$$,

Solution 16: $$\displaystyle \frac{9π}{4}$$,

Solution 18: $$\displaystyle \frac{9π}{8}$$,

Solution 20: $$\displaystyle \frac{18π−27\sqrt{3}}{2}$$,

Solution 22: $$\displaystyle \frac{4}{3}(4π−3\sqrt{3})$$,

Solution 24: $$\displaystyle 32(4π−33√), Solution 26: \(\displaystyle 2π−4$$

### Exercise $$\PageIndex{3}$$

For the following exercises, find a definite integral that represents the arc length.

27) $$\displaystyle r=4cosθ$$ on the interval $$\displaystyle 0≤θ≤\frac{π}{2}$$

28) $$\displaystyle r=1+sinθ$$ on the interval $$\displaystyle 0≤θ≤2π$$

29) $$\displaystyle r=2secθ$$ on the interval $$\displaystyle 0≤θ≤\frac{π}{3}$$

30) $$\displaystyle r=e^θ$$ on the interval $$\displaystyle 0≤θ≤1$$

Solution 28: $$\displaystyle ∫^{2π}_0\sqrt{(1+sinθ)^2+cos^2θ}dθ$$,

Solution 30: $$\displaystyle \sqrt{2}∫^1_0e^θdθ$$

### Exercise $$\PageIndex{4}$$

For the following exercises, find the length of the curve over the given interval.

31) $$\displaystyle r=6$$ on the interval $$\displaystyle 0≤θ≤\frac{π}{2}$$

32) $$\displaystyle r=e^{3θ}$$ on the interval $$\displaystyle 0≤θ≤2$$

33) $$\displaystyle r=6cosθ$$ on the interval $$\displaystyle 0≤θ≤\frac{π}{2}$$

34) $$\displaystyle r=8+8cosθ$$ on the interval $$\displaystyle 0≤θ≤π$$

35) $$\displaystyle r=1−sinθ$$ on the interval $$\displaystyle 0≤θ≤2π$$

Solution 32: $$\displaystyle \frac{\sqrt{10}}{3}(e^6−1)$$,

Solution 34: 32

### Exercise $$\PageIndex{5}$$

For the following exercises, use the integration capabilities of a calculator to approximate the length of the curve.

36) [T] $$\displaystyle r=3θ$$ on the interval $$\displaystyle 0≤θ≤\frac{π}{2}$$

37) [T] $$\displaystyle r=\frac{2}{θ}$$ on the interval $$\displaystyle π≤θ≤2π$$

38) [T] $$\displaystyle r=sin^2(\frac{θ}{2})$$ on the interval $$\displaystyle 0≤θ≤π$$

39) [T] $$\displaystyle r=2θ^2$$ on the interval $$\displaystyle 0≤θ≤π$$

40) [T] $$\displaystyle r=sin(3cosθ)$$ on the interval $$\displaystyle 0≤θ≤π$$

Solution 36: 6.238, Solution 38: 2, Solution 40: 4.39

### Exercise $$\PageIndex{6}$$

For the following exercises, use the familiar formula from geometry to find the area of the region described and then confirm by using the definite integral.

41) $$\displaystyle r=3sinθ$$ on the interval $$\displaystyle 0≤θ≤π$$

42) $$\displaystyle r=sinθ+cosθ$$ on the interval $$\displaystyle 0≤θ≤π$$

43) $$\displaystyle r=6sinθ+8cosθ$$ on the interval $$\displaystyle 0≤θ≤π$$

Solution 42: $$\displaystyle A=π(\frac{\sqrt{2}}{2})^2=\frac{π}{2}$$ and $$\displaystyle \frac{1}{2}∫^π_0(1+2sinθcosθ)dθ=\frac{π}{2}$$

### Exercise $$\PageIndex{7}$$

For the following exercises, use the familiar formula from geometry to find the length of the curve and then confirm using the definite integral.

44) $$\displaystyle r=3sinθ$$ on the interval $$\displaystyle 0≤θ≤π$$

45) $$\displaystyle r=sinθ+cosθ$$ on the interval $$\displaystyle 0≤θ≤π$$

46) $$\displaystyle r=6sinθ+8cosθ$$ on the interval $$\displaystyle 0≤θ≤π$$

47) Verify that if $$\displaystyle y=rsinθ=f(θ)sinθ$$ then $$\displaystyle \frac{dy}{dθ}=f'(θ)sinθ+f(θ)cosθ.$$

Solution 44: $$\displaystyle C=2π(\frac{3}{2})=3π$$ and $$\displaystyle ∫^π_03dθ=3π$$, Solution 46: $$\displaystyle C=2π(5)=10π$$ and $$\displaystyle ∫^π_010dθ=10π$$

### Exercise $$\PageIndex{8}$$

For the following exercises, find the slope of a tangent line to a polar curve $$\displaystyle r=f(θ)$$. Let $$\displaystyle x=rcosθ=f(θ)cosθ$$ and $$\displaystyle y=rsinθ=f(θ)sinθ$$, so the polar equation $$\displaystyle r=f(θ)$$ is now written in parametric form.

48) Use the definition of the derivative $$\displaystyle dydx=\frac{dy/dθ}{dx/dθ}$$ and the product rule to derive the derivative of a polar equation.

49) $$\displaystyle r=1−sinθ; (\frac{1}{2},\frac{π}{6})$$

50) $$\displaystyle r=4cosθ; (2,\frac{π}{3})$$

51) $$\displaystyle r=8sinθ; (4,\frac{5π}{6})$$

52) $$\displaystyle r=4+sinθ; (3,\frac{3π}{2})$$

53) $$\displaystyle r=6+3cosθ; (3,π)$$

54) $$\displaystyle r=4cos(2θ);$$ tips of the leaves

55) $$\displaystyle r=2sin(3θ);$$ tips of the leaves

56) $$\displaystyle r=2θ; (\frac{π}{2},\frac{π}{4})$$

57) Find the points on the interval $$\displaystyle −π≤θ≤π$$ at which the cardioid $$\displaystyle r=1−cosθ$$ has a vertical or horizontal tangent line.

58) For the cardioid $$\displaystyle r=1+sinθ,$$ find the slope of the tangent line when $$\displaystyle θ=\frac{π}{3}$$.

Solution 48: $$\displaystyle \frac{dy}{dx}=\frac{f′(θ)sinθ+f(θ)cosθ}{f′(θ)cosθ−f(θ)sinθ}$$,

Solution 50: The slope is $$\displaystyle \frac{1}{\sqrt{3}}$$,

Solution 52: The slope is 0,

Solution 54: At $$\displaystyle (4,0),$$ the slope is undefined. At $$\displaystyle (−4,\frac{π}{2})$$, the slope is 0,

Solution 56: The slope is undefined at $$\displaystyle θ=\frac{π}{4}$$,

Solution: Slope = −1.

### Exercise $$\PageIndex{9}$$

For the following exercises, find the slope of the tangent line to the given polar curve at the point given by the value of $$\displaystyle θ$$.

59) $$\displaystyle r=3cosθ,θ=\frac{π}{3}$$

60) $$\displaystyle r=θ, θ=\frac{π}{2}$$

61) $$\displaystyle r=lnθ, θ=e$$

62) [T] Use technology: $$\displaystyle r=2+4cosθ$$ at $$\displaystyle θ=\frac{π}{6}$$

Soltuion 60: Slope is $$\displaystyle \frac{−2}{π}$$, Solution 62: Calculator answer: −0.836.

### Exercise $$\PageIndex{10}$$

For the following exercises, find the points at which the following polar curves have a horizontal or vertical tangent line.

63) $$\displaystyle r=4cosθ$$

64) $$\displaystyle r^2=4cos(2θ)$$

65) $$\displaystyle r=2sin(2θ)$$

66) The cardioid $$\displaystyle r=1+sinθ$$

67) Show that the curve $$\displaystyle r=sinθtanθ$$ (called a cissoid of Diocles) has the line $$\displaystyle x=1$$ as a vertical asymptote.

Solution 64: Horizontal tangent at $$\displaystyle (±\sqrt{2},\frac{π}{6}), (±\sqrt{2},−\frac{π}{6})$$,
Solution 66: Horizontal tangents at $$\displaystyle \frac{π}{2},\frac{7π}{6},\frac{11π}{6}.$$ Vertical tangents at $$\displaystyle \frac{π}{6},\frac{5π}{6}$$ and also at the pole $$\displaystyle (0,0)$$.


text:
# File editing program

I have written a Java class to replace text in file. The file contains database configurations and is as follows:

test.properties

#local
db.url=jdbc:oracle:thin:@localhost:test

#db.user=testa

db.user=testb

#db.user=testc

# is a comment character. Now db schema testb is in use.

Here is my Java class to switch between schemas

import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;

public class SwitchTo
{
public static void main(String[] args)
{
Map<String, String> schemaMap = new HashMap<String, String>();
schemaMap.put("a", "testa");
schemaMap.put("b", "testb");
schemaMap.put("c", "testc");

String newText = "";
for (int i = 0; i < args.length; i++)
{
newText = args[i];
}

String newdb = "";
newdb = schemaMap.get(newText);
if (newdb == null || (newdb != null && newdb.length() <= 0))
{
System.out.println("Schema not available, please select : ");
for (Map.Entry<String, String> entry : schemaMap.entrySet())
{
System.out.println(entry.getKey() + " for " + entry.getValue());
}
return;
}

try
{
String total = "";
String line = "";
while ((line = file.readLine()) != null)
{
if (!line.startsWith("#") && line.contains("db.user"))
{
line = "#" + line;
}

{
line = "#" + line;
}

if (line.startsWith("#") && line.contains(newdb))
{
line = line.substring(1);
}

total = total + line + "\n";
}

FileOutputStream File = new FileOutputStream("test.properties");
File.write(total.getBytes());
System.out.println("Switched to schema " + schemaMap.get(newText));
}
catch (FileNotFoundException e)
{
e.printStackTrace();
}
catch (IOException e)
{
e.printStackTrace();
}
}
}

and I have created a batch file to run this program from command line which is as follows :

switch.bat
java SwitchTo %1

Now when write at command line

c:\> switch a

Then it will comment testb in the file and testa will be uncommented.

Please suggest other improvement for this code.

1. Is using map for storing schemas is a good choice?
2. How can I make it generic to accommodate newly added schemas without need to compile this class again?
3. Is there any better algorithm for solving this?
-
Rather than editing a file programmatically, consider keeping several configuration files, and copying the appropriate one into place to activate it. It's much simpler that way! –  200_success Apr 25 '14 at 7:08

Actually, this can be more generic.

So change your prop file to :

#db.id=a
#db.user=testa

db.id=b
db.user=testb

Fill your map like this :

private Map<String, String> schemaMap = new HashMap<String, String>();

public void fillMap() throws FileNotFoundException, IOException {
String line;
String key = null;
String value = null;
while ((line = file.readLine()) != null) {

if (line.contains("db.id")) {
key = line.substring(line.indexOf('='));// could be you have to do an + 1
}
if (line.contains("db.user")) {
value = line.substring(line.indexOf('='));
}
if (key!=null && value != null) {
schemaMap.put(key, value);
key = null;
value = null;
}
}
} catch (IOException ex) {
// report with Logger or System.out what happend.
}
}

Secondly : In your main you use the args.
You do not check for how many args you have, you just take the last arg.
Maybe a check for how many args you have is appropriate here, and make the program do what you want then. (like quitting with error message or taking default arg).

Here it is done with a Try-with-resources available from java 7, otherwise you will need a finally block where you close it in.

-

Naming
You should give your classes and variable meaningful names.

Class names should not be verbs, but rather nouns - SwitchTo also doesn't really convey what the class does - DatabaseConfigurationSwitcher will do a better job.

Variable names like file, total and newText might be technically accurate, but they don't help the reader know what they mean - currentPropertiesFileContents, newPropertiesFileContents and selectedUser would better convey meaning, and will make your code a lot easier to read.

You should always abide by the naming conventions of you language of choice - camelCase for java variables - newdb is a bad variable name. File is worse.

There is no need to repeat the type of the container in its name: schemas is better than schemaMap.

Redundant code
You found a very curious way to assign the newText variable - you are actually assigning it <num of args> + 1 times! There is no need to assign it with "", and definitely no need to override it arg.length times a simple:

String newText = args[args.length - 1];

would do. The only reason I can think of which might have driven you to this strange code is your fear that args will be empty, in which case you can add:

String newText = (args == null || args.length == 0) ? "" : args[args.length - 1];

Of course, as @chillworld suggested, both are wrong, as you should check that there is exactly one argument so:

if (args.length != 1) throw new Exception("Give only one argument");
String newText = args[0];

Assumptions
For some reason, you assume that the username and password are always equal, and known at compile time. If that is the case, you could have made you life easier and instead of commenting and un-commenting lines in your code you could simply re-write the section, since you know its values:

test.properties

#local
db.url=jdbc:oracle:thin:@localhost:test

#### overwrite everything below this line with db.user=user;db.password=user ####
db.user=testa

Of course, a better solution would be not to assume that you know either the username or the password at compile time, and use an external repository to hold this information (even the properties file itself could be it, as @chillworld suggested).

String concatenation
Using a String variable to collect all the lines in your code is not a good idea, as it results in a lot of new objects being built. A StringBuilder is a better type to do that, but in your situation.

You open a file reader, and then a file writer, but you never close them! This is very problematic, since you leave open file handles which may result in a serious memory leak. It is true that java will close all open handles when the process exits, but you should never count on that!

Don't catch what you can't handle
You have a try block, and two catch clauses, which do nothing but output the exception to the console.
A better way would be to declare main(String[] args) throws FileNotFoundException, IOException, and not even write the try block.
This way, in case of an error, not only will its stack trace be printed in the console (via the error stream), but the console will also be notifies that the command ended abnormally, and the command users will be able to refer to that (looking at the errorlevel).

-

#local
db.url=jdbc:oracle:thin:@localhost:test

#begin_schema: a
#db.user=testa
#end_schema

#other unchangeable properties
some.property.a=value1
some.property.b=value2

#begin_schema: b
db.user=testb
#end_schema

so, the comments #begin_schema/#end_schema will demarcates the boundary of blocks for facilitation of parse and process.

here is my solution:

import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class SchemaSwitcher {

static final Pattern BEGIN_PATTERN = Pattern.compile("^#*\\s*begin_schema:\\s*(.+)\\s*$"); static final Pattern END_PATTERN = Pattern.compile("^#*\\s*end_schema.*$");

static enum State {NO_OP, ADD_COMMENT, REM_COMMENT}

public static void main(String[] args) throws Exception {
String fileName = args[0];
String schema = args[1];
Path path = Paths.get(fileName);
}

static List<String> switchSchema(List<String> lines, String schema) {
State state = State.NO_OP;
for (int i = 0; i < lines.size(); i++) {
String line = lines.get(i);
switch (state) {
case NO_OP:
Matcher matcher = BEGIN_PATTERN.matcher(line);
if (matcher.matches()) {
state = schema.equals(matcher.group(1)) ? State.REM_COMMENT : State.ADD_COMMENT;
}
break;
if (END_PATTERN.matcher(line).matches()) {
state = State.NO_OP;
} else {
if (!line.startsWith("#")) line = "#" + line;
}
break;
case REM_COMMENT:
if (END_PATTERN.matcher(line).matches()) {
state = State.NO_OP;
} else {
while (line.startsWith("#")) line = line.substring(1);
}
break;
}
lines.set(i, line);
}
return lines;
}
}

-
Adding a #begin section and #end section are a bit overkill for 2 properties, that are "always correctly formatted". If it were a more complex config-file, I'd really love your suggestions. btw. #end section is unneccesary, if you assume, that a section cannot contain subsections... Still +1 –  Vogel612 Apr 25 '14 at 15:24
closing tag (end_schema) allows to have unchangable block between two shcemas. if you think that this is redundant, it's very easy to change the code to consider the closing tag as optional –  twester Apr 25 '14 at 20:07

use java.nio instead of java.io

private Map<String, String> schemaMap = new HashMap<>();

public void fillMap() throws IOException {

String key = null;
String value = null;

Path path = Paths.get("test.properties");
try {

for (String line : lines) {

if (line.contains("db.id")) {
key = line.substring(line.indexOf('='));// could be you have to do an + 1
}

if (line.contains("db.user")) {
value = line.substring(line.indexOf('='));
}

if (key != null && value != null) {
schemaMap.put(key, value);
key = null;
value = null;
}
}
} catch (IOException e) {
// report with Logger or System.out what happend.
}
}

-


text:
# Directory write permissions check

Consider the following method that I have for checking write permissions on a directory path:

/// <summary>
/// Check existence and write permissions of supplied directory.
/// </summary>
/// <param name="directory">The directory to check.</param>
protected static void CheckPermissions(string directory)
{
if (!Directory.Exists(directory))
{
throw new DirectoryNotFoundException(String.Format(JobItemsStrings.Job_DirectoryNotFound, directory));
}

// Check permissions exist to write to the directory.
// Will throw a System.Security.SecurityException if the demand fails.
FileIOPermission ioPermission = new FileIOPermission(FileIOPermissionAccess.Write, directory);
ioPermission.Demand();
}

When running FxCop, this code throws up a "CA2103 - Review imperative security" warning, albeit with a certainty of 25%, with this info:

"Use of imperative demands can lead to unforeseen security problems. The values used to construct a permission should not change within the scope of the demand call. For some components the scope spans from the demand call to end of the method; for others it spans from the demand call until the component is finalized. If the values used to construct the permission are fields or properties, they can be changed within the scope of the demand call. This can lead to race conditions, mutable read-only arrays, and problems with boxed value types."

Bascially, is FxCop being over-cautious, or am I doing it wrong?

• This is probably a question better suited for StackOverflow based on the FAQs guidelines for what is an applicable question. – Mark Loeser Jan 29 '11 at 17:28
• @Mark: Hmm, well the FAQ says "If you are looking for specific feedback about… Code correctness, ..., Security issues in a code snippet, etc … then you are in the right place!" I figured my question was a pretty good fit for that. But, if it is felt that it better suited for SO, then fair enough. :) – Andy Jan 29 '11 at 17:45

This FxCop warning is basically asking you to make sure ("Review") that that non-constant you are passing (directory) to the security permission does not change while the permission is in effect. Basically, FxCop isn't sure if it is possible for the code (or some rogue module that a hacker has put in place) to do something like the following:

1. Set directory to "c:\Temp\"
2. .Demand()
3. <untrusted>Set directory to "c:\Windows\System32\"</untrusted>
4. Write something into a file contained in directory.

In this particular case, since directory is a non-ref parameter, it is not possible for another module outside your call-descendants to modify it. Thus, what you need to check for:

• Anything in this method assigning a value to directory
• Anything in this method that passes directory by reference (ref/out/unsafe pointers)

Disclaimer: I am not a code security expert and have no formal training as such. I may have missed entire classes of things to look for here. If you are dealing with code that has real-world security implications, I highly suggest you hire a consultant who does, rather than take what I wrote above as gospel.

• Thanks, you have clarified what I thought. This does not have Earth-shattering implications - I just want to gracefully handle any circumstance where the permissions don't allow writing by popping a MessageBox. – Andy Jan 30 '11 at 13:47

When working with files, checking before an operation can be useful, but you still always need to handle relevant exceptions (e.g. FileNotFoundException, IOException).

The permissions (or existence) of a file/directory may change between the time you check and time the operation is invoked (new FileIOPermission(...) in this case). This situation is more common than it seems.


text:
I might be scrapping my motor and going back to the drawing board. Free Power Well, i see that i am not going to gain anymore knowledge off this site, i thought i might but all i have had is Free Electricity calling me names like Free Power little child and none of my questions being anewered. Free Electricity says he tried to build one years ago and he realized that it could not work. Ok tell me why. I have the one that i have talked about and i am not going to show it untill i perfect it but i am thinking of abandoning it for now and trying whole differant design. Can the expert Free Electricity answer shis? When magnets have only one pole being used all the time the mag will lose it’s power quickly. What will happen if you use both poles in the repel state? Free Electricity that ballance the mag out or drain it twice as fast? How long will Free Power mag last running in the repel state all the time? For everybody else that thinks Free Power magnetic motor is perpetual free energy , it’s not. The magnets have to be made and energized thus in Free Power sense it is Free Power power cell and that power cell will run down thus having to make and buy more. Not free energy. This is still fun to play with though.

##### This is EXACTLY spot on. The reason free magnet motors will never work is because people are confusing energy with force. Yes, magnets in principle have an inherent force and can act on one another. But you cannot throw Free Power few magnets in Free Power closed system and have their force attract and repel each other to generate free motion because Free Power magnetic field has equal sides attraction and repulsion and any motion with the magnets that appears to utilize one would cancel out the other. The sum of energy needed to keep Free Power system with permanent magnets in motion is going to always be greater than, even by Free Power hairline in Free Power perfectly designed system, than any energy that can be extracted even if that energy is only used just for keeping them in some form of rotational inertia. @Free Energy Lets do this Free Energy.

Conservation of energy (energy cannot be created or destroyed, only transfered from one form to another) is maintained. Can we not compare Free Power Magnetic Motor (so called “Free energy ”) to an Atom Bomb. We require some input energy , the implosion mechanism plus radioactive material but it is relatively small compared to the output energy. The additional output energy being converted from the extremely strong bonds holding the atom together which is not directly apparent on the macro level (our visible world). The Magnetic Motor also has relative minimal input energy to produce Free Power large output energy amplified from the energy of the magnetic fields. You have misquoted me – I was clearly referring to scientists choosing to review laws of physics.

## Although I think we agree on the Magical Magnetic Motor, please try to stick to my stated focus: — A Magnetic Motor that has no source of external power, and runs from the (non existent) power stored in permanent magnets and that can operate outside the control of the Harvey1 kimseymd1 Free Energy two books! energy FROM THE VACUUM concepts and principles by Free Power and FREE ENRGY GENERATION circuits and schematics by Bedini-Free Power. Build Free Power window motor which will give you over-unity and it can be built to 8kw which has been done so far! NOTHING IS IMPOSSIBLE! Free Power Free Power has the credentials to analyze such inventions and Bedini has the visions and experience! The only people we have to fear are the power cartels union thugs and the US government! @Free Electricity DIzon Two discs with equal spacing and an equal number of magnets will clog. Free Electricity place two magnets on your discs and try it. Obviously you haven’t. That’s simple understanding. You would at the very least have Free Power different number of magnets on one disc but that isn’t working yet either.

How do you gather and retrain the RA? Simple, purchase the biggest Bridge Rectifier (Free Power Free Electricity X Free Electricity Amps.) Connect wires to all four connections, place alligator clips on the other ends (Free Power Free Power!) Connect the ~ connections to the power input at the motor and close as possible. Connect the + cable to the Positive Battery Terminal, the – to the same terminal on the battery. Connect the battery Alligator Clip AFTER the Motor is running full on. That’s it! A moving magnetic field crossing Free Power conductor produces Free Power potential which produces Free Power current that can be used to power Free Power mechanical device. Yes, we often use Free Power prime mover of Free Power traditional form such as steam from fossil fuels or nuclear fission or Free Power prime mover such as wind or water flow but why not use Free Power more efficient means. Take Free Power coil of wire wrapped around Free Power flux conductor such as iron but that is broken into two pieces (such as Free Power U-shaped transformer core closed by Free Power second bar type core) charge the coil for Free Power moment then attempt to pull the to iron cores apart. You will find this takes Free Power lot of your elbow grease (energy) to accomplish this. This is due to the breaking of the flux circuit within the iron core. An example of energy store as magnetic flux. Isn’t this what Free Power permanent magnet is? Transfering one form of energy to another.
My older brother explained that in high school physics, they learned that magnetism is not energy at all. Never was, never will be. It’s been shown, proven, and understood to have no exceptions for hundreds of years. Something that O. U. should learn but refuses to. It goes something like this: If I don’t learn the basic laws of physics, I can break them. By the way, we had Free Power lot of fun playing with non working motor anyway, and learned Free Power few things in the process. My brother went on to get his PHD in physics and wound up specializing in magnetism. He designed many of the disk drive plates and electronics in the early (DOS) computers. bnjroo Harvey1 Thanks for the reply! I’m afraid there is an endless list of swindlers and suckers out there. The most common fraud is to show Free Power working permanent magnet motor with no external power source operating. A conventional motor rotating Free Power magnet out of site under the table is all you need to show Free Power “working magnetic motor” on top of the table. How could I know this? Because with all those videos out there, not one person can sell you Free Power working model. Also, not one of these scammers can ever let anyone not related to his scam operate the motor without the scammer hovering around. The believers are victims of something called “Confirmation Bias”. Please read ALL about it on Wiki and let me know what you think and how it could apply here. This trap has ensnared some very smart people. Harvey1 bnjroo Free Energy two books! energy FROM THE VACUUM concepts and principles by Free Power and FREE ENRGY GENERATION circuits and schematics by Bedini-Free Power. Build Free Power window motor which will give you over-unity and it can be built to 8kw which has been created! NOTHING IS IMPOSSIBLE! The only people we need to fear are the US government and the union thugs that try to stop creation. Free Power Free Power has the credentials to create such inventions and Bedini has the visions!
I wanted to end with Free Power laugh. I will say, I like Free Electricity Free Power for his comedy. Sure sometimes I am not sure if it comes across to most people as making fun of spirituality and personal work, or if it just calls out the ridiculousness of some of it when we do it inauthentically, but he still has some great jokes. Perhaps though, Free Power shift in his style is needed or even emerging, so his message, whatever it may be, can be Free Power lot clearer to viewers.
Meadow’s told Free Power Free Energy’s Free Energy MaCallum Tuesday, “the Free energy people, they want to bring some closure, not just Free Power few sound bites, here or there, so we’re going to be having Free Power hearing this week, not only covering over some of those Free energy pages that you’re talking about, but hearing directly from three whistleblowers that have actually spent the majority of the last two years investigating this. ”
This simple contradiction dispels your idea. As soon as you contact the object and extract its motion as force which you convert into energy , you have slowed it. The longer you continue the more it slows until it is no longer moving. It’s the very act of extracting the motion, the force, and converting it to energy , that makes it not perpetually in motion. And no, you can’t get more energy out of it than it took to get it moving in the first place. Because this is how the universe works, and it’s Free Power proven fact. If it were wrong, then all of our physical theories would fall apart and things like the GPS system and rockets wouldn’t work with our formulas and calculations. But they DO work, thus validating the laws of physics. Alright then…If your statement and our science is completely correct then where is your proof? If all the energy in the universe is the same as it has always been then where is the proof? Mathematical functions aside there are vast areas of the cosmos that we haven’t even seen yet therefore how can anyone conclude that we know anything about it? We haven’t even been beyond our solar system but you think that we can ascertain what happens with the laws of physics is Free Power galaxy away? Where’s the proof? “Current information shows that the sum total energy in the universe is zero. ” Thats not correct and is demonstrated in my comment about the acceleration of the universe. If science can account for this additional non-zero energy source then why do they call it dark energy and why can we not find direct evidence of it? There is much that our current religion cannot account for. Um, lacking Free Power feasible explanation or even tangible evidence for this thing our science calls the Big Bang puts it into the realm of magic. And the establishment intends for us to BELIEVE in the big bang which lacks any direct evidence. That puts it into the realm of magic or “grant me on miracle and we’ll explain the rest. ” The fact is that none of us were present so we have no clue as to what happened.


text:
AlbaNova and Nordita Colloquium

MANNE SIEGBAHN MEMORIAL LECTURE: Experiments on the beta decay of highly-ionized atoms with challenging and puzzling results

by Fritz Bosch (GSI, Darmstadt)

Europe/Stockholm
Oskar Klein Auditorium ()

Oskar Klein Auditorium

Description
Beta decay of highly-ionized atoms plays a significant role in stellar nucleosynthesis at temperatures of about 30 keV (s-process) where most nuclei are in a high atomic charge state. The facility at GSI, Darmstadt, providing both unstable highly-charged nuclides and an ion storage-cooler ring (ESR) to preserve their high charge state over a long time (hours) was and still is the only place addressing this field which is interesting for nuclear physics as well as for astrophysics. During the last decade, the focus was on the investigation of two-body beta decays, i.e. bound-state beta decay and orbital electron capture (EC), where monochromatic (anti)neutrinos in the electron-flavour eigenstate are created. In course of the first measurements of the EC decay probability of few-electron ions it turned out that hydrogen-like 140Pr58+ and 142Pm60+ nuclides decay by about 50% faster than the helium-like ions, and even faster than the corresponding neutral atoms. This result, although somewhat surprising, can be fully understood in the framework of standard nuclear physics. A few years ago, a new technique, single-ion decay spectroscopy has been developed at the ESR. Here, the number of stored ions is reduced to less than four and the "fate" of each single stored ion is observed continuously and time-resolved. On top of the expected exponentially decreasing EC decay probability, for both hydrogen-like 140Pr and 142Pm ions, periodic modulations were found with a period of about 7s and relative amplitude of 0.2. Tentatively, we argued that these oscillations could be due - as a special kind of "quantum beats"- to the coherent superposition of (at least) two mass eigenstates of the generated electron-neutrino which is a flavour eigenstate, but neither an energy- nor momentum eigenstate. This very controversially discussed hypothesis predicts that similar modulations should also appear in other two-body beta decays with a period being proportional to the mass of the parent ion. To corroborate or disprove this hypothesis, some months ago an experiment with hydrogen-like 122I ions has been conducted, where a modulation period of about 6s is expected, supposed this "neutrino hypothesis" holds true. First results will be reported.

Streaming video


text:
First year economics and finance PhD students have Fridays devoted to “tutorials” - where a particular topic from class is covered in detail. I wanted to do something similar, by reviewing a topic mentioned in a previous post.

# Overlapping Generations (OG)

In the many macro models (neoclassical, new Keynesian, etc.), agents are infinitely lived. As mentioned in the post on Tirole(1982), “bubbles” cannot arise in these models when agents fully optimize. One way to get the myopic behavior needed for bubbles is to have finitely lived agents.
In an overlapping generations model, consumers live for two periods. At any given time $$t$$, there are two generations: those born at $$t-1$$ (the old) and those born at $$t$$ (the young). This post explains how to solve for fundamental equilibria i.e. equilibria without bubbles.
The discussion below is based heavily on Larry Christiano’s Macroeconomics class.

# The Setup

First, some notation. Let $$c_t^t$$ is period $$t$$ consumption of those born at $$t$$ (consumption while young), while $$c_{t+1}^t$$ is the period $$t+1$$ consumption of those born at $$t$$ (consumption while old).
Let $$n_t$$ denote labor supplied at $$t$$. To simplify things, suppose there is a unit mass of young and old at each $$t$$, and both supply $$n=1$$ units of labor (no disutility of labor).
Let $$r_t$$ denote the rental rate of capital, and $$w_t$$ denote the wage rate.
Finally, suppose there is an intrinsically worthless asset (it pays no dividends, cannot be used for production, etc.), $$a_t$$ which is sold at price $$P_t$$.
Putting this together we get the budget constraint for the young is: $$c_t^t+(1-\delta)k_t + i_t + P_t a_t \leq w_t$$ Note that the young must buy all the capital from the old every period.
The budget constraint for the old is: $$c_{t+1}^t \leq r_{t+1} k_{t+1} + (1-\delta)k_{t+1} + w_{t+1} + P_{t+1}$$ In any fundamental equilibrium, there are no bubbles, so $$P_t=0$$ for all $$t$$. Using this, along with the fact that $$k_{t+1}=i_t + (1-\delta) k_t$$ we can simplify the budget constraints: $$c_t^t+k_{t+1} \leq w_t$$ $$c_{t+1}^t \leq r_{t+1} k_{t+1} + (1-\delta)k_{t+1} + w_{t+1}$$

# Consumer Optimization

The old have no incentive to save, so they consume as much as possible in the second period of their life. Assume monotonic preferences so we can get rid of the $$\leq$$. Solve first period budget constraint (BC) for $$k_{t+1}$$: $$k_{t+1}=w_t - c_t$$ Substitute this into the second period budget constraint to eliminate $$k_{t+1}$$: $$c_{t+1}=(r_{t+1}+1-\delta)(w_t-c_t^t)+w_{t+1}$$ We can rearrange this to get the lifetime budget constraint (BC), and formalize the period $$t$$-born consumer’s problem: $$max_{c_t^t, c_{t+1}^t} u(c_t^t) + \beta u(c_{t+1}^t)$$ such that the BC holds: $$c_t^t + \frac{c_{t+1}^t}{r_{t+1}+1-\delta} = w_t + \frac{w_{t+1}}{r_{t+1}+1-\delta}$$ Taking first order conditions, we get the intertemporal Euler equation: $$u’(c_t^t)=\beta u’(c_{t+1}^t)(r_{t+1} + 1 - \delta)$$ Suppose $$u(\cdot)=log(\cdot)$$. Then we can get a nice expression for optimal consumption: $$c_{t+1}^t = \beta c_t^t (r_{t+1} + 1 - \delta)$$ Substituting this into Equation 6, we can get a closed form solution for period $$t$$ consumption: $$c_t^t=\frac{1}{1+\beta}\left[ w_t + \frac{w_{t+1}}{r_{t+1}+1-\delta} \right]$$

# Firm Optimization

Suppose we have the following, homogeneous of degree one, production function ($$\rho\in(0,1)$$): $$f(k,n)=b[\alpha k^\rho + (1-\alpha) n^\rho]^{\frac{1}{\rho}}$$ Define: $$g(k,n)=[\alpha k^\rho + (1-\alpha) n^\rho]^{\frac{1}{\rho}}$$ so $$f(k,n)=b \cdot g(k,n)$$ (this will be useful later).
Now set up the firms cost minimization problem (minimize cost for a given amount of output, $$y$$): $$min_{k,n} rk+wn$$ such that: $$y \leq b g(k,n)$$ First order conditions give us $$w_t$$ and $$r_t$$: $$MP_n(t) = b (1-\alpha) \left(\frac{g}{n} \right)^{(1-\rho)} = w_t$$ $$MP_k(t) = b \alpha \left(\frac{g}{k} \right)^{(1-\rho)} = r_t$$ where $$MP_n(t)$$ is the marginal product of labor at $$t$$, and $$MP_k(t)$$ is the the marginal product of capital. Now we see how $$g$$ is useful, allowing us to get rid of fractions in the exponent: $$\frac{1}{\rho}-1 = \frac{1-\rho}{\rho} = \Big( \frac{1}{\rho} \Big)^{1-\rho}$$

# Equilibrium

Having set up the consumer and firm problems, we are ready to define an equilibrium:
A sequence of markets equilibrium is a set of prices $$\{r_t,w_t\}_{t=1}^\infty$$ and allocations $$\{c_t^t, c_{t+1}^t, i_t, k_{t+1}\}_{t=1}^\infty$$ such that for all $$t$$:
1) Consumer’s problem is solved
2) Firm’s problem is solved
3) Aggregate resource constraint (RC) is satisfied
To get the aggregate resource constraint add up the budget constraints of the young and the old: $$c_t^{t-1}+c_t^t + i_t + (1-\delta)k_t = 2 w_t + r_t k_t + (1-\delta)k_t$$ Eliminating $$(1-\delta)k_t$$ from both sides, and using our expressions for $$w_t$$ and $$r_t$$: $$c_t^{t-1}+c_t^t + i_t = 2 MP_n(t) + k_t MP_k(t)$$ finally use the fact that $$g$$ is homogeneous degree one to get RC: $$c_t^t + c_t^{t-1} + i_t = b g(k_t,2)$$ (recall $$n=2$$ in equilibrium). To see this, think of a simple Cobb-Douglas production function: $$y_t=k_t^\alpha n_t^{1-\alpha}$$. $$MP_k(t)=\alpha k_t^{\alpha-1} n_t^{1-\alpha}$$ and $$MP_n(t)=(1-\alpha) k_t^\alpha n_t^{-\alpha}$$, so $$k_t MP_k(t) + n_t MP_n(t) = \alpha k_t^\alpha n_t^{1-\alpha} + (1-\alpha) k_t^\alpha n_t^{1-\alpha} = y_t$$ as desired.

# Growth

Now to show something interesting - even though growth is feasible in this economy, we won’t have it in equilibrium.
To show growth is feasible, think of the highest possible capital accumulation, this is achieved setting $$c_t^{t-1}$$ and $$c_t^t$$ to zero. This implies (recalling $$i_t=k_{t+1}-(1-\delta)k_t$$) $$k_{t+1}=b g(k_t,2) + (1-\delta) k_t$$ We can divide both sides by $$k_t$$ to get the growth rate: $$\frac{k_{t+1}}{k_t} = \frac{b}{k_t} g(k_t,2) + 1 - \delta$$ and putting in our expression for $$g$$ we get $$\frac{k_{t+1}}{k_t}=b\left[\alpha + (1-\alpha)\Big(\frac{2}{k_t} \Big)^\rho \right]^{\frac{1}{\rho}} + 1 - \delta$$ If we have growth, as $$t \rightarrow \infty$$ we will have $$k_t \rightarrow \infty$$, so our expression simplifies to: $$\frac{k_{t+1}}{k_t} \rightarrow b \alpha^{\frac{1}{\rho}} + 1 - \delta$$ Choosing $$b$$ appropriately, we can make $$b \alpha^{\frac{1}{\rho}} + 1 - \delta>1$$ so growth is possible.
Now, consider the share of income going to the young (who have no capital, and only earn $$w_t$$): $$\frac{w_t}{y_t}= \frac{b(1-\alpha)\left(\frac{g_t}{2} \right)^{1-\rho}}{b g_t} = \frac{(1-\alpha) 2^{\rho-1}}{\alpha k_t^\rho + (1-\alpha) 2^\rho} \rightarrow_{k_t\rightarrow \infty} 0$$ Where after the first equality, I just substituted directly for $$w_t$$ from Equation 16, and imposed $$n=2$$, and the second equality is implied by the definition of $$g$$. This implies that if we have growth (and consequently $$k_t$$ is going to infinity), the share of income going to the young is going to zero. We will use this to show we won’t have growth in equilibrium.
Suppose (for the sake of contradiction) that there is growth in equilibrium, so $$\frac{k_{t+1}}{k_t}>1$$. Recall that weak inequalities are preserved in the limit, so it must be that: $$lim_{k_t \rightarrow \infty} \frac{k_{t+1}}{k_t} \geq 1$$
Now, look at the young consumer’s budget constraint, $$c_t^t + k_{t+1} = w_t$$. This implies that $$k_{t+1}\leq w_t$$ (just set $$c_t^t=0$$). Divide through by $$k_t$$ and multiply the RHS by $$y_t/y_t$$: $$\frac{k_{t+1}}{k_t} \leq \frac{w_t}{y_t} \frac{y_t}{k_t}$$ We already showed that that $$\frac{w_t}{y_t} \rightarrow_{k_t\rightarrow \infty} 0$$. Further, $$\frac{y_t}{k_t} \rightarrow_{k_t\rightarrow \infty} b \alpha^{\frac{1}{\rho}}$$ (this is immediate after dividing $$y_t$$ by $$k_t$$). As $$\rho\in(0,1)$$, the limit is finite. Taking the limit as $$k_t \rightarrow \infty$$ of both sides of Equation 27: $$lim_{k_t \rightarrow \infty} \frac{k_{t+1}}{k_t} \leq lim_{k_t \rightarrow \infty} \frac{w_t}{y_t} \frac{y_t}{k_t} = 0 < 1$$ contradicting Equation 26, so there cannot be growth in equilibrium.

# Next Steps

The unique fundamental equilibrium in this economy has no growth. To get growth, we need to allow for bubble equlibria.


text:
# Digits

I’m about to start a unit on logarithms. Kids don’t technically know that yet. To prime them, today I gave both my Algebra 2 classes a warm up. I was super nervous about this, because I haven’t seen a crazy amount of endurance from many of my kids when they get stuck on something. And I was going to give them something totally open-ended! And without a calculator allowed! Gasp!

I asked them to do the following. Think about $2^{60}$. It’s going to be a long number when it is all written out. I wanted them to come up with a guesstimate about how many digits there are in the expansion. To scaffold, I asked them for three things:

a) What’s a guess (for the number of digits) that is too low? How do you know? (Can you come up with a larger low estimate?)

b) What’s a guess (for the number of digits) that is too high? How do you know? (Can you come up with a smaller higher estimate?)

c) Based on your work and your intuition, if you had to make a guess, how many digits are in the expansion of $2^{60}$?

Honestly, it was one of the best things I’ve done recently. Kids were showing grit and so much flexibility in their thinking! I had to correct a few misconceptions and nudge a little here and there, but it was all on them how they wanted to go about this. It was beautiful. (At one point, a kid said they wanted to give up, but I came back around a few minutes later and they were rapidly making progress and hadn’t given up.)

At first, kids didn’t know where to start. I told them they were going to get time to work on this, so they could take on strategies that might take a while. (Normally, we start class with something short and quick. I wanted to indicate this wasn’t that.) Initially, I gave 7 minutes, but since so many kids were on a roll, I expanded it to 14 or 20 minutes. I honestly don’t remember how long.

What I adored is that this problem was definitely in their wheelhouse. Most groups were gung ho, and just started writing stuff down — and eventually (sometimes with a little encouragement/prompting from me), they came up with SUPER awesome solutions. Seriously, things I had never thought of.

The main two approaches I saw were:

1. Kids noticing that $2^{10}=1024$. Which is close to $10^3$. So $2^{60}=(2^{10})^6 \approx (10^3)^6=(10^{18})$. So that puts us at around 19 digits.
2. Kids noticing this pattern:

So after going up about every 3 exponents, we add an additional digit to the number. (I say about 3 because all groups who did this method saw that a few times, you’d get 4 exponents in a row which keep the same number of digits instead of 3. But it was usually 3.)Assuming the number of digits increases after going up every 3 exponents, that means that exponent 12 has 4 digits, exponent 15 has 5 digits, exponent 18 has 6 digits, exponent 21 has 7 digits… etc. So exponent 60 has 20 digits.

So that puts us around 20 digits (or maybe a little lower because of those occasional 4 exponents in a row).

That’s about all I wanted to share. I was a little out of my comfort zone because I didn’t know if they would all just throw their hands up and give up. But they didn’t, and instead did some phenomenal thinking.

I just realized… you might want to see how this relates to logarithms. It turns out that the number of digits is equal to doing the following: take the log of the number, and then take the floor function of that result, and then you add one. I won’t spoil it by explaining why, though. See if you can figure it out!


text:
# Politics & COVID

### Introduction

In November of last year, I was assigned a cool final project in statistics class: take a COVID-19 dataset and dig around for anything interesting. The dataset1 included state-level COVID-19 cases, deaths, and a handful of related variables (like ICU availability, lockdown status, age). I snuck in an extra variable: the results of the 2020 election.

I was inspired to look at partisanship by previous studies that I’d read. One of them found that states with Democratic governments had better pandemic responses than those with Republican governments, even after controlling for other variables. A later study confirmed that while Republican-led states fared better in the beginning, Democrat-led states have had lower case rates since June 8th.

Part of the explanation lies in individual behavior. For example, Fox News consumption turns out to be correlated with less physical distancing. More strikingly, researchers have shown that partisanship is the strongest predictor of mobility—how likely someone is to travel. These differences in distancing have, in turn, been associated in increased fatality rates.

None of these studies, however, took advantage of the 2020 election results. These are interesting data points. Time reported that—unsettlingly—the counties with the most COVID cases were also the biggest fans of President Trump. Election results offer more information than a binary red/blue label on state governments, measuring the magnitude of political support, while also distinguishing Republicanism from Trumpism (otherwise, we’d have put my home state of Maryland in the same basket as previous home, North Dakota).

I set out to examine the relationship between election results and COVID outcomes.

### Inspiration

For the class project, I chose to simply correlate and plot partisanship against COVID cases and deaths. The dataset only included COVID outcomes from June and October, so I used those numbers. I pulled election results from here and subtracted Trump’s proportion of votes from that of Biden’s (for Maryland—which went 65.8% to 32.4% for Biden—this would be 0.334). I dubbed this measure of partisanship the “Biden margin.”

Below, I plotted case rate against the death rate (which means being in the top-right is very bad) and colored the points according to Biden’s margin of victory. The plots speak for themselves: in June, blue states suffered from higher death rates, and red states tended to have more cases; by October, the data points aligned, and the states with both the most deaths and the cases were red.

So what changed between June and October? I plotted the difference in cases and deaths between June and October against Biden’s margin. Here, partisanship is significantly correlated with both the increase in cases (r=0.483) and the increase in deaths (-0.589). All of this suggests that, from June to October, partisanship significantly influenced state success in containing COVID-19.

But these data faced some important limitations. First, state-level data is highly aggregated, which exaggerates county-level effects and makes it difficult to establish significance. Second, the cases and deaths data were limited to June and October totals, which is a problem if we want to examine more recent trends or specific days. I had a good visual for a class project, but not a thorough analysis.

### Dataset

I decided to build my own, county-level dataset. To test the strength of the partisanship-COVID relationship, I tried to control for significant predictors of COVID cases, such as race, density, and geographic location. To test potential mechanisms for the relationship, I also collected data on mask use and mobility. I compiled,2 with assistance from other data aggregators, the following data sources:

After merging the datasets, I had complete features for 3,111 instances, which spans nearly every county. Below are summary statistics for each feature, with the COVID cases/deaths omitted for brevity.

Mean SD Min Q1 Median Q3 Max
X 1555.00 898.21 0.00 777.50 1555.00 2332.50 3110.00
fips 30646.73 14984.50 1001.00 19038.00 29207.00 46004.00 56045.00
population 105269.60 334973.14 169.00 11134.00 26183.00 68740.50 10039107.00
total_deaths 909.69 2485.67 0.00 123.00 285.00 707.50 68164.00
icus 23.84 84.52 0.00 0.00 0.00 12.00 2126.00
X60older 21484.42 61663.05 29.00 2863.00 6341.00 16229.00 1800341.00
density 261.62 1732.79 0.10 17.70 45.70 115.20 69468.40
X65older 16.81 4.26 3.60 14.00 16.50 19.10 49.30
female 49.99 2.18 30.10 49.60 50.40 51.10 57.00
black 9.22 14.55 0.00 0.60 2.30 10.80 85.40
asian 1.26 2.46 0.00 0.40 0.60 1.10 43.30
hispanic 8.71 13.40 0.20 1.80 3.60 8.80 95.60
white 78.01 19.57 3.20 66.55 85.40 93.80 98.60
bachelors 19.24 8.72 4.20 13.30 17.10 22.70 72.00
distance_to_work 22.97 5.35 7.00 19.30 22.60 26.30 42.50
household_size 2.52 0.24 1.71 2.37 2.50 2.63 4.07
per_capita_income 23062.36 5466.79 9412.00 19509.50 22335.00 25470.50 61290.00
median_household 45143.11 11736.48 19344.00 37762.00 43333.00 50054.00 120332.00
poverty 15.88 6.38 0.00 11.40 15.10 19.40 48.40
lattitude 38.25 4.87 19.67 34.68 38.32 41.68 48.87
maskuse 0.51 0.15 0.12 0.39 0.50 0.61 0.89
tests 67026.15 25552.31 29706.00 46166.00 65614.00 80854.00 178514.00
at_home 62848.95 218253.33 32.00 5526.50 13078.00 36694.50 6752814.00
trips 577235.91 1774733.17 817.00 62147.00 151397.00 396569.50 49347798.00
state_margin -0.07 0.18 -0.45 -0.20 -0.06 0.03 0.89
per_dem_2016 0.32 0.15 0.03 0.20 0.28 0.40 0.93
per_gop_2016 0.64 0.16 0.04 0.55 0.67 0.75 0.95
total_votes_2016 41757.85 113420.85 64.00 4834.50 10948.00 28807.00 2652072.00
per_dem_2020 0.33 0.16 0.03 0.21 0.30 0.42 0.92
per_gop_2020 0.65 0.16 0.05 0.56 0.68 0.77 0.96
total_votes_2020 50800.07 150286.51 66.00 5359.50 12553.00 33673.00 4263443.00

### Exploratory Data Analysis

I began by validating the state-level analysis and looking for new trends. I isolated the COVID cases and deaths over April, June, October, and December, which roughly represent the different stages of the pandemic. Based on previous literature, we would expect June to be the “turning point” where blue states began to outperform red states.

I calculated a new “Biden Margin” and plotted them against cases below. The trend is generally validated—while blue states had more cases in April (r=0.22), that trend began in reverse in June (r=0.17), with an stronger, opposite relationship in December (r=-0.22).

A similar story holds for the death rates, which are plotted below (April is omitted due to lack of data). From June (r=0.20) to October (r=-0.12) to December (r=-0.23), the relationship between partisanship and COVID deaths reversed. By December, every single county with more than 150 deaths per 100,000 was a red state. The differences are stark.

Two further observations are in order:

First, 2016 election results are not as strongly correlated with December cases (-0.20 v. -0.22) or deaths (-0.22 vs. -0.23). It suggests that even over the last four years, the political alignments have shifted.

Second, state-level election results are less predictive of December cases (-0.15 v. -0.22) and much less predictive of deaths (-0.07 vs. -0.23). This validates that county-level granularity boosts predictive power.

Next, I looked at the impact of mobility and mask use on cases in December. Mobility is measured by the total trips per person in November. Mask use is measured by the percent of people who reported wearing masks “all the time” on a survey.

As one might expect, mask use has a significant negative correlation with (r=-0.24). More importantly, mask use seems to be more correlated with Biden’s margin, which suggests that it could be a mediator. On the other hand, mobility is (unintuitively) negatively correlated with cases, with the most mobile counties tending to be red.

### Design

I used the following variables in regression:

• dec_cases and dec_deaths refers to December COVID cases and deaths per 100,000, respectively.
• tests referred to state-level COVID tests per 100,000.
• density was residents per square mile.
• income was the median household income.
• elderly was the proportion of residents aged 60 and older.
• black and hispanic were the proportion of the respective races.
• latitude was the geographic latitude of the state.
• work_distance was the miles driven to work, on average.
• household_size was the average residents per households.
• county_margin was the Democratic margin at the county level while state_margin was the Democratic margin at the state level.
• mask_use and trips were outlined above. ‘at_home’ was a measure of the number of people staying home.
• icu_rate is the number of ICUs per 100,000.

I used four linear models for case rates.

1. dec_cases ~ tests + density + income + elderly + black + hispanic + lattitude + work_distance + household_size
2. dec_cases ~ county_margin + tests + density + income + elderly + black + hispanic + lattitude + work_distance + household_size
3. dec_cases ~ county_margin + state_margin + county_margin * state_margin+ tests + density + income + elderly + black + hispanic + lattitude + work_distance + household_size
4. dec_cases ~ county_margin + mask_use + trips + at_home + tests + density + income + elderly + black + hispanic + lattitude + work_distance + household_size

Model 1 uses standard explanatory variables to predict case rate. Model 2 tests the marginal contribution of partisanship to explaining variance. Model 3 assesses the marginal impact of state partisanship and interactions with county partisanship. Model 4 controls for social distancing measures.

I used four similar models for death rates.

1. dec_deaths ~ density + income + elderly + black + hispanic + lattitude + work_distance + household_size

2. dec_deaths ~ county_margin + density + income + elderly + black + hispanic + lattitude + work_distance + household_size

3. dec_deaths ~ county_margin + state_margin + county_margin * state_margindensity + income + elderly + black + hispanic + lattitude + work_distance + household_size
4. dec_deaths ~ county_margin + mask_use + trips + at_home+ icu_rate + density + income + elderly + black + hispanic + lattitude + work_distance + household_size

The motivations behind these latter four models are similar. Model 5 will predict death rates from population features. Model 6 and 7 will assess the impact of county and state partisanship. Model 8 will control for social distancing measures and ICU availability.

### Results

The regression results for case rates are below.

 Model 1 Model 2 Model 3 Model 4 (Intercept) 4924 . 789*** 4045 . 290*** 3891 . 365*** 3351 . 167*** (361 . 979) (372 . 640) (374 . 423) (420 . 106) tests 0 . 001 0 . 002** 0 . 003*** 0 . 002* (0 . 001) (0 . 001) (0 . 001) (0 . 001) density -0 . 008 0 . 001 0 . 011 -0 . 010 (0 . 010) (0 . 010) (0 . 010) (0 . 010) income -0 . 015*** -0 . 010*** -0 . 009*** -0 . 009*** (0 . 002) (0 . 002) (0 . 002) (0 . 002) elderly -27 . 177*** -30 . 966*** -28 . 561*** -26 . 455*** (3 . 766) (3 . 751) (3 . 810) (3 . 781) black -12 . 574*** -2 . 891 -4 . 275* -1 . 539 (1 . 357) (1 . 762) (1 . 774) (1 . 796) hispanic -3 . 482* 1 . 705 2 . 724 2 . 996 (1 . 528) (1 . 630) (1 . 658) (1 . 663) lattitude -28 . 646*** -12 . 620** -12 . 950** -18 . 087*** (4 . 559) (4 . 888) (4 . 870) (5 . 032) work_distance -7 . 567* -6 . 160 -3 . 791 1 . 049 (3 . 498) (3 . 463) (3 . 490) (3 . 611) household_size -123 . 240 -220 . 678* -239 . 141* -174 . 714 (97 . 425) (97 . 013) (96 . 682) (96 . 974) county_margin -604 . 073*** -586 . 957*** -525 . 372*** (71 . 247) (75 . 757) (83 . 508) state_margin -653 . 073*** (142 . 678) county_margin x state_margin -1417 . 906*** (283 . 989) mask_use -643 . 398*** (149 . 458) trips 55 . 601** (18 . 047) at_home 993 . 826*** (161 . 395) R-squared 0 . 064 0 . 085 0 . 093 0 . 100 adj. R-squared 0 . 061 0 . 082 0 . 090 0 . 097 F 23 . 502 28 . 824 26 . 582 26 . 577 p 0 . 000 0 . 000 0 . 000 0 . 000 Significance: *** = p < 0.001; ** = p < 0.01; * = p < 0.05

The regression results for death rates are below.

 Model 5 Model 6 Model 7 Model 8 (Intercept) 47 . 646** 4 . 282 6 . 298 -21 . 557 (16 . 449) (16 . 892) (16 . 991) (19 . 419) density -0 . 000 0 . 000 0 . 001 0 . 000 (0 . 000) (0 . 000) (0 . 000) (0 . 000) income -0 . 000*** -0 . 000* -0 . 000 -0 . 000 (0 . 000) (0 . 000) (0 . 000) (0 . 000) elderly 0 . 946*** 0 . 761*** 0 . 740*** 0 . 896*** (0 . 171) (0 . 170) (0 . 173) (0 . 174) black -0 . 355*** 0 . 122 0 . 082 0 . 156 (0 . 062) (0 . 080) (0 . 081) (0 . 081) hispanic 0 . 039 0 . 296*** 0 . 282*** 0 . 359*** (0 . 069) (0 . 074) (0 . 075) (0 . 076) lattitude 0 . 322 1 . 163*** 1 . 162*** 0 . 919*** (0 . 200) (0 . 217) (0 . 216) (0 . 226) work_distance -1 . 427*** -1 . 344*** -1 . 317*** -1 . 102*** (0 . 158) (0 . 156) (0 . 158) (0 . 165) household_size 3 . 009 -2 . 011 -2 . 348 -1 . 604 (4 . 421) (4 . 395) (4 . 389) (4 . 433) county_margin -29 . 725*** -32 . 750*** -24 . 711*** (3 . 213) (3 . 428) (3 . 783) state_margin -6 . 384 (6 . 375) county_margin x state_margin -49 . 367*** (12 . 661) mask_use -26 . 771*** (6 . 800) trips 3 . 727*** (0 . 809) at_home 34 . 055*** (7 . 375) icu_rate -0 . 034 (0 . 032) R-squared 0 . 105 0 . 129 0 . 134 0 . 141 adj. R-squared 0 . 102 0 . 126 0 . 131 0 . 137 F 45 . 264 50 . 841 43 . 492 38 . 994 p 0 . 000 0 . 000 0 . 000 0 . 000 Significance: *** = p < 0.001; ** = p < 0.01; * = p < 0.05

### Discussion

Here are eight insights we can draw from our eight models:

1. Explaining local variation is hard. Model 8, the best model, explains only 13.7% of the variation in county-level deaths. In contrast, using fewer features that we used, a previous study accounted for 69% of the variation in state-level cases. The difference suggests researchers conducting regression on state-level data should be cautious about extrapolating results to states. It also indicates case rates are complex and may be influenced by factors outside of a county’s control.

2. Density doesn’t matter. Against intuition but in line with past studies, density has no significant relationship with either cases or deaths. More interestingly, larger households and longer commutes are associated with fewer cases and deaths. I speculate that these variables actually correlate with living in the suburbs, which may in turn be more socially distanced.
3. Race and class do matter. But not exactly how you might think. A higher median household income is associated with significantly fewer cases, but it has little to no effect on death rates after controlling for partisanship. And, Hispanic populations seem have a highly significant association with death rates, a result corroborated with other studies.
4. Partisanship mediates some relationships. The proportion of black residents initially had a highly significant, depressing effect on both case rates and death rates, but the effective disappear after controlling for partisanship. The same goes for latitude. Initially, latitude correlates with fewer cases and a small increase in deaths. After controlling for partisanship, the positive impact on cases shrinks and the negative relationship with deaths becomes highly significant. Both these variables are likely confounded by partisanship: bluer counties are farther North and more diverse.
5. Old people get sick less, but die more. The proportion of people aged 60 and older has a highly significant negative effect on the case rate, but also a significant positive effect on the death rate. The paradox reflects a sad reality on the ground: older communities are trying harder to suppress of COVID, but ultimately still die at higher rates.
6. Democrats have done better. County partisanship have a highly significant impact on outcomes in every model. After controlling for standard explanatory variables, county election results explain an additional 2% of the variance in both cases and deaths. In that model, each 1% increase in the margin of Democratic votes is associated with a decrease of 6.4 cases and 0.32 deaths per 100,000.
7. Politics are complicated. For case rates, the coefficients of state and county partisanship are similar (-666 v. -620). This reflects the structure of governance: if you’re in blue county like Houston, policies passed by the red state legislature and governor will still greatly impact you. At the same time, it means that even in the absence of supporting state policies, local leaders can make a significant impact on case rates. Interestingly, while the state-county partisanship interaction variable is always highly significant, state partisanship is not significant for predicting death rates. Perhaps this suggests that local policies are greater determinants of COVID mortality.

8. Social distancing works. Mask use and fewer trips have highly significant depressing effects on both case rate and death rate. They mediate some of the observed relationship between partisanship, cases, and deaths, helping us explain part of why bluer states to better: they practice more social distancing. Strangely, however, the proportion of at-home residents is positively associated with case and death rates. Perhaps the direction of causation is backwards, and an existing crisis prompts people to stay at home, but then we would expect to see the effect for trips as well. It could also be that being at home correlates with other risk factors for COVID, such as age or joblessness. It isn’t clear.

### Conclusion

The article has examined the relationship between partisanship, COVID outcomes, and related explanatory variables. The results largely corroborate existing research on standard explanatory factors and highlight the difficult of explaining county-by-county variance.

County partisanship has a highly significant impact on case rates and death rates that persists after controlling for explanatory variables. State partisanship is highly significant for cases, and the interaction between state and county partisanship is significant for both outcomes. The effect is mediated in part by social distancing measures, specifically mask use and decreased travel.

The analysis was subject to several limitations:

• The test data were only available at the state level, so the models may have failed to fully control for testing rates.
• Many demographic features used 2010 Census data, which may not reflect the current state of the country.
• Some data seemed to misreport cases or deaths, resulting decreases in cumulative case counts. These were included for comprehensiveness, but may have skewed the results.
• Normality and homoscedasticity were assumed for the data, but that assumption may be inaccurate, particularly for the household size and latitude variables.

There are several avenues for future research:

• Researchers can incorporate dates and extent of policy interventions like restaurant closures and gathering restrictions as explanatory variables.
• The analysis could be updated with 2020 Census and ACS data.
• The influence of 2012 or 2016 election results could be compared to those of 2020 to evaluate changes in political attitude.
• The time frame can be extended into the future months or past months to assess the change in relationships over time.
• Use causal inference techniques to examine the relationship between cases and staying at home.

Thanks to the those who maintained the datasets that this analysis used.

### Footnotes

1. The class dataset is here and the associated codebook is here

2. The data sources and compiler are available in my repo and can be used to compile updated statistics.

Built with Jekyll on the Swiss theme.