text:
## Construct a dfa and nfa for a set of strings on{0,1} : the left most symbol differs from the right most one and odd length string

Construct dfa and nfa for a set of string 0,1 such that left most and right most element are different and odd length string
Can you plss draw it

## How can construct three circles in a given triangle such that three internal tangent form an equilateral triangle

How can construct three circles in a given triangle such that three internal tangent form an equilateral triangle?

Malfatti circles

## printing – Can Adobe Photoshop Elements 2020 app in the App store construct and print multi month wall calendars?

I have an iMac ( 2017 ) running Catalina 10.15. A year and half ago when I was running Mojave I purchased Adobe photoshop Elements 2019 directly from Adobe . The program was very glitchy but did function after a fashion.

When I upgraded to Catalina, Elements got even worse and the only solution Adobe wanted to offer was to get me to pay more money and then to continue to do so. When I bought Elements 2019 it was not available in the App store and now it is.

My question is this: is the ability to design and print the multipage wall calendars that are part of the Adobe purchased app, still available in the App store version?

## real analysis – Can we construct a sequence of trigonometric polynomials that converges pointwise to a given continuous function on the Torus?

Consider any continuous function $$f$$ on an $$m$$-dimensional Torus $$mathbb{T}^m$$. Can we construct a sequence of band limited functions (trigonometric plynomials), with the band width (degree of the trigonometric polynomial) along any direction, being non decreasing, in such a way that the sequence converges pointwise to the function $$f$$?

## functions – How to construct this matrix in Mathematica

I create a symbolic matrix using the following:

``````mat = ToExpression[Table[StringJoin[{"s", ToString[i], ToString[j]}], {i, 1, d}, {j, 1, d}]]
``````

for arbitrary $$d$$. Notice that for $$d=2$$, this gives

$$begin{pmatrix} s11 & s12 \ s21 &s22end{pmatrix}.$$

I do this since an analytic expression is important. However, I would like to get numerics. How can I update the above define for `mat` to get a function of the form:

``````matNEW[s11_, s12_, s21_, s22_]
``````

such that I can evaluate the matrix later in the script for specific values of the parameters.

## statistics – Construct a 95% confidence interval for the unknown population standard deviation

Given the following 6 independent observations drawn from a normal distribution with unknown mean and standard deviation: 15, 18, 17, 12, 8, 20. Construct a 95% confidence interval for the unknown population standard deviation.

I am stuck here. It is easy to construct for the mean. But how to repeat the same procedure with SD. Thank you.

## knot theory – Is the following link impossible to construct?

I’m wondering if it is possible to prove that the following link as described is impossible to construct, or, if not, to construct it. Consider 6 rings, labeled A through F. I want the system to decouple into 6 disconnected rings if any two are cut; furthermore (so that this isn’t just any generalized Brunnian link) I would like for it to be possible to make a single cut that partitions the AB rings from the other four, and similarly for CD from the other four and EF from the other four.

I am also OK with introducing additional “internal” rings (with the external rings being A through F still) so long as the properties above hold, generalized to any two cuts completely separate A through F from each other, and the single cuts separate AB from the other four external rings, etc.

## graphics – Construct a binary tree where the nodes are labeled according to the given rule

I want to draw a binary tree in Mathematica where the nodes are labeled according to a given rule. In fact, if a node has a left child or a right child or both, will be determined by a rule. And then I also want to label each node according to a rule. How do I do this? I can accomplish this quite simply in programming languages such as Java / Kotlin. But Mathematica offers the advantage of a nice drawing and that is what I want (in addition the rules are mathematical equations, etc.) How can I get there?

I'm looking for some examples of constructions for Turing degrees close to Kleene, but not above $$mathcal {O}$$. I know of one by Jockusch and Simpson using forcing with hyperarithmetic and uniformly sharp perfect trees, and this construction has the property of allowing you to force the triple jump of the constructed degree. I would like a few other examples of constructions, especially those that allow you to force the double jump but not the triple jump. Anyone know of any?
$$L = {w #x | w, x in {0, 1 } ^ *, (| w | = | x |), (w neq x ^ R) }$$


text:
## hosein Group Title hi we have a disk with uniform charge density "sigma" that rotate around of axis that transmitted from it's origin,find magnetic moment of disk? 2 years ago 2 years ago

1. gogind

Ok, Total charge on the disk is: $\ Q=\sigma \pi R^2$where R is the radius of the disk If you divide the disk into small rings(width dr) you can write the current in that ring as:$\ dI=\frac{dQ}{T}$where T- time period Since $\ dI =2 \sigma \pi rdr$ and $\ T=\frac{2\pi}{\omega}$ you can rewrite dI as:$\ dI =2 \sigma \pi rdr \frac{\omega}{2 \pi}$$\ dI = \sigma r \omega dr$ Magnetic moment is defined as: $\ m=IA$ where I-current, A-area $\ dm=dI \pi r^2$$\ dm= \sigma r \omega dr \pi r^2$$\ \int dm= \int \sigma \omega \pi r^3 dr$$\ m=\frac{\pi}{4}\sigma \omega R^4$ That would be it.

2. gogind

Also, put a hat on m and omega, since it is a vector...

3. hosein

thnx

format: plain


text:
# [texworks] SCRIPTS: insert cross-reference

Paul A Norman paul.a.norman at gmail.com
Sun May 9 11:03:50 CEST 2010

Dear Stefan,

Thank you for the encouragement..

I think your auto-completion idea would be a really really good way to
implement this when it can be done.

Aware that you and Jonathan are looking at calling Script functions
from C++, is there anything about the way I write Scripts that needs
to be improved to fit with planned developments?

looking stable, or should I wait for future development before

Paul

On 9 May 2010 18:44, Stefan Löffler <st.loeffler at gmail.com> wrote:
> Hi,
>
> Am 2010-05-09 07:31, schrieb Paul A Norman:
>> Insert Cross Reference
>>
>> This script makes a list of \label{s} in the active document, and
>> offers a drop down box to chose one, and another drop down box to
>> choose a cross-reference type ( \ref or \pageref).
>>
>
> This is truely awesome! Definitely a great script.
>
> I wanted to try something similar some time, but it appears you've beat
> me to it and are becoming our master of scripts :). For the future, I
> hope we can find a possibility to do this in way that is somewhat more
> integrated into the "normal" workflow (i.e., that doesn't need to open a
> dialog but, e.g., presents a list such as other apps do for
> autocompletion that can react dynamically as the user remains typing in
> the normal source doc). But these are dreams of the future, and your
> script implements label lookup today!
>
> Keep up the great work!
>
> -Stefan
>


text:
### AST_BORDER

Draw a border around valid regions of a Plot

#### Description:

This function draws a (line) border around regions of the plotting area of a Plot which correspond to valid, unclipped physical coordinates. For example, when plotting using an all-sky map projection, this function could be used to draw the boundary of the celestial sphere when it is projected on to the plotting surface.

If the entire plotting area contains valid, unclipped physical coordinates, then the boundary will just be a rectangular box around the edges of the plotting area.

If the Plot is a Plot3D, this method is applied individually to each of the three 2D Plots encapsulated within the Plot3D (each of these Plots corresponds to a single 2D plane in the 3D graphics system). In addition, if the entire plotting volume has valid coordinates in the 3D current Frame of the Plot3D, then additional lines are drawn along the edges of the 3D plotting volume so that the entire plotting volume is enclosed within a cuboid grid.

#### Invocation

RESULT = AST_BORDER( THIS, STATUS )

#### Arguments

##### THIS = INTEGER (Given)
Pointer to the Plot.
##### STATUS = INTEGER (Given and Returned)
The global status.

#### Returned Value

##### AST_BORDER = LOGICAL
.FALSE. is returned if the plotting space is completely filled by valid, unclipped physical coordinates (so that only a rectangular box was drawn around the edge). Otherwise, .TRUE. is returned.

#### Notes:

• A value of .FALSE. will be returned if this function is invoked with STATUS set to an error value, or if it should fail for any reason.

• An error results if either the current Frame or the base Frame of the Plot is not 2-dimensional or (for a Plot3D) 3-dimensional.

• An error also results if the transformation between the base and current Frames of the Plot is not defined (i.e. the Plot’ s TranForward attribute is zero).


text:
lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

## Re: \set vs \override

 From: Nick Payne Subject: Re: \set vs \override Date: Tue, 24 Nov 2009 22:29:20 +1100 User-agent: Thunderbird 2.0.0.23 (X11/20090817)

```Carl Sorensen wrote:
```
```
On 11/24/09 2:57 AM, "Nick Payne" <address@hidden> wrote:

```
```James Worlton wrote:
```
```Hi!

In 2.13.6 I did a project and used:
\set Score.markFormatter = #format-mark-box-alphabet
and I got the boxes and the letter I (all in one command!)
```
```Thanks for that. That particular value for set
(format-mark-box-alphabet) doesn't seem to appear anywhere in the
documentation - or at least, I can't find it in the PDF documentation,
which is what I use.
```
```
This must be a bug in the documentation.

Nick, could you figure out where it should go, and write a bit of text and a
simple example, so we can add it to the docs?
```
Well I only have/use the PDF documentation, and the section on Rehearsal marks is on p.74 of the 2.13.7 Notation reference. After the initial example, it presently says:
```
==============================================
```
The letter ‘I’ is skipped in accordance with engraving traditions. If you wish to include the
```letter ‘I’, then use

\set Score.markFormatter = #format-mark-alphabet
==============================================

This should probably be changed to

==============================================
```
The letter ‘I’ is skipped in accordance with engraving traditions. If you wish to include the letter ‘I’, then use one of the following commands, depending on which style of rehearsal mark you want (letters only, letters in a hollow box, or letters in a hollow circle)
```
\set Score.markFormatter = #format-mark-alphabet
\set Score.markFormatter = #format-mark-box-alphabet
\set Score.markFormatter = #format-mark-circle-alphabet
==============================================

```
And a simple example (goes up to letter J, not much point to it if it doesn't go past I)
```
\relative c'' {
\set Score.markFormatter = #format-mark-box-alphabet
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
c1 \mark \default
}

Nick

```

reply via email to

 [Prev in Thread] Current Thread [Next in Thread]


text:
mersenneforum.org Other news
 Register FAQ Search Today's Posts Mark Forums Read

2009-12-18, 06:27   #23
em99010pepe

Sep 2004

54168 Posts

Quote:
 Originally Posted by Thomas11 We would just need one prime at n=3M to reach that goal...
I hope to find at least one more prime for k=105 until n=1.5M, I suppose that will give me half the points with need. Cruelty is testing k=59 on n=3M range, let's hope he can find one prime soon...lol...that would be great.

Last fiddled with by em99010pepe on 2009-12-18 at 06:30

 2009-12-18, 06:59 #24 VBCurtis     "Curtis" Feb 2005 Riverside, CA 2·32·313 Posts I have ~8 cores in 1.5 to 2.0M range, and 6 more above 2M. The effort is there, one of us just has to get lucky to push us over 49. -Curtis
2009-12-18, 09:53   #25
Thomas11

Feb 2003

78016 Posts

Quote:
 Originally Posted by em99010pepe I hope to find at least one more prime for k=105 until n=1.5M, I suppose that will give me half the points with need.
Unfortunately, you would need about 9 primes at n=1.5M (or just 3 around n=2M) to yield the same score as for one n=3M prime...

But the more we find, the closer we get.

 2009-12-18, 10:46 #26 henryzz Just call me Henry     "David" Sep 2007 Liverpool (GMT/BST) 37×163 Posts Code: `RPS NPLB Primegrid 140 174 315 top 5000 primes smaller than 500k 353 397 205 primes of size between 500k
 2009-12-18, 16:09 #27 VBCurtis     "Curtis" Feb 2005 Riverside, CA 160216 Posts Nice work, henry. A much more detailed comparison than just number of primes. -Curtis
2009-12-22, 07:24   #28
em99010pepe

Sep 2004

2×5×283 Posts

Quote:
 Originally Posted by Thomas11 Unfortunately, you would need about 9 primes at n=1.5M (or just 3 around n=2M) to yield the same score as for one n=3M prime... But the more we find, the closer we get.
Got one at 1.4M...

 2009-12-23, 09:50 #29 em99010pepe     Sep 2004 2·5·283 Posts Looks like RPS will finish 1st in number of primes by the end of the year.
 2009-12-23, 11:22 #30 Kosmaj     Nov 2003 2×1,811 Posts Carlos Congrats on yet another k=105 megabit prime! We are approaching 1000 primes in Top-5000 and the score of 49.0 ! Currently: 991 primes and the score of 48.9384 - Last fiddled with by Kosmaj on 2009-12-23 at 11:25
 2010-01-04, 08:16 #31 em99010pepe     Sep 2004 2·5·283 Posts Thank you Kosmaj. Anyway, by looking at the overall standings PrimeGrid will in three months or even four months be back to first spot, it is a matter of time and primes due to its tremendous CPU power available. RPS has 80 primes between Top5000 and Top4500, NPLB 83, PrimeGrid 206 and FDCPS 35, respectively. Between RPS and NPLB will be an interesting fight..Reaching 1000 primes will be difficult but not impossible. Carlos
2010-01-04, 23:02   #32
em99010pepe

Sep 2004

2×5×283 Posts

Quote:
 Originally Posted by em99010pepe Reaching 1000 primes will be difficult but not impossible. Carlos
RPS is now with 1000 primes...lol

 2010-01-31, 22:01 #33 em99010pepe     Sep 2004 2·5·283 Posts COOPERATIVE ALLIANCE FORMED BETWEEN SB AND PRIMEGRID! Starting to smell like PrimeGrid is getting the monopoly of all prime hunting projects.

 Similar Threads Thread Thread Starter Forum Replies Last Post gd_barnes Conjectures 'R Us 305 2023-01-21 13:53 gd_barnes No Prime Left Behind 258 2023-01-21 11:09 willmore Computer Science & Computational Number Theory 48 2010-09-19 08:30 NBtarheel_33 Hardware 17 2009-05-04 15:52 KEP Riesel Base 3 Attack 4 2008-12-17 11:54

All times are UTC. The time now is 12:09.

Thu Feb 2 12:09:47 UTC 2023 up 168 days, 9:38, 1 user, load averages: 0.35, 0.63, 0.79


text:
## Extensive amenability and a Tits alternative for topological full groups

This dissertation investigates the amenability of topological full groups using a property of group actions called extensive amenability. Extensive amenability is a core concept of several amenability results for groups of dynamical origin. We study its properties and present some applications. The main result of the thesis is such an application, a Tits alternative for topological full groups of minimal actions of finitely generated groups. On the one hand, we show that topological full groups of minimal actions of virtually cyclic groups are amenable. On the other hand, if $G$ is a finitely generated not virtually cyclic group, we construct a minimal free action of $G$ on a Cantor space such that the topological full group contains a non-abelian free group.

Monod, Nicolas
Year:
2019
Publisher:
Lausanne, EPFL
Keywords:
Laboratories:
EGG


text:
## Monday, January 9, 2017

### “May you and all your students flourish.”

Francis Su was the former president of the Mathematical Association of America. He just gave a beautiful address at the AMS-MAA Joint Meeting, entitled “Mathematics for Human Flourishing”.

Basically, when asked about the goal of mathematics, the answer is often related to its contribution to the progress of mankind through the advancement of science. Francis Su explicits what the deepest goal of mathematics may be: contribute to the flourishing not only of mankind as a whole, but of each of us as human beings. Starting from Aristotle's view that a well-lived life goes through the exercise of “virtue” — excellence of character leading to the excellence of conduct. He then quotes five basic desires which mathematics help fulfill while cultivating such virtues: play, beauty, truth, justice and love.

Francis Su's address is full of personal stories, encounters, and quotes, and I invite all of you either to watch the video on the Facebook page of the MAA, or to read its transcript on Francis Su's blog.

On the beginning of this New Year, I would just like to conclude this short message by repeating his
final wish: ”May you and all your students flourish!”

## Saturday, June 11, 2016

### Triviality of vector bundles with connections on simply connected varieties

I would like to discuss today a beautiful theorem of Grothendieck concerning differential equations. It was mentioned by Yves André in a wonderful talk at IHÉS in March 2016 and Hélène Esnault kindly explained its proof to me during a nice walk in the Bavarian Alps last April... The statement is as follows:

Theorem (Grothendieck, 1970). — Let $X$ be a smooth projective complex algebraic variety. Assume that $X$ is simply connected. Then every vector bundle with an integrable connection on $X$ is trivial.

Let indeed $(E,\nabla)$ be a vector bundle with an integrable connection on $X$ and let us show that it is trivial, namely, that there exist $n$ global sections $e_1,\dots,e_n$ of $E$ which are horizontal ($\nabla e_i=0$) and form a basis of $E$ at each point.

Considering the associated analytic picture, we get a vector bundle $(E^{\mathrm{an}},\nabla)$ with an integrable connection on the analytic manifold $X(\mathbf C)$. Let $x\in X(\mathbf C)$. By the theory of linear differential equations, this furnishes a representation $\rho$ of the topological fundamental group $\pi_1(X(\mathbf C),x)$ in the fiber $E_x$ of the vector bundle $E$ at the point $x$. Saying that $(E^{\mathrm{an}},\nabla)$ is trivial on $X(\mathbf C)$ means that this representation $\rho$ is trivial, which seems to be a triviality since $X$ is simply connected.

However, in this statement, simple connectedness means in the sense of algebraic geometry, namely that $X$ has no non-trivial finite étale covering. And this is why the theorem can be surprising, for this hypothesis does not imply that $\pi_1(X(\mathbf C),x))$ is trivial, only that is has no non-trivial finite quotient. This is Grothendieck's version of Riemann's existence theorem, proved in SGA 1.

However, it is known that $X(\mathbf C)$ is topologically equivalent to a finite cellular space, so that its fundamental group $\pi_1(X(\mathbf C),x)$  is finitely presented.

Proposition (Malčev, 1940). — Let $G$ be a finitely generated subgroup of $\mathrm{GL}(n,\mathbf C)$. Then $G$ is residually finite: for every finite subset $T$ of $G$ not containing $\{\mathrm I_n\}$, there exists a finite group $K$ and a morphism $f\colon G\to K$ such that $T\cap \operatorname{Ker}(f)=\varnothing$.

Consequently, the image of $\rho$ is residually finite. If it were non-trivial, there would exist a non-trivial finite quotient $K$ of $\operatorname{im}(\rho)$, hence a non-trivial finite quotient of $\pi_1(X(\mathbf C),x)$, which, as we have seen, is impossible. Consequently, the image of $\rho$ is trivial and $(E^{\mathrm{an}},\nabla)$ is trivial.

In other words, there exists a basis $(e_1,\dots,e_n)$ of horizontal sections of $E^{\mathrm{an}}$. By Serre's GAGA theorem, $e_1,\dots,e_n$ are in fact algebraic, ie, induced by actual global sections of $E$ on $X$. By construction, they are horizontal and form a basis of $E$ at each point. Q.E.D.

It now remains to explain the proof of the proposition. Let $S$ be a finite symmetric generating subset of $G$ containing $T$, not containing $\mathrm I_n$, and let $R$ be the subring of $\mathbf C$ generated by the entries of the elements of $S$ and their inverses. It is a non-zero finitely generated $\mathbf Z$-algebra; the elements of $S$ are contained in $\mathrm {GL}(n,R)$, hence $G$ is a subgroup of $\mathrm{GL}(n,R)$. Let $\mathfrak m$ be a maximal ideal of $R$ and let $k$ be its residue field; the point of the story is that this field $k$ is finite (I'll explain why in a minute.) Then the reduction map $R\to k$ induces a morphism of groups $\mathrm{GL}(n,R)\to \mathrm {GL}(n,k)$, hence a morphism $G\to \mathrm{GL}(n,k)$. By construction, a non-zero entry of an element of $S$ is invertible in $R$ hence is mapped to a non-zero element in $k$. Consequently, $S$ is disjoint from the kernel of $f$, as was to be shown.

Lemma. — Let $R$ be a finitely generated $\mathbf Z$-algebra and let $\mathfrak m$ be a maximal ideal of $R$. The residue field $R/\mathfrak m$ is finite.

Proof of the lemma. — This could be summarized by saying that $\mathbf Z$ is a Jacobson ring: if $A$ is a Jacobson ring, then every finitely generated $A$-algebra $K$ which is a field is finite over $A$; in particular, $K$ is a finite extension of a quotient field of $A$. In the case $A=\mathbf Z$,  the quotient fields of $\mathbf Z$ are the finite fields $\mathbf F_p$, so that $K$ is a finite extension of a finite field, hence is a finite field. Let us however explain the argument. Let $K$ be the field $R/\mathfrak m$; let us replace $\mathbf Z$ by its quotient $A=\mathbf Z/P$, where $P$ is the kernel of the map $\mathbf Z\to R/\mathfrak m$. There are two cases: either $P=(0)$ and $A=\mathbf Z$, or $P=(p)$, for some prime number $p$, and $A$ is the finite field $\mathbf F_p$;
we will eventually see that the first case cannot happen.

Now, $K$ is a field which is a finitely generated algebra over a subalgebra $A$; let $k$ be the fraction field of $A$. The field $K$ is now a finitely generated algera over its subfield $k$; by Zariski's form of Hilbert's Nullstellensatz, $K$ is a finite algebraic extension of $k$. Let us choose a finite generating subset $S$ of $K$ as a $k$-algebra; each element of $S$ is algebraic over $k$; let us consider the product $f$ of the leading coefficients of their minimal polynomials, chosen to belong to $A[T]$ and let $A'=A[1/f]$. By construction, the elements of $S$ are integral over $K$, hence $K$ is integral over $A'$. Since $K$ is a field, we deduce that $A'$ is a field. To conclude, we split the discussion into the two cases stated above.

If $P=(p)$, then $A=\mathbf F_p$, hence $k=\mathbf F_p$ as well, and $K$ is a finite extension of $\mathbf F_p$, hence is a finite field.

Let us assume, by contradiction, that $P=(0)$, hence $A=\mathbf Z$ and $k=\mathbf Q$. By what precedes, there exists an element $f\in\mathbf Z$ such that $\mathbf Q=\mathbf Z[1/f]$. But this cannot be true, because $\mathbf Z[1/f]$ is not a field. Indeed, any prime number which does not divide $f$ is not invertible in $\mathbf Z[1/f]$. This concludes the proof of the lemma.

Remarks. — 1) The theorem does not hold if $X$ is not proper. For example, the affine line $\mathbf A^1_{\mathbf C}$ is simply connected, both algebraically and topologically, but the trivial line bundle $E=\mathscr O_X\cdot e$ endowed with the connection defined by $\nabla (e)=e$ is not trivial. It is analytically trivial though, but its horizontal analytic sections are of the form $\lambda \exp(z) e$, for $\lambda\in\mathbf C$, and except for $\lambda=0$, none of them are algebraic.
However, the theorem holds if one assumes moreover that the connection has regular singularities at infinity.

2) The group theoretical property that we used is that on a complex algebraic variety, the monodromy group of a vector bundle with connection is residually finite. It is not always true that the topological fundamental group of a complex algebraic variety is residually finite. Examples have been given by Domingo Toledo in “Projective varieties with non-residually finite fundamental group”, Publications mathématiques de l’I.H.É.S., 77 (1993), p. 103–119.

3) The analogous result in positive characteristic is a conjecture by Johan De Jong formulated in 2010: If $X$ is a projective smooth simply connected algebraic variety over an algebraically closed field of characteristic $p$, then every isocrystal is trivial. It is still open, despite beautiful progress by Hélène Esnault, together with Vikram Mehta and Atsushi Shiho.

## Thursday, May 5, 2016

### Bourbaki and Felix Klein

A colleague just sent me Xerox copies of a few pages of a 1899 biography of the général Bourbaki. Its author, François Bournand, was the private secretary of Édouard Drumont, an antisemitic writer and journalist. The book would probably not be worth much being mentioned here without its dedication:

À l'abbé Félix Klein
de l'Institut catholique
Hommage respectueux de son dévoué en N.-S.
François Bournand
Professeur d'histoire de l'art à l'École professionnelle catholique

Abbé is abbot, in this context, a catholic priest without a parish; the French initials N.-S. mean Notre Seigneur, Our Lord. It appears that this Félix Klein (note the accent on the e) also has a Wikipedia page.

## Friday, April 29, 2016

### Roth's theorems

A few days ago,  The Scotsman published a paper about Klaus Roth's legacy, explaining how he donated his fortune (1 million pounds) to various charities. This paper was reported by some friends on Facebook. Yuri Bilu added the mention that he knew two important theorems of Roth, and since one of them did not immediately reached my mind, I decided to write this post.

The first theorem was a 1935 conjecture of Erdős and Turán concerning arithmetic progression of length 3 that Roth proved in 1952. That is, one is given a set $A$ of positive integers and one seeks for triples $(a,b,c)$ of distinct elements of $A$ such that $a+c=2b$; Roth proved that infinitely many such triples exist as soon as the upper density of $A$ is positive, that is:
$\limsup_{x\to+\infty} \frac{\mathop{\rm Card}(A\cap [0;x])}x >0.$
In 1975, Endre Szemerédi proved that such sets of integers contain (finite) arithmetic progressions of arbitrarily large length. Other proofs have been given by Hillel Furstenberg (using ergodic theory) and Tim Gowers (by Fourier/combinatorical methods); Roth had used Hardy-Littlewood's circle method.

In 1976, Erdős strengthened his initial conjecture with Turán and predicted that arithmetic progressions of arbitrarily large length exist in $A$ as soon as
$\sum_{a\in A} \frac 1a =+\infty.$
Such a result is still a conjecture, even for arithmetic progressions of length $3$, but a remarkable particular case has been proved by Ben Green and Terry Tao in 2004, when $A$ is the set of all prime numbers.

Outstanding as these results are (Tao has been given the Fields medal in 2006 and Szemerédi the Abel prize in 2012), the second theorem of Roth was proved in 1955 and was certainly the main reason for awarding him the Fields medal in 1958. Indeed, Roth gave a definitive answer to a long standing question in diophantine approximation that originated from the works of Joseph Liouville (1844). Given a real number $\alpha$, one is interested to rational fractions $p/q$ that are close to $\alpha$, and to the quality of the approximation, namely the exponent $n$ such that $\left| \alpha- \frac pq \right|\leq 1/q^n$. Precisely, the approximation exponent $\kappa(\alpha)$ is the largest lower bound of all real numbers $n$ such that the previous inequality has infinitely many solutions in fractions $p/q$, and Roth's theorem asserts that one has $\kappa(\alpha)=2$ when $\alpha$ is an irrational algebraic number.

One part of this result goes back to Dirichlet, showing that for any irrational number $\alpha$, there exist many good approximations with exponent  $2$. This can be proved using the theory of continued fractions and is also a classical application of Dirichlet's box principle. Take a positive integer $Q$ and consider the $Q+1$ numbers $q\alpha- \lfloor q\alpha\rfloor$ in $[0,1]$, for $0\leq q\leq Q$; two of them must be less that $1/Q$ apart; this furnishes integers $p',p'',q',q''$, with $0\leq q'<q''\leq Q$ such that $\left| (q''\alpha-p'')-(q'\alpha-p')\right|\leq 1/Q$; then set $p=p''-p'$ and $q=q''-q'$; one has $\left| q\alpha -p \right|\leq 1/Q$, hence $\left|\alpha-\frac pq\right|\leq 1/Qq\leq 1/q^2$.

To prove an inequality in the other direction, Liouville's argument was that if $\alpha$ is an irrational root of a nonzero polynomial $P\in\mathbf Z[T]$, then $\kappa(\alpha)\leq\deg(P)$. The proof is now standard: given an approximation $p/q$ of $\alpha$, observe that $q^d P(p/q)$ is a non-zero integer (if, say, $P$ is irreducible), so that $\left| q^d P(p/q)\right|\geq 1$. On the other hand, $P(p/q)\approx (p/q-\alpha) P'(\alpha)$, hence an inequality $\left|\alpha-\frac pq\right|\gg q^{-d}$.

This result has been generalized, first by Axel Thue en 1909 (who proved an inequality $\kappa(\alpha)\leq \frac12 d+1$), then by Carl Ludwig Siegel and Freeman Dyson in 1947 (showing $\kappa(\alpha)\leq 2\sqrt d$ and $\kappa(\alpha)\leq\sqrt{2d}$). While Liouville's result was based in the minimal polynomial of $\alpha$, these generalisations required to involve polynomials in two variables, and the non-vanishing of a quantity such that $q^dP(p/q)$ above was definitely less trivial. Roth's proof made use of polynomials of arbitrarily large degree, and his remarkable achievement was a proof of the required non-vanishing result.

Roth's proof was “elementary”, making use only of polynomials and wronskians. There are today more geometric proofs, such as the one by Hélène Esnault and Eckart Viehweg (1984) or Michael Nakamaye's subsequent proof (1995) which is based on Faltings's product theorem.

What is still missing, however, is the proof of an effective version of Roth's theorem, that would give, given any real number $n>\kappa(\alpha)$, an actual integer $Q$ such that every rational fraction $p/q$ in lowest terms such that $\left|\alpha-\frac pq\right|\leq 1/q^n$ satisfies $q\leq Q$. It seems that this defect lies at the very heart of almost all of the current approaches in diophantine approximations...

## Wednesday, April 13, 2016

### Weierstrass's approximation theorem

I had to mentor an Agrégation leçon entitled Examples of dense subsets. For my own edification (and that of the masses), I want to try to record here as many proofs as of the Weierstrass density theorem as I can : Every complex-valued continuous function on the closed interval $[-1;1]$ can be uniformly approximated by polynomials. I'll also include as a bonus the trigonometric variant: Every complex-valued continuous and $2\pi$-periodic function on $\mathbf R$ can be uniformly approximated by trigonometric polynomials.

1. Using the Stone theorem.

This 1937—1948 theorem is probably the final conceptual brick to the edifice of which Weierstrass laid the first stone in 1885. It asserts that a subalgebra of continuous functions on a compact totally regular (e.g., metric) space is dense for the uniform norm if and only if it separates points. In all presentations that I know of, its proof requires to establish that the absolute value function can be uniformly approximated by polynomials on $[-1;1]$:
• Stone truncates the power series expansion of the function $x\mapsto \sqrt{1-(1-x^2)}=\sum_{n=0}^\infty \binom{1/2}n (x^2-1)^n,$ bounding by hand the error term.
• Bourbaki (Topologie générale, X, p. 36, lemme 2) follows a more elementary approach and begins by proving  that the function $x\mapsto \sqrt x$ can be uniformly approximated by polynomials on $[0;1]$. (The absolute value function is recovered since $\mathopen|x\mathclose|\sqrt{x^2}$.) To this aim, he introduces the sequence of polynomials given by $p_0=0$ and $p_{n+1}(x)=p_n(x)+\frac12\left(x-p_n(x)^2\right)$ and proves by induction the inequalities $0\leq \sqrt x-p_n(x) \leq \frac{2\sqrt x}{2+n\sqrt x} \leq \frac 2n$ for $x\in[0;1]$ and $n\geq 0$. This implies the desired result.
The algebra of polynomials separates points on the compact set $[-1;1]$, hence is dense. To treat the case of trigonometric polynomials, consider Laurent polynomials on the unit circle.

2. Convolution.

Consider an approximation $(\rho_n)$ of the Dirac distribution, i.e., a sequence of continuous, nonnegative and compactly supported functions on $\mathbf R$ such that $\int\rho_n=1$ and such that for every $\delta>0$, $\int_{\mathopen| x\mathclose|>\delta} \rho_n(x)\,dx\to 0$. Given a continuous function $f$ on $\mathbf R$, form the convolutions defined by $f*\rho_n(x)=\int_{\mathbf R} \rho_n(t) f(x-t)\, dt$. It is classical that $f*\rho_n$ converges uniformly on every compact to $f$.

Now, given a continuous function $f$ on $[-1;1]$, one can extend it to a continuous function with compact support on $\mathbf R$ (defining $f$ to be affine linear on $[-2;-1]$ and on $[1;2]$, and to be zero outside of $[-2;2]$. We want to choose $\rho_n$ so that $f*\rho_n$ is a polynomial on $[-1;1]$. The basic idea is just to choose a parameter $a>0$, and to take $\rho_n(x)= c_n (1-(x/a)^2)^n$ for $\mathopen|x\mathclose|\leq a$ and $\rho_n(x)=0$ otherwise, with $c_n$ adjusted so that $\int\rho_n=1$. Let us write $f*\rho_n(x)=\int_{-2}^2 \rho_n(x-t) f(t)\, dt$; if $x\in[-1;1]$ and $t\in[-2:2]$, then $x-t\in [-3;3]$ so we just need to be sure that $\rho_n$ is a polynomial on that interval, which we get by taking, say, $a=3$. This shows that the restriction of $f*\rho_n$ to $[-1;1]$ is a polynomial function, and we're done.

This approach is more or less that of D. Jackson (“A Proof of Weierstrass's Theorem,” Amer. Math. Monthly, 1934). The difference is that he considers continuous functions on a closed interval contained in $\mathopen]0;1\mathclose[$ which he extends linearly to $[0;1]$ so that they vanish at $0$ and $1$; he considers the same convolution, taking the parameter $a=1$.

Weierstrass's own proof (“Über die analytische Darstellbarkeit sogenannter willkurlicher Functionen einer reellen Veranderlichen Sitzungsberichteder,” Königlich Preussischen Akademie der Wissenschaften zu Berlin, 1885) was slightly more sophisticated: he first showed approximation by convolution with the Gaussian kernel  defined by $\rho_n(t) =\sqrt{ n} e^{- \pi n t^2}$, and then expanded the kernel as a power series, a suitable truncation of which furnishes the desired polynomials.

As shown by Jacskon, the same approach works easily (in a sense, more easily) for $2\pi$-periodic functions, considering the kernel defined by $\rho_n(x)=c_n(1+\cos(x))^n$, where $c_n$ is chosen so that \int_{-\pi}^\pi \rho_n=1$. 3. Bernstein polynomials. Take a continuous function$f$on$[0;1]$and, for$n\geq 0$, set $B_nf(x) = \sum_{k=0}^n f(k/n) \binom nk t^k (1-t)^{n-k}.$ It is classical that$B_nf$converges uniformly to$f$on$[0;1]$. There are two classical proofs of Bernstein's theorem. One is probabilistic and consists in observing that$B_nf(x)$is the expected value of$f(S_n)$, where$S_n$is the sum of$n$i.i.d. Bernoulli random variables with parameter$x\in[0;1]$. Another (generalized as the Korovkin theorem, On convergence of linear positive operators in the space of continuous functions, Dokl. Akad. Nauk SSSR (N.S.), vol. 90, ) consists in showing (i) that for$f=1,x,x^2$,$B_nf$converges uniformly to$f$(an explicit calculation), (ii) that if$f\geq 0$, then$B_nf\geq 0$as well, (iii) for every$x\in[0;1]$, squeezing$f$inbetween two quadratic polynomials$f^+$and$f_-$such that$f^+(x)-f^-(x)$is as small as desired. A trigonometric variant would be given by Fejér's theorem that the Cesàro averages of a Fourier series of a continuous,$2\pi$-periodic function converge uniformly to that function. In turn, Fejér's theorem can be proved in both ways, either by convolution (the Fejér kernel is nonnegative), or by a Korovkine-type argument (replacing$1,x,x^2$on$[0;1]$by$1,z,z^2,z^{-1},z^{-2}$on the unit circle). 4. Using approximation by step functions. This proof originates with a paper of H. Kuhn, “Ein elementarer Beweis des Weierstrasschen Approximationsatzes,” Arch. Math. 15 (1964), p. 316–317. Let us show that for every$\delta\in\mathopen]0,1\mathclose[$and every$\varepsilon>0$, there exists a polynomial$p$satisfying the following properties: •$0\leq p(x)\leq \varepsilon$for$-1\leq x\leq-\delta$; •$0\leq p(x)\leq 1$for$-\delta\leq x\leq \delta$; •$1-\varepsilon\leq p(x)\leq 1$for$\delta\leq x\leq 1$. In other words, these polynomials approximate the (discontinuous) function$f$on$[-1;1]$defined by$f(x)=0$for$x< 0$,$f(x)=1$for$x> 0$and$f(0)=1/2$. A possible formula is$p(x)=(1- ((1-x)/2))^n)^{2^n}$, where$n$is a large enough integer. First of all, one has$0\leq (1-x)/2\leq 1$for every$x\in[-1;1]$, so that$0\leq p(x)\leq 1$. Let$x\in[-1;-\delta]$; then one has$(1-x)/2\geq (1+\delta)/2$, hence$p(x)\leq (1-((1+\delta)/2)^n)^{2^n}$, which can be made arbitrarily small when$n\to\infty$. Let finally$x\in[\delta;1]$; then$(1-x)/2\geq (1-\delta)/2$, hence$p(x)\geq (1-((1-\delta)/2)^n)^{2^n}\geq 1- (1-\delta)^n$, which can be made arbitrarily close to$1$when$n\to\infty$. By translation and dilations, the discontinuity can be placed at any element of$[0;1]$. Let now$f$be an arbitrary step function and let us write it as a linear combination$f=\sum a_i f_i$, where$f_i$is a$\{0,1\}$-valued step function. For every$i$, let$p_i$be a polynomial that approximates$f_i$as given above. The linear combination$\sum a_i p_i$approximates$f$with maximal error$\sup(\mathopen|a_i\mathclose|)$. Using uniform continuity of continuous functions on$[-1;1]$, every continuous function can be uniformly approximated by a step function. This concludes the proof. 5. Using approximation by piecewise linear functions. As in the proof of Stone's theorem, one uses the fact that the function$x\mapsto \mathopen|x\mathclose|$is uniformly approximated by a sequence of polynomial on$[-1;1]$. Consequently, so are the functions$x\mapsto \max(0,x)=(x+\mathopen|x\mathclose|)/2 $and$x\mapsto\min(0,x)=(x-\mathopen|x\mathclose|)/2$. By translation and dilation, every continuous piecewise linear function on$[-1;1]$with only one break point is uniformly approximated by polynomials. By linear combination, every continuous piecewise linear affine function is uniformly approximated by polynomials. By uniform continuity, every continuous function can be uniformly approximated by continuous piecewise linear affine functions. Weierstrass's theorem follows. 6. Moments. A linear subspace$A$of a Banach space is dense if and only if every continuous linear form which vanishes on$A$is identically$0$. In the present case, the dual of$C^0([-1;1],\mathbf C)$is the space of complex measures on$[-1;1]$(Riesz theorem, if one wish, or the definition of a measure). So let$\mu$be a complex measure on$[-1;1]$such that$\int_{-1}^1 t^n \,d\mu(t)=0$for every integer$n\geq 0$; let us show that$\mu=0$. This is the classical problem of showing that a complex measure on$[-1;1]$is determined by its moments. In fact, the classical proof of this fact runs the other way round, and there must exist ways to reverse the arguments. One such solution is given in Rudin's Real and complex analysis, where it is more convenient to consider functions on the interval$[0;1]$. So, let$F(z)=\int_0^1 t^z \,d\mu(t)$. The function$F$is holomorphic and bounded on the half-plane$\Re(z)> 0$and vanishes at the positive integers. At this point, Rudin makes a conform transformation to the unit disk (setting$w=(z-1)/(z+1)$) and gets a bounded function on the unit disk with zeroes at$(n-1)/(n+1)=1-2/(n+1)$, for$n\in\mathbf N$, and this contradicts the fact that the series$\sum 1/(n+1)$diverges. In Rudin, this method is used to prove the more general Müntz–Szász theorem according to which the family$(t^{\lambda_n})$generates a dense subset of$C([0;1])$if and only if$\sum 1/\lambda_n=+\infty$. Here is another solution I learnt in a paper by L. Carleson (“Mergelyan's theorem on uniform polynomial approximation”, Math. Scand., 1964). For every complex number$a$such that$\mathopen|a\mathclose|>1$, one can write$1/(t-a)$as a converging power series. By summation, this quickly gives that $F(a) = \int_{-1}^1 \frac{1}{t-a}\, d\mu(t) \equiv 0.$ Observe that this formula defines a holomorphic function on$\mathbf C\setminus[-1;1]$; by analytic continuous, one thus has$F(a)=0$for every$a\not\in[-1;1]$. Take a$C^2$-function$g$with compact support on the complex plane. For every$t\in\mathbf C$, one has the following formula $\iint \bar\partial g(z) \frac{1}{t-z} \, dx\,dy = g(t),$ which implies, by integration and Fubini, that $\int_{-1}^1 g(t)\,d\mu(t) = \iint \int \bar\partial g(z) \frac1{t-z}\,d\mu(t)\,dx\,dy = \iint \bar\partial g(z) F(z)\,dx\, dy= 0.$ On the other hand, every$C^2$function on$[-1;1]$can be extended to such a function$g$, so that the measure$\mu$vanishes on every$C^2$function on$[-1;1]$. Approximating a continuous function by a$C^2$function (first take a piecewise linear approximation, and round the corners), we get that$\mu$vanishes on every continuous function, as was to be proved. 7. Chebyshev/Markov systems. This proof is due to P. Borwein and taken from the book Polynomials and polynomial inequalities, by P. Borwein and T. Erdélyi (Graduate Texts in Maths, vol. 161, 1995). Let us say that a sequence$(f_n)$of continuous functions on an interval$I$is a Markov system (resp. a weak Markov system) if for every integer$n$, every linear combination of$(f_0,\dots,f_n)$has at most$n$zeroes (resp.$n$sign changes) in$I$. Given a Markov system$(f_n)$, one defines a sequence$(T_n)$, where$T_n-f_n$is the element of$\langle f_0,\dots,f_{n-1}\rangle$which is the closest to$f_n$. The function$T_n$has$n$zeroes on the interval$I$; let$M_n$be the maximum distance between two consecutive zeroes. Borwein's theorem (Theorem 4.1.1 in the mentioned book) then asserts that if the sequence$(f_n)$is a Markov system consisting of$C^1$functions, then its linear span is dense in$C(I)$if and only if$M_n\to 0$. The sequence of monomials$(x^n)$on$I=[-1;1]$is of course a Markov system. In this case, the polynomial$T_n$is the$n$th Chebyshev polynomial, given by$T_n(2\cos(x))=2\cos(nx)$, and its roots are given by$2\cos((\pi+2k\pi)/2n)$, for$k=0,\dots,n-1$, and$M_n\leq \pi/n$. This gives yet another proof of Weierstrass's approximation theorem. ## Wednesday, February 24, 2016 ### Sound and color Just back home from The Stone where I could hear two very interesting sets with pianist Russ Lossing and drummer Gerry Hemingway, first in duet, and then in quartet with Loren Stillman on alto saxophone and Samuel Blaser on trombone. I was absolutely excited at the prospect of returning to this avant-garde jazz hall (it has been my 3rd concert there, the first one was in 2010, with Sylvie Courvoisier, Thomas Morgan and Ben Perowski, and the second, last year, with Wadada Leo Smith and Vijay Iyer) to listen to Gerry Hemingway, and the cold rain falling on New York City did not diminish my enthusiasm. (Although I had to take care on the streets, for one could almost see nothing...) I feared I would arrive late, but Gerry Hemingway was still installing his tools, various sticks, small cymbals, woodblocks, as well as a cello bow... I admit, it took me some time to appreciate the music. Of course, it was free jazz (so what?) and I couldn't really follow the stream of music. Both musicians were acting delicately and skillfully (no discussion) at creating sound, as a painter would spread brush strokes on a canvas—and actually, Hemingway was playing a lot of brushes, those drum sticks made of many (wire or plastic) strings that have a delicate and not very resonating sound... Color after color, something was emerging, sound was being shaped. There is an eternal discussion about the nature of music (is it rhythm? melody? harmony?) and consequently about the role of each instrument in the shaping of the music. A related question is the way a given instrument should be used to produce sound. None of the obvious answers was to be heard tonight. Russ Lossing sometimes stroke the strings of the grand piano with mallets, something almost classical in avant-garde piano music. I should have been prepared by the concert of Tony Malaby's Tubacello, that I attended with François Loeser in Sons d'hiver a few weeks ago, where John Hollenbeck simultaneously played drums and prepared piano, but the playing of Gerry Hemingway brought me much surprise. He could blow on the heads of the drums, hit them with a woodblock or strange plastic mallets; he could make the cymbals vibrate by pressing the cell bow on it; he could also take the top hi-hat cymbal on the left hand, and then either hit it with a stick, or press it on the snare drum, thereby producing a mixture of snare/cymbal sound; during a long drum roll, he could also vary the pitch of the sound by pressing the drum head with his right foot—can you imagine the scene? It is while discussing with him in between the two sets that I gradually understood (some of) his musical conception. How everything is about sound and color. That's why he uses an immense palette of tools, to produce the sounds he feels would best fit the music. He also discussed extended technique, by which he means not the kind of drumistic virtuosity that could allow you (unfortunately, not me...) to play the 26 drum rudiments at 300bpm, but by extending the range of sounds he can consistently produce with his “basic Buddy Rich type instrument”—Google a picture of Terry Bozzio's drumkit if you don't see what I mean. He described himself as a colorist, who thinks of his instrument in terms of pitches; he also said how rhythm also exists in negative, when it is not played explicitly. A striking remark because it exactly depicted how I understand the playing of one of my favorite jazz drummers, Paul Motian, but whom I couldn't appreciate until I became able of hearing what he did not play. The second set did not sound as abstract as the first one. Probably the two blowing instruments helped giving the sound more flesh and more texture. Samuel Blaser, on the trombone, was absolutely exceptional—go listen at once for his Spring Rain album, an alliance of Jimmy Giuffre and contemporary jazz—and Loren Stillman sang very beautiful melodic lines on the alto sax. The four of them could also play in all combinations, and with extremly interesting dynamics, going effortlessly from one to another. And when a wonderful moment of thunder ended abruptly with the first notes of Paul Motian's Etude, music turned into pure emotion. ## Tuesday, February 9, 2016 ### Happy New Year! As was apparently first noticed by Noam Elkies, 2016 is the cardinality of the general linear group over the field with 7 elements,$G=\mathop{\rm GL}(2,\mathbf F_7)$. I was mentoring an agrégation lesson on finite fields this afternoon, and I could not resist having the student check this. Then came the natural question of describing the Sylow subgroups of this finite group. This is what I describe here. First of all, let's recall the computation of the cardinality of$G$. The first column of a matrix in$G$must be non-zero, hence there are$7^2-1$possibilities; for the second column, it only needs to be non-collinear to the first one, and each choice of the first column forbids$7$second columns, hence$7^2-7$possibilities. In the end, one has$\mathop{\rm Card}(G)=(7^2-1)(7^2-7)=48\cdot 42=2016$. The same argument shows that the cardinality of the group$\mathop{\rm GL}(n,\mathbf F_q)$is equal to$(q^n-1)(q^n-q)\cdots (q^n-q^{n-1})=q^{n(n-1)/2}(q-1)(q^2-1)\cdots (q^n-1)$. Let's go back to our example. The factorization of this cardinal comes easily:$2016=(7^2-1)(7^2-7)=(7-1)(7+1)7(7-1)=6\cdot 8\cdot 7\cdot 6= 2^5\cdot 3^2\cdot 7$. Consequently, there are three Sylow subgroups to find, for the prime numbers$2$,$3$and$7$. The cas$p=7$is the most classical one. One needs to find a group of order 7, and one such subgroup is given by the group of upper triangular matrices$\begin{pmatrix} 1 & * \\ 0 & 1\end{pmatrix}$. What makes things work is that$p$is the characteristic of the chosen finite field. In general, if$q$is a power of$p$, then the subgroup of upper-triangular matrices in$\mathop{\rm GL}(n,\mathbf F_q)$with$1$s one the diagonal has cardinality$q\cdot q^2\cdots q^{n-1}=q^{n(n-1)/2}$, which is exactly the highest power of$p$divising the cardinality of$\mathop{\rm GL}(n,\mathbf F_q)$. Let's now study$p=3$. We need to find a group$S$of order$3^2=9$inside$G$. There are a priori two possibilities, either$S\simeq (\mathbf Z/3\mathbf Z)^2$, or$S\simeq (\mathbf Z/9\mathbf Z)$. We will find a group of the first sort, which will that the second case doesn't happen, because all$3$-Sylows are pairwise conjugate, hence isomorphic. Now, the multiplicative group$\mathbf F_7^\times$is of order$6$, and is cyclic, hence contains a subgroup of order$3$, namely$C=\{1,2,4\}$. Consequently, the group of diagonal matrices with coefficients in$C$is isomorphic to$(\mathbf Z/3\mathbf Z)^2$and is our desired$3$-Sylow. Another reason why$G$does not contain a subgroup$S$isomorphic to$\mathbf Z/9\mathbf Z$is that it does not contain elements of order$9$. Let's argue by contradiction and consider a matrix$A\in G$such that$A^9=I$; then its minimal polynomial$P$divides$T^9-1$. Since$7\nmid 9$, the matrix$A$is diagonalizable over the algebraic closure of$\mathbf F_7$. The eigenvalues of$A$are eigenvalues are$9$th roots of unity, and are quadratic over$\mathbf F_7$since$\deg(P)\leq 2$. On the other hand, if$\alpha$is a$9$th root of unity belonging to$\mathbf F_{49}$, one has$\alpha^9=\alpha^{48}=1$, hence$\alpha^3=1$since$\gcd(9,48)=3$. Consequently,$\alpha$is a cubic root of unity and$A^3=1$, showing that$A$has order$3$. It remains to treat the case$p=2$, which I find slightly trickier. Let's try to find elements$A$in$G$whose order divides$2^5$. As above, it is diagonalizable in an algebraic closure, its minimal polynomial divides$T^{32}-1$, and its roots belong to$\mathbf F_{49}$, hence satisfy$\alpha^{32}=\alpha^{48}=1$, hence$\alpha^{16}=1$. Conversely,$\mathbf F_{49}^\times$is cyclic of order$48$, hence contains an element of order$16$, and such an element is quadratic over$\mathbf F_7$, hence its minimal polynomial$P$has degree$2$. The corresponding companion matrix$A$in$G$is an element of order$16$, generating a subgroup$S_1$of$G$isomorphic to$\mathbf Z/16\mathbf Z$. We also observe that$\alpha^8=-1$(because its square is$1$); since$A^8$is diagonalizable in an algebraic closure with$-1$as the only eigenvalue, this shows$A^8=-I$. Now, there exists a$2$-Sylow subgroup containing$S_1$, and$S_1$will be a normal subgroup of$S$(because its index is the smallest prime number dividing the order of$S$, which is$2$). This suggests to introduce the normalizer$N$of$S_1$in$G$. One then has$S_1\subset S\subset N$. Let$s\in S$be such that$s\not\in S_1$; then there exists a unique$k\in\{1,\dots,15\}$such that$s^{-1}As=A^k$, and$s^{-2}As^2=A^{k^2}=A$(because$s$has order$2$modulo$S_1$), hence$k^2\equiv 1\pmod{16}$—in other words,$k\equiv \pm1\pmod 8$. There exists a natural choice of$s$: the involution ($s^2=I$) which exchanges the two eigenspaces of$A$. To finish the computation, it's useful to take a specific example of polynomial$P$of degree$2$whose roots in$\mathbf F_{49}$are primitive$16$th roots of unity. In other words, we need to factor the$16$th cyclotomic polynomial$\Phi_{16}=T^8+1$over$\mathbf F_7$and find a factor of degree$2$; actually, Galois theory shows that all factors have the same degree, so that there should be 4 factors of degree$2$. To explain the following computation, some remark is useful. Let$\alpha$be a$16$th root of unity in$\mathbf F_{49}$; we have$(\alpha^8)^2=1$but$\alpha^8\neq 1$, hence$\alpha^8=-1$. If$P$is the minimal polynomial of$\alpha$, the other root is$\alpha^7$, hence the constant term of$P$is equal to$\alpha\cdot \alpha^7=\alpha^8=-1$. We start from$T^8+1=(T^4+1)^2-2T^4$and observe that$2\equiv 4^2\pmod 7$, so that$T^8+1=(T^4+1)^2-4^2T^4=(T^4+4T^2+1)(T^4-4T^2+1)$. To find the factors of degree$2$, we remember that their constant terms should be equal to$-1$. We thus go on differently, writing$T^4+4T^2+1=(T^2+aT-1)(T^2-aT-1)$and solving for$a$: this gives$-2-a^2=4$, hence$a^2=-6=1$and$a=\pm1$. The other factors are found similarly and we get $T^8+1=(T^2-T-1)(T^2+T-1)(T^2-4T-1)(T^2+4T-1).$ We thus choose the factor$T^2-T-1$and set$A=\begin{pmatrix} 0 & 1 \\ 1 & 1 \end{pmatrix}$. Two eigenvectors for$A$are$v=\begin{pmatrix} 1 \\ \alpha \end{pmatrix}$and$v'=\begin{pmatrix}1 \\ \alpha'\end{pmatrix}$, where$\alpha'=\alpha^7$is the other root of$T^2-T-1$. The equations for$B$are$Bv=v'$and$Bv'=v$; this gives$B=\begin{pmatrix} 1 & 0 \\ 1 & - 1\end{pmatrix}$. The subgroup$S=\langle A,B\rangle$generated by$A$and$B$has order$32$and is a$2$-Sylow subgroup of$G$. Generalizing this method involves finding large commutative$p$-subgroups (such as$S_1$) which belong to appropriate (possibly non-split) tori of$\mathop{\rm GL}(n)$and combining them with adequate parts of their normalizer, which is close to considering Sylow subgroups of the symmetric group. The paper Sylow$p$-subgroups of the classical groups over finite fields with characteristic prime to$p$by A.J. Weir gives the general description (as well as for orthogonal and symplectic groups), building on an earlier paper in which he constructed Sylow subgroups of symmetric groups. See also the paper Some remarks on Sylow subgroups of the general linear groups by C. R. Leedham-Green and W. Plesken which says a lot about maximal$p\$-subgroups of the general linear group (over non-necessarily finite fields). Also, the question was recently the subject of interesting discussions on MathOverflow.

[Edited on Febr. 14 to correct the computation of the 2-Sylow...]


text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# A doubling of the Sun's coronal magnetic field during the past 100 years

## Abstract

The solar wind is an extended ionized gas of very high electrical conductivity, and therefore drags some magnetic flux out of the Sun to fill the heliosphere with a weak interplanetary magnetic field1,2. Magnetic reconnection—the merging of oppositely directed magnetic fields—between the interplanetary field and the Earth's magnetic field allows energy from the solar wind to enter the near-Earth environment. The Sun's properties, such as its luminosity, are related to its magnetic field, although the connections are still not well understood3,4. Moreover, changes in the heliospheric magnetic field have been linked with changes in total cloud cover over the Earth, which may influence global climate5. Here we show that measurements of the near-Earth interplanetary magnetic field reveal that the total magnetic flux leaving the Sun has risen by a factor of 1.4 since 1964: surrogate measurements of the interplanetary magnetic field indicate that the increase since 1901 has been by a factor of 2.3. This increase may be related to chaotic changes in the dynamo that generates the solar magnetic field. We do not yet know quantitatively how such changes will influence the global environment.

This is a preview of subscription content

## Access options

$32.00 All prices are NET prices. ## References 1. Gazis, P. R. Solar cycle variation of the heliosphere. Rev. Geophys. 34, 379–402 (1996). 2. Balogh, A.et al. The heliospheric field over the south polar region of the sun. Science 268, 1007–1010 (1995). 3. Willson, R. C. Total solar irradiance trend during cycles 21 and 22. Science 277, 1963–1965 (1997). 4. Lean, J., Beer, J. & Bradley, R. Reconstruction of solar irradiance since 1610: implications for climate change. Geophys. Res. Lett. 22, 3195–3198 (1995). 5. Svensmark, H. & Friis-Christensen, E. Variation of cosmic ray flux and global cloud coverage—a missing link in solar-climate relationships. J. Atmos. Sol. Terr. Phys. 59, 1225–1232 (1997). 6. Mayaud, P. N. The aa indices: a 100-year series characterising the magnetic activity. J. Geophys. Res. 72, 6870–6874 (1972). 7. Stamper, R., Lockwood, M., Wild, M. N. & Clark, T. D. G. Solar causes of the long-term increase in geomagnetic activity. J. Geophys. Res.(in press). 8. Russell, C. T. On the possibility of deducing interplanetary and solar parameters from geomagnetic records. Sol. Phys. 42, 259–269 (1975). 9. Gringauz, K. I. in Solar Wind 4(ed. Rosenbauer, H.) (Rep. MPAE-W-100-81-31, MPI für Aeronomie, Lindau, Germany, (1981). 10. Feynman, J. & Crooker, N. U. The solar wind at the turn of the century. Nature 275, 626–627 (1978). 11. Baker, D. in Solar Wind-Magnetosphere Coupling(eds Kamide, Y. & Slavin, J. A.) 17–38 (Terra Scientific, Tokyo, (1986). 12. Wang, Y.-M. & Sheeley, N. R. J Solar implications of Ulysses interplanetary field measurements. Astrophys. J. 447, L143–L146 (1995). 13. Cliver, E. W., Boriakoff, V. & Bounar, K. H. The 22-year cycle of geomagnetic activity. J. Geophys. Res. 101, 27091–27109 (1996). 14. Silverman, S. W. Secular variation of the aurora for the past 500 years. Rev. Geophys. 30, 333–351 (1992). 15. Sonnet, C. P. Long-period solar terrestrial variability. Rev. Geophys. (Suppl.: US Nat. Rep. to IUGG 1987–1990 909–914 (1991). 16. Beer, J., Tobias, S. & Weiss, N. An active sun throughout the Maunder minimum. Sol. Phys. 181, 237–249 (1998). 17. Feynman, J. & Gabriel, S. B. Period and phase of the 88-year solar cycle and the Maunder minimum: evidence for the chaotic sun. Sol. Phys. 127, 393–403 (1990). 18. Cliver, E. W., Boriakoff, V. & Feynman, J. Solar variability and climate change: geomagnetic aa index and global surface temperature. Geophys. Res. Lett. 25, 1035–1038 (1998). 19. Vasyliunas, V. M., Kan, J. R., Siscoe, G. L. & Akasofu, S.-I. Scaling relations governing magnetospheric energy transfer. Planet Space Sci. 30, 359–365 (1982). 20. Scurry, L. & Russell, C. T. Proxy studies of energy transfer to the magnetosphere. J. Geophys. Res. 96, 9541–9548 (1991). 21. Merrill, R. T., McElhinny, M. W. & McFadden, P. L. The Magnetic Field of the Earth 34 (Academic, San Diego, (1996). 22. Wang, Y.-M., Hawley, S. H. & Sheeley, N. R. J The magnetic nature of coronal holes. Science 271, 464–469 (1996). 23. Sargent, H. H. in Solar Wind-Magnetosphere Coupling(eds Kamide, Y. & Slavin, J. A.) 143–148 (Terra Scientific, Tokyo, (1986). 24. Hapgood, M. A. Adouble solar-cycle variation in the 27-day recurrence of geomagnetic activity. Ann Geophys. 11, 248–253 (1993). 25. Webb, D. F. & Howard, R. A. The solar cycle variation of coronal mass ejections and solar wind mass flux. J. Geophys. Res. 99, 4201–4220 (1994). Download references ## Acknowledgements The data used are stored and made available via World Data Centre C1 for STP at RAL, which is funded by the UK Particle Physics and Astronomy Research Council and, until 1 April 1999, by the National Radio Propagation Programme of the Radiocommunications Agency. We also thank the many scientists who have contributed data to the WDC. ## Author information ### Authors and Affiliations Authors ### Corresponding author Correspondence to M. Lockwood. ## Rights and permissions Reprints and Permissions ## About this article ### Cite this article Lockwood, M., Stamper, R. & Wild, M. A doubling of the Sun's coronal magnetic field during the past 100 years. Nature 399, 437–439 (1999). https://doi.org/10.1038/20867 Download citation • Received: • Accepted: • Issue Date: • DOI: https://doi.org/10.1038/20867 ## Further reading • ### The solar cycle: predicting the peak of solar cycle 25 • Z. L. Du Astrophysics and Space Science (2020) • ### Evolution of the Sunspot Number and Solar Wind B$B\$ Time Series

• Edward W. Cliver
• Konstantin Herbst

Space Science Reviews (2018)

• ### An updated review about carbon dioxide and climate change

• Rex J. Fleming

Environmental Earth Sciences (2018)

• ### Tree-ring-width-based PDSI reconstruction for central Inner Mongolia, China over the past 333 years

• Yu Liu
• Xinjia Zhang
• Ruochen Mei

Climate Dynamics (2017)

By submitting a comment you agree to abide by our Terms and Community Guidelines. If you find something abusive or that does not comply with our terms or guidelines please flag it as inappropriate.

## Search

Sign up for the Nature Briefing newsletter — what matters in science, free to your inbox daily.

Get the most important science stories of the day, free in your inbox. Sign up for Nature Briefing


text:
# Math Help - Reordering terms affect the factorization of a square trinomial?

1. ## Reordering terms affect the factorization of a square trinomial?

I have the square trinomial
$25 - 10x + x^2$

If I factor it I get:
$(5 - x)^2$

but If I rearrange the addends in an order in which literal addend are to precede numerial addends,
$x^2 -10x + 25$,

and factor it I get:
$(x-5)^2$

aren't $25 - 10x + x^2$ and $x^2 -10x + 25$ equal in value?

Why do I get different square binomials?

2. $
\left( {x - 5} \right)^2 = \left[ {\left( { - 1} \right)\left( {5 - x} \right)} \right]^2 = \left( { - 1} \right)^2 \left( {5 - x} \right)^2 = \left( {5 - x} \right)^2$

3. ## They are not so different...

with some factoring we can show they are the same!

$(5-x)^2=[(-1)(-1)5+(-1)x]^2=[(-1)((-1)5+x)]^2=(-1)^2[(-1)5+x]^2=$

$(1)[x-5]=(x-5)^2$

4. thanks!

5. Originally Posted by Peritus
$
\left( {x - 5} \right)^2 = \left[ {\left( { - 1} \right)\left( {5 - x} \right)} \right]^2 = \left( { - 1} \right)^2 \left( {5 - x} \right)^2 = \left( {5 - x} \right)^2$
And in general, $(a - b)^2 = (b - a)^2$.

Even more generally:

$(a - b)^n = (b - a)^n$ if n is even

$(a - b)^n = -(b - a)^n$ if n is odd.

6. Originally Posted by mr fantastic
And in general, $(a - b)^2 = (b - a)^2$.

Even more generally:

$(a - b)^n = (b - a)^n$ if n is even

$(a - b)^n = -(b - a)^n$ if n is odd.
Thanks.


text:
# Think Bayes

Second Edition

In [1]:

# If we're running on Colab, install empiricaldist
# https://pypi.org/project/empiricaldist/

import sys

if IN_COLAB:
!pip install empiricaldist

In [2]:

# Get utils.py and create directories

import os

if not os.path.exists('utils.py'):
!wget https://github.com/AllenDowney/ThinkBayes2/raw/master/code/soln/utils.py

if not os.path.exists('figs'):
!mkdir figs

if not os.path.exists('tables'):
!mkdir tables

In [3]:

import numpy as np
import pandas as pd
import matplotlib.pyplot as plt

from empiricaldist import Pmf, Cdf
from utils import decorate, savefig, write_table

## Bayesian inference

Whenever people compare the Bayesian inference with conventional approaches, one of the questions that comes up most often is something like, "What about p-values?" And one of the most common examples is the comparison of two groups to see if there is a difference in their means.

In classical statistical inference, the usual tool for this scenario is a Student's t-test, and the result is a p-value. This process is an example of null hypothesis significance testing.

A Bayesian alternative is to compute the posterior distribution of the difference between the groups. Then we can use that distribution to answer whatever questions we are interested in, including the most likely size of the difference, a credible interval that's likely to contain the true difference, the probability of superiority, or the probability that the difference exceeds some threshold.

To demonstrate this process, I'll solve a standard problem from a statistical textbook, comparing the effect of an educational "treatment" compared to a control.

We'll use data from a Ph.D. dissertation in educational psychology written in 1987, which was used as an example in a statistics textbook from 1989 and published on DASL, a web page that collects data stories.

Here's the description from DASL:

An educator conducted an experiment to test whether new directed reading activities in the classroom will help elementary school pupils improve some aspects of their reading ability. She arranged for a third grade class of 21 students to follow these activities for an 8-week period. A control classroom of 23 third graders followed the same curriculum without the activities. At the end of the 8 weeks, all students took a Degree of Reading Power (DRP) test, which measures the aspects of reading ability that the treatment is designed to improve.

The dataset is available here; I have put it in a CSV file, which we can download like this:

In [4]:

import os

if not os.path.exists('drp_scores.csv'):
!wget https://github.com/AllenDowney/ThinkBayes2/raw/master/data/drp_scores.csv

I'll use Pandas to load the data into a DataFrame.

In [5]:

import pandas as pd

Out[5]:

Treatment
Response

0
Treated
24

1
Treated
43

2
Treated
58

3
Treated
71

4
Treated
43

I'll use groupby to separate the data for the Treated and Control groups:

In [6]:

grouped = df.groupby('Treatment')
responses = {}

for name, group in grouped:
responses[name] = group['Response']

Here are CDFs of the scores for the two groups and summary statistics.

In [7]:

for name, response in responses.items():
print(name, len(response), response.mean(), response.std())
cdf = Cdf.from_seq(response)
cdf.plot(label=name)

decorate(xlabel='Score', ylabel='CDF')
savefig('fig11-01')

Control 23 41.52173913043478 17.148733229699484
Treated 21 51.476190476190474 11.00735684721381

The distribution of scores is not exactly normal for either group, but it is close enough that the normal model is a reasonable choice.

So I'll assume that in the entire population of students (not just the ones in the experiment), the distribution of scores is well modeled by a normal distribution with unknown mean and standard deviation. I'll use mu and sigma to denote these unknown population parameters.

And we'll do a Bayesian update to estimate what they are.

## Estimating parameters

As always, we need a prior distribution for the parameters.
Since there are two parameters, it will be a joint distribution.
I'll construct it by choosing marginal distributions for each parameter and computing their outer product.

As a simple starting place, I'll assume that the prior distributions for mu and sigma are uniform.

In [8]:

mus = np.linspace(20, 80, 101)
prior_mu = Pmf(1, mus, name='mean')

In [9]:

sigmas = np.linspace(5, 30, 101)
prior_sigma = Pmf(1, sigmas, name='std')

In [10]:

from utils import outer_product

prior = outer_product(prior_mu, prior_sigma)

In [11]:

data = responses['Control']
data.shape

Out[11]:

(23,)

Now, we would like to know the probability of each score in the dataset for each hypothetical pair of values, mu and sigma. I'll do that by making a 3-dimensional grid with values of sigma on the first axis, values of mu on the second axis, and the scores from the dataset on the third axis.

In [12]:

sigmas, mus, data_mesh = np.meshgrid(prior.columns, prior.index, data)
sigmas.shape

Out[12]:

(101, 101, 23)

Now we can use norm.pdf to compute the probability density of each score for each hypothetical pair of parameters.

In [13]:

from scipy.stats import norm

densities = norm.pdf(data_mesh, sigmas, mus)
densities.shape

Out[13]:

(101, 101, 23)

The result is a 3-D array. To compute likelihoods, I'll compute the product of these densities along the third axis, that is axis=2:

In [14]:

likelihood = densities.prod(axis=2)
likelihood.shape

Out[14]:

(101, 101)

The result is a 2-D array that contains the likelihood of the entire dataset for each hypothetical pair of parameters.

We can use this array as part of a Bayesian update, as in this function:

In [15]:

from utils import normalize

def update_norm(prior, data):
"""Update the prior based on data.

prior: joint distribution of mu and sigma
data: sequence of observations
"""
X, Y, Z = np.meshgrid(prior.columns, prior.index, data)
likelihood = norm.pdf(Z, Y, X).prod(axis=2)

posterior = prior * likelihood
normalize(posterior)

return posterior

Here are the updates for the control and treatment groups:

In [16]:

data = responses['Control']
posterior_control = update_norm(prior, data)

In [17]:

data = responses['Treated']
posterior_treated = update_norm(prior, data)

And here's what they look like:

In [18]:

def plot_contour(joint, **options):
"""Plot a joint distribution.

joint: DataFrame representing a joint PMF
"""
cs = plt.contour(joint.columns, joint.index, joint, **options)
decorate(xlabel='Standard deviation', ylabel='Mean')
return cs

In [19]:

plot_contour(posterior_control, cmap='Blues')
plt.text(18, 49.5, 'Control', color='C0')

cs = plot_contour(posterior_treated, cmap='Oranges')
plt.text(12, 57, 'Treated', color='C1')

savefig('fig11-02')

Along the vertical axis, it looks like the mean score for the treated group is higher. Along the horizontal axis, it looks like the standard deviation for the control group is higher.

If we think the treatment causes these differences, the data suggest that the treatment increases the mean score and decreases their spread. We can see these differences more clearly by looking at the marginal distributions for mu and sigma.

## Posterior marginal distributions

I'll use marginal, which we saw in Chapter 9, to extract the posterior marginal distributions for the population means.

In [20]:

from utils import marginal

pmf_mean_control = marginal(posterior_control, 1)
pmf_mean_treated = marginal(posterior_treated, 1)

Here's what they look like:

In [21]:

pmf_mean_control.plot(label='Control')
pmf_mean_treated.plot(label='Treated')

decorate(xlabel='Population mean',
ylabel='PDF',
title='Posterior distributions of mu')

savefig('fig11-03')

It looks like we are pretty sure that the population mean in the treated group is higher. We can use prob_gt to compute the probability of superiority:

In [22]:

Pmf.prob_gt(pmf_mean_treated, pmf_mean_control)

Out[22]:

0.9804790251873259

There is a 98% chance that the mean in the treated group is higher.

We can use sub_dist to compute the distribution of the difference.

In [23]:

diff = Pmf.sub_dist(pmf_mean_treated, pmf_mean_control)

Two things to be careful about when you use methods like sub_dist:

The first is that the result usually contains more elements than the original Pmf.
In this example, the original distributions have the same quantities, so the size increase is moderate.

In [24]:

len(pmf_mean_treated), len(pmf_mean_control), len(diff)

Out[24]:

(101, 101, 879)

In the worst case, the size of the result can be the product of the sizes of the originals.

The other thing to be aware of is that plotting a Pmf does not always work well. In this example, if we plot the distribution of differences, the result is pretty noisy.

In [25]:

diff.plot()

decorate(xlabel='Difference in population means',
ylabel='PDF',
title='Posterior distribution of difference in mu')

There are two ways to work around that limitation. One is to plot the CDF, which smooths out the noise:

In [26]:

diff.make_cdf().plot()

decorate(xlabel='Difference in population means',
ylabel='CDF',
title='Posterior distribution of difference in mu')

The other option is to use kernel density estimation (KDE) to make a smooth approximation of the PDF on an equally-spaced grid.

In [27]:

from scipy.stats import gaussian_kde

def make_kde(pmf, n=101):
"""Make a kernel density estimate for a PMF.

pmf: Pmf object
n: number of points

returns: Pmf object
"""
kde = gaussian_kde(pmf.qs, weights=pmf.ps)
qs = np.linspace(pmf.qs.min(), pmf.qs.max(), n)
ps = kde.evaluate(qs)
pmf = Pmf(ps, qs)
pmf.normalize()
return pmf

Here's what it looks like.

In [28]:

make_kde(diff).plot()

decorate(xlabel='Difference in population means',
ylabel='PDF',
title='Posterior distribution of difference in mu')

savefig('fig11-04')

The mean is almost 10 points, which is substantial.

In [29]:

diff.mean()

Out[29]:

9.954413088940848

Finally, we can use credible_interval to compute a 90% credible interval.

In [30]:

diff.credible_interval(0.9)

Out[30]:

array([ 2.4, 17.4])

Based on the data, we are pretty sure the treatment improves test scores by 2 to 17 points.

## Using summary statistics

In this example the dataset is not very big, so it doesn't take too long to compute the probability of every score under every hypothesis. But the result is a 3-D array; for larger datasets, it might be too big to compute practically.

Also, with larger datasets the likelihoods get very small, sometimes so small that we can't compute them with normal floating-point arithmetic. That's because we are computing the probability of a particular dataset; the number of possible datasets is astronomically big, so the probability of any of them is very small.

An alternative is to compute a summary of the dataset and compute the likelihood of the summary. For example, if we compute the sample mean of the data and the sample standard deviation, we could compute the likelihood of those summary statistics under each hypothesis.

As an example, suppose we know that the population mean is 40 and the standard deviation is 17. We can make a norm object that represents a normal distribution with these parameters:

In [31]:

mu = 40
sigma = 17
dist = norm(mu, sigma)

Now suppose we draw 1000 samples from this distribution with sample size n=20. I'll use rvs, which generates a random sample, to simulate this experiment.

In [32]:

n = 20
samples = dist.rvs((1000, n))
samples.shape

Out[32]:

(1000, 20)

The result is an array with 1000 rows, each containing a sample with 20 columns.

If we compute the mean of each row, the result is an array that contains 1000 sample means; that is, each value is the mean of a sample with n=20.

In [33]:

sample_means = samples.mean(axis=1)
sample_means.shape

Out[33]:

(1000,)

Now, we would like to know what the distribution of these sample means is. Using the properties of the normal distribution, we can show that their distribution is normal with mean $\mu$ and standard deviation $\sigma/\sqrt{n}$:

In [34]:

dist_m = norm(mu, sigma/np.sqrt(n))

dist_m represents the "sampling distribution of the mean".
We can use it to make a Cdf that approximates the CDF of the sampling distribution

In [35]:

low, high = sample_means.min(), sample_means.max()
qs = np.linspace(low, high, 101)
ps = dist_m.cdf(qs)
cdf_m = Cdf(ps, qs)

The following figure shows this theoretical distribution along with the empirical distribution of the values in sample_means.

In [36]:

cdf_m.plot(label='Sampling distribution of the mean')
Cdf.from_seq(sample_means).plot(label='Distribution of sample means')

decorate(xlabel='Mean score',
ylabel='CDF')

The random sample means follow the theoretical distribution closely, as expected.

We can also compute standard deviations for each row in samples.

In [37]:

sample_stds = samples.std(axis=1)
sample_stds.shape

Out[37]:

(1000,)

The result is an array of sample standard deviations. We might wonder what the distribution of these values is. The derivation is not as easy, but if we transform the sample standard deviations like this:

$t = n s^2 / \sigma^2$

where $n$ is the sample size, $s$ is the sample standard deviation, and $\sigma$ is the population standard deviation, the transformed values follow a chi-square distribution with $n-1$ degrees of freedom.

Here are the transformed values.

In [38]:

transformed = n * sample_stds**2 / sigma**2

And I'll create a chi2 object that represents a chi-square distribution.

In [39]:

from scipy.stats import chi2

dist_s = chi2(n-1)

And a Cdf that approximates the CDF of the chi-square distribution.

In [40]:

low, high = transformed.min(), transformed.max()
qs = np.linspace(low, high, 101)
ps = dist_s.cdf(qs)
cdf_s = Cdf(ps, qs)

Now we can compare the theoretical distribution to the empirical distribution of the sample standard deviations.

In [41]:

cdf_s.plot(label='Sampling distribution of s')
Cdf.from_seq(transformed).plot(label='Distribution of sample s')

decorate(xlabel='Standard deviation of scores (transformed)',
ylabel='CDF')

The distribution of transformed sample standard deviations agrees with the theoretical distribution.

I think it is useful to check theoretical results like this, for a few reasons:

• It confirms that my understanding of the theory is correct,

• It confirms that the conditions where I am applying the theory are conditions where the theory holds,

• It confirms that the implementation details are correct. For many distributions, there is more than one way to specify the parameters. If you use the wrong specification, this kind of testing will help you catch the error.

Before we move on, I'll mention one other theoretical result we will use: Basu's theorem, which states that the sample mean and sample standard deviation are independent.

To see whether that's true, we can make a contour plot for the joint distribution of sample mean and sample standard deviation.

In [42]:

import seaborn as sns

sns.kdeplot(sample_stds, sample_means)

decorate(xlabel='Sample standard deviation', ylabel='Sample mean')

It looks like the axes of the ellipses are aligned with the axes, which indicates that the variables are independent.

## Update with summary statistics

Now we're ready to do an update. I'll compute summary statistics for the two groups.

In [43]:

summary = {}

for name, response in responses.items():
summary[name] = len(response), response.mean(), response.std()

summary

Out[43]:

{'Control': (23, 41.52173913043478, 17.148733229699484),
'Treated': (21, 51.476190476190474, 11.00735684721381)}

The result is a dictionary that maps from group name to a tuple that contains the sample size, n, the sample mean, m, and the sample standard deviation s, for each group.

I'll demonstrate the update with the summary statistics from the control group.

In [44]:

n, m, s = summary['Control']

I'll make a mesh with hypothetical values of mu on the vertical axis and values of sigma on the horizontal axis.

In [45]:

sigmas, mus = np.meshgrid(prior.columns, prior.index)
sigmas.shape

Out[45]:

(101, 101)

Now we can compute the likelihood of seeing the sample mean m for each pair of parameters.

In [46]:

like1 = norm.pdf(m, mus, sigmas/np.sqrt(n))

And use it to update the prior.

In [47]:

posterior1 = prior * like1
normalize(posterior1)
plot_contour(posterior1);

The joint posterior distribution is narrow along the vertical axis and wide along the horizontal axis, which indicates that the sample mean provides a lot of information about the population mean, but by itself it doesn't tell us much about the population standard deviation.

Let's see what happens if we update with only the standard deviation and not the mean. Here's the likelihood:

In [48]:

like2 = chi2.pdf(n * s**2 / sigmas**2, n-1)

And here's the update:

In [49]:

posterior2 = prior * like2
normalize(posterior2)
plot_contour(posterior2);

The posterior joint distribution is narrow along the horizontal axis and very wide along the vertical axis.

So the sample standard deviation provides information about the population standard deviation, but no information at all about the mean.

The following function does both updates, using the sample mean and standard deviation.

In [50]:

def update_norm_summary(prior, data):
"""Update a normal distribution based on summary statistics.

prior: DataFrame, joint prior distribution
data: tuple of sample size, sample mean, sample std
"""
n, m, s = data
sigmas, mus = np.meshgrid(prior.columns, prior.index)

like1 = norm.pdf(m, mus, sigmas/np.sqrt(n))
like2 = chi2.pdf(n * s**2 / sigmas**2, n-1)

posterior = prior * like1 * like2
normalize(posterior)

return posterior

Here are the updates for the two groups.

In [51]:

data = summary['Control']
posterior_control2 = update_norm_summary(prior, data)

In [52]:

data = summary['Treated']
posterior_treated2 = update_norm_summary(prior, data)

And here are the results.

In [53]:

plot_contour(posterior_control2, cmap='Blues')
plt.text(18, 49.5, 'Control', color='C0')

cs = plot_contour(posterior_treated2, cmap='Oranges')
plt.text(12, 57, 'Treated', color='C1');

Visually, these posterior joint distributions are similar to the ones we computed using the entire datasets, not just the summary statistics. But they are not exactly the same, as we can see by comparing the marginal distributions.

## Comparing marginals

Again, let's extract the marginal posterior distributions.

In [54]:

from utils import marginal

pmf_mean_control2 = marginal(posterior_control2, 1)
pmf_mean_treated2 = marginal(posterior_treated2, 1)

And compare them to results we got using the entire dataset.

In [55]:

pmf_mean_control.plot(color='gray')
pmf_mean_control2.plot(label='Control')
pmf_mean_treated.plot(color='gray')
pmf_mean_treated2.plot(label='Treated')

decorate(xlabel='Population mean',
ylabel='PDF',
title='Posterior distributions of mu')

savefig('fig11-05')

For both groups, the distribution of mu is a little wider when we use only the summary statistics; that is, we are a little less certain about the values of the means.

If we compute the posterior distribution of the difference in means, like this:

In [56]:

diff2 = Pmf.sub_dist(pmf_mean_treated2, pmf_mean_control2)
diff2.make_cdf().plot()

The mean difference is nearly the same.

In [57]:

diff.mean(), diff2.mean()

Out[57]:

(9.954413088940848, 9.954349600892307)

But the credible interval is a bit wider.

In [58]:

diff.credible_interval(0.9), diff2.credible_interval(0.9)

Out[58]:

(array([ 2.4, 17.4]), array([ 1.8, 18. ]))

That's because the update we did is based on the implicit assumption that the distribution of the data is actually normal. But it's not; as a result, when we replace the dataset with the summary statistics, we lose some information about the true distribution of the data. With less information, we are less certain about the parameters.

## Summary

In this chapter we used a joint distribution to represent prior probabilities for the parameters of a normal distribution, mu and sigma.

And we updated that distribution two ways: first using the entire dataset and the normal PDF; then using summary statistics, the normal PDF, and the chi-square PDF.

Using summary statistics is computationally more efficient, but it loses some information in the process.

Normal distributions appear in many domains, as well as other distributions that are well approximated by normal distributions. So the methods in this chapter are broadly applicable. The exercises at the end of the chapter will give you a chance to apply them.

## Exercises

Exercise: Looking again at the posterior joint distribution of mu and sigma, it seems like the standard deviation of the treated group might be lower; if so, that would suggest that the treatment is more effective for students with lower scores.

But before we speculate too much, we should estimate the size of the difference and see whether it might actually be 0.

As we did with the values of mu in the previous section, extract the posterior marginal distributions of sigma for the two groups. What is the probability that the standard deviation is higher in the control group?

Compute the distribution of the difference in sigma between the two groups. What is the mean of this difference? What is the 90% credible interval?

In [59]:

# Solution

pmf_std_control = marginal(posterior_control, 0)
pmf_std_treated = marginal(posterior_treated, 0)

In [60]:

# Solution

pmf_std_control.plot(label='Control')
pmf_std_treated.plot(label='Treated')

decorate(xlabel='Population standard deviation', ylabel='PDF',
title='Posterior distributions of sigma')

In [61]:

# Solution

Pmf.prob_gt(pmf_std_control, pmf_std_treated)

Out[61]:

0.9685103375300471

In [62]:

# Solution

diff = Pmf.sub_dist(pmf_std_control, pmf_std_treated)

In [63]:

# Solution

diff.mean()

Out[63]:

6.417171328172181

In [64]:

# Solution

diff.credible_interval(0.9)

Out[64]:

array([ 1. , 12.5])

In [65]:

# Solution

make_kde(diff).plot()

decorate(xlabel='Difference in population standard deviation',
ylabel='PDF',
title='Posterior distributions of difference in sigma')

## Exercise

An "effect size" is a statistic intended to quantify the magnitude of a phenomenon. If the phenomenon is a difference in means between two groups, a common way to quantify it is Cohen's effect size, denoted $d$.

If the parameters for Group 1 are $(\mu_1, \sigma_1)$, and the parameters for Group 2 are $(\mu_2, \sigma_2)$, Cohen's effect size is

$d = \frac{\mu_1 - \mu_2}{(\sigma_1 + \sigma_2)/2}$

Use the joint posterior distributions for the two groups to compute the posterior distribution for Cohen's effect size.

Hint: if enumerating all pairs from the two distributions takes too long, consider random sampling. One way to do that is to "stack" the joint distribution and convert it to a Pmf.

In [66]:

pmf = Pmf(posterior_treated.stack())
pmf.qs

Out[66]:

array([(20.0, 5.0), (20.0, 5.25), (20.0, 5.5), ..., (80.0, 29.5),
(80.0, 29.75), (80.0, 30.0)], dtype=object)

The result is a Pmf where the elements of qs are tuples containing possible pairs of $\mu$ and $\sigma$. The ps are the corresponding probabilities for each pair.

Pmf provides choice, which we can use to draw a sample of parameters from the posterior distribution.

In [67]:

sample_treated = pmf.choice(1000)
param1 = sample_treated[0]
param1

Out[67]:

(50.599999999999994, 10.0)

If you do the same for posterior_control, you can use the two samples to estimate the distribution of Cohen's effect size. Then compute the mean and 90% credible interval.

In [68]:

# Solution

pmf = Pmf(posterior_control.stack())
sample_control = pmf.choice(1000)
param2 = sample_control[0]
param2

Out[68]:

(35.0, 15.75)

In [69]:

# Solution

def cohen_effect(t):
"""Compute Cohen's effect size for difference in means.

t: tuple of (mu1, sigma1), (mu2, sigma2)

return: float
"""
(mu1, sigma1), (mu2, sigma2) = t
sigma = (sigma1 + sigma2) / 2
return (mu1 - mu2) / sigma

In [70]:

# Solution

cohen_effect((param1, param2))

Out[70]:

1.2116504854368928

In [71]:

# Solution

a = np.transpose([sample_treated, sample_control])

ds = np.apply_along_axis(cohen_effect, 1, a)
ds.shape

Out[71]:

(1000,)

In [72]:

# Solution

cdf = Cdf.from_seq(ds)
cdf.plot()

decorate(xlabel='Cohen effect size',
ylabel='CDF',
title='Posterior distributions of effect size')

In [73]:

# Solution

cdf.mean()

Out[73]:

0.6694533086779044

In [74]:

# Solution

cdf.credible_interval(0.9)

Out[74]:

array([0.13846154, 1.2       ])

Exercise: This exercise is inspired by a question that appeared on Reddit.

An instructor announces the results of an exam like this, "The average score on this exam was 81. Out of 25 students, 5 got more than 90, and I am happy to report that no one failed (got less than 60)."

Based on this information, what do you think the standard deviation of scores was?

You can assume that the distribution of scores is approximately normal. And let's assume that the sample mean, 81, is actually the population mean, so we only have to estimate sigma.

Hint: To compute the probability of a score greater than 90, you can use norm.sf, which computes the survival function, also known as the complementary CDF, or 1 - cdf(x).

In [75]:

# Solution

hypos = np.linspace(1, 41, 101)

In [76]:

# Solution

# Here's are the probabilities of a score greater than 90
# for each hypothetical value of sigma.

from scipy.stats import norm

pgt90 = norm(81, hypos).sf(90)
pgt90.shape

Out[76]:

(101,)

In [77]:

# Solution

# And here's the chance that 5 out of 25 people
# get a score greater than 90

from scipy.stats import binom

likelihood1 = binom(25, pgt90).pmf(5)
likelihood1.shape

Out[77]:

(101,)

In [78]:

# Solution

prior = Pmf(1, hypos)
posterior = prior * likelihood1
posterior.normalize()

Out[78]:

6.317005127828177

In [79]:

# Solution

# Here's the posterior after the first update.

posterior.plot()
decorate(xlabel='Standard deviation',
ylabel='PMF')

In [80]:

# Solution

# Here's the probability of a score greater than 60

pgt60s = norm(81, hypos).sf(60)

In [81]:

# Solution

# And here's the probability that all 25 students exceed 60

likelihood2 = pgt60s ** 25

In [82]:

# Solution

plt.plot(hypos, likelihood2)
decorate(xlabel='Standard deviation',
ylabel='Likelihood')

In [83]:

# Solution

# Here's the posterior after both updates

prior = Pmf(1, hypos)
prior.normalize()
posterior2 = prior * likelihood1 * likelihood2
posterior2.normalize()

Out[83]:

0.017818005085371375

In [84]:

# Solution

posterior.plot(label='Posterior 1')
posterior2.plot(label='Posterior 2')

decorate(xlabel='Standard deviation',
ylabel='PMF')

In [85]:

# Solution

posterior.mean(), posterior2.mean()

Out[85]:

(16.799831236365335, 10.189340289326903)

In [86]:

# Solution

posterior2.credible_interval(0.9)

Out[86]:

array([ 7., 15.])

Exercise: I have a soft spot for crank science, so this exercise is about the Variability Hypothesis, which

"originated in the early nineteenth century with Johann Meckel, who argued that males have a greater range of ability than females, especially in intelligence. In other words, he believed that most geniuses and most mentally retarded people are men. Because he considered males to be the ’superior animal,’ Meckel concluded that females’ lack of variation was a sign of inferiority."

I particularly like that last part because I suspect that if it turned out that women were more variable, Meckel would have taken that as a sign of inferiority, too.

Nevertheless, the Variability Hypothesis suggests an exercise we can use to practice the methods in this chapter. Let's look at the distribution of heights for men and women in the U.S. and see who is more variable.

I used 2018 data from the CDC’s Behavioral Risk Factor Surveillance System (BRFSS), which includes self-reported heights from 154407 men and 254722 women.

Here's what I found:

• The average height for men is 178 cm; the average height for women is 163 cm. So men are taller on average; no surprise there.

• For men the standard deviation is 8.27 cm; for women it is 7.75 cm. So in absolute terms, men's heights are more variable.

But to compare variability between groups, it is more meaningful to use the coefficient of variation (CV), which is the standard deviation divided by the mean. It is a dimensionless measure of variability relative to scale.

For men CV is 0.0465; for women it is 0.0475. The coefficient of variation is higher for women, so this dataset provides evidence against the Variability Hypothesis. But we can use Bayesian methods to make that conclusion more precise.

Use these summary statistics to compute the posterior distribution of mu and sigma for the distributions of male and female height. Use Pmf.div_dist to compute posterior distributions of CV. Based on this dataset and the assumption that the distribution of height is normal, what is the probability that the coefficient of variation is higher for men? What is the most likely ratio of the CVs and what is the 90% credible interval for that ratio?

Hint: Use different prior distributions for the two groups, and chose them so they cover all parameters with non-negligible probability.

Also, you might find this function helpful:

In [87]:

def get_posterior_cv(joint):
"""Get the posterior distribution of CV.

joint: joint distribution of mu and sigma

returns: Pmf representing the smoothed posterior distribution
"""
pmf_mean = marginal(joint, 1)
pmf_std = marginal(joint, 0)
pmf_cv = Pmf.div_dist(pmf_std, pmf_mean)
return make_kde(pmf_cv)

In [88]:

# Solution

n = 154407
mean = 178
std = 8.27

In [89]:

# Solution

mus = np.linspace(mean-0.1, mean+0.1, 101)
prior_mu = Pmf(1, mus, name='mean')

sigmas = np.linspace(std-0.1, std+0.1, 101)
prior_sigma = Pmf(1, sigmas, name='std')

prior = outer_product(prior_mu, prior_sigma)

In [90]:

# Solution

data = n, mean, std
posterior_male = update_norm_summary(prior, data)
plot_contour(posterior_male, cmap='Blues');

In [91]:

# Solution

n = 254722
mean = 163
std = 7.75

In [92]:

# Solution

mus = np.linspace(mean-0.1, mean+0.1, 101)
prior_mu = Pmf(1, mus, name='mean')

sigmas = np.linspace(std-0.1, std+0.1, 101)
prior_sigma = Pmf(1, sigmas, name='std')

prior = outer_product(prior_mu, prior_sigma)

In [93]:

# Solution

data = n, mean, std
posterior_female = update_norm_summary(prior, data)
plot_contour(posterior_female, cmap='Oranges');

In [94]:

# Solution

pmf_cv_male = get_posterior_cv(posterior_male)
make_kde(pmf_cv_male).plot()

pmf_cv_female = get_posterior_cv(posterior_female)
make_kde(pmf_cv_female).plot()

decorate(xlabel='Coefficient of variation',
ylabel='PDF',
title='Posterior distributions of CV')

In [95]:

# Solution

ratio_cv = Pmf.div_dist(pmf_cv_female, pmf_cv_male)
ratio_cv.max_prob()

Out[95]:

1.0233615721208176

In [96]:

# Solution

ratio_cv.credible_interval(0.9)

Out[96]:

array([1.0193799 , 1.02734473])

In [ ]:


text:
# Geometrical Representation of Arithmetic Series – Terminology and Trapezia

Author(s):
Gautami Bhowmik (Université de Lille)

The systematic study of series, śreḍhī-vyavahāra (literally "series-practices") in Sanskrit, forms part of texts of arithmetic and mensuration called pāṭīgaṇita. Here we will consider finite arithmetic progressions where the difference between two consecutive entries is always the same.

To explain the historical descriptions, we will use modern notations when necessary. We note that the original texts contain no mathematical symbols and descriptions are given entirely in words. Thus the sum of a series is described as follows (Pāṭīgaṇita, v. 85.1):

The common difference multiplied by one-half of the number of terms minus one, increased by the first term, then multiplied by the number of terms, gives the sum of the series.

The Sanskrit terms used here are ādi for the first term, caya for the common difference, pada for the number of terms, and gaṇita for the sum. Rewritten in terms familiar to us: a generic arithmetic series containing $n$ terms, beginning with a first term $a$ and increasing by a common difference $d,$ has the sum $S_n,$ given by $S_n=\left(\left(\frac{n-1}{2}\right)\,d +a\right)n.$ We now recognize the familiar result!

Associated to a series $S,$ we will describe a geometric figure whose total area equals $S_n$ and whose partial areas equal the partial sums of the series (the units are neglected, since an area and a sum have necessarily different units). Such a figure is known as śreḍhī-kṣetra, which literally means “series-area.” Notice the following comparison, which brings to mind our teacup (Pāṭīgaṇita, v. 79):

As for an earthen pot [śarāva in Sanskrit], the width of the base is smaller and the top larger, so is it for a series-area.

Figure 5. Geometric figure representing the sum of an arithmetic progression, or “series-area”

If we geometrically represent each term of the series by a rectangle with the same length as that term and with breadth 1, then the sum of the areas of the pile of rectangles would give the sum of the series. The representation in Figure 5 looks more like the front view of a staircase than a regular geometric figure.

Figure 6. Staircase in Lille, France

But what happens when we rearrange the rectangles a little? Imagine inverting the figure (so it looks more like an earthen pot or teacup) and smoothing it by drawing a line to remove the protruding parts (green) of the rectangles on the right and pasting these “extra” triangles on the other side (red), as shown in Figure 7. Now we get a trapezium with the same area as that of the staircase.

Figure 7. “Staircase” shape inverted and smoothed into a trapezium

Figure 8. Trapezium with area equal to the sum of the arithmetic progression

Furthermore, each term of the series, beginning with the first, is represented as the area of a trapezium. The following text describes this correspondence for the simplest case, i.e. when there is one term (Pāṭīgaṇita, v. 81).

The number of terms which is one is the altitude [lamba] of the series-figure, the first term of the series diminished by half the common difference of the series is the base [dharā], and [the base] increased by the common difference is the face [vaktra].

Let $b,$ $f,$ and $h$ be the base (lower edge in Figure 8), face (top edge in Figure 8), and altitude (or height) of the figure. Then $b=a-\frac{d}{2}$ and $f=b+d=a-\frac{d}{2}+d$ for $h=n=1.$ This is precisely what we have obtained and the trapezium obtained does resemble a two-dimensional teacup!

We emphasize the fact that these descriptions were written in verse with strict metrical rules (lost in translation, alas!) meant to be learnt by heart. Thus they are cryptic and more “rules” than “proofs.” The reader must convince himself that these rules are indeed valid.

For instance the rearrangement we described above (which is a reconstruction of how the ancients might have argued) can be symbolically written as

 $S_n$ $= a+(a+d)+\cdots +(a+(n-1)d)$ $={\left(a-\frac{d}{2}\right)}+{\frac{d}{2}}+{\left(a+d-\frac{d}{2}\right)}+{\frac{d}{2}}+\cdots+{\left(a+(n-1)d-\frac{d}{2}\right)} +{\frac{d}{2}}.$

To each term of a given series is associated a rectangle (in blue) with height 1 and two triangles (in red) the sum of whose areas is the corresponding term of the series. To obtain the area of the series-figure we use the following simple fact (Pāṭīgaṇita, v. 85.2):

The area [phala] of the [corresponding] series-figure is equal to the product of half of the sum of the base and face, and the altitude.

This is the familiar formula for the area of a trapezium. Thus, when the base is $a-\frac{d}{2},$ the face $a-\frac d{2}+nd,$ and the altitude $n,$ we get the area $\frac 1 {2}\left(a-\frac d{2}+a-\frac d{2}+nd\right)n=\left(a+(n-1)\frac{d}{2}\right) n=S_n.$ The area of each rectangle with its two triangles gives the corresponding term of the series. Thus the lowest rectangle of length $a-\frac {d}{2}$ and height $1$ is $a-\frac{d}{2}.$ The sum of the areas of the two triangles is $\frac d {2}$ and these two areas add up to give $a,$ the first term of the series. The area of the trapezium above the lowest one is $\frac 1{2}(a+\frac d{2}+a+\frac {3d}{2})=a+d,$ the second term of the series, and so on.

Notice that if we used the first term of the series as the base and the $n$th term as the face of the trapezium, its area would still give the sum of the $n$ terms but the previous terms would no longer correspond nicely to its subsections.

Figure 9. Series-area, or series-figure, with base (of length $a$) not reduced

Gautami Bhowmik (Université de Lille), "Geometrical Representation of Arithmetic Series – Terminology and Trapezia," Convergence (December 2015)