text:
# partial differential equation of order 6

is it possible to solve a partial differential equation of order 6 with Mathematica? I tried "DSolve[eq,u,{s,t}]" but the output is just the same as the input. I also tried to add the boundary- and initial-conditions but it doesn't help. May you help me?

To specify my issue, i have to solve the following equation:

eq = -1.3248*^9 - 0.224*(-1.224*Derivative[0, 4][u][s, t] - 1.3248000000000002*^7*Derivative[2, 2][u][s, t]) + 0.224*Derivative[2, 4][u][s, t] + 8.28*^10*(-0.00016*(-1.224*Derivative[0, 2][u][s, t] - 1.3248000000000002*^7*Derivative[2, 0][u][s, t]) - 0.00016*(-1.224*Derivative[2, 2][u][s, t] - 1.3248000000000002*^7*Derivative[4, 0][u][s, t])) - 8.28*^10*(0.00016*Derivative[2, 2][u][s, t] + 0.00016*Derivative[4, 2][u][s, t]) - 8.28*^10*(-0.224*Derivative[2, 2][u][s, t] - 0.00016*(-0.224*Derivative[2, 2][u][s, t] + 8.28*^10*(0.00016*Derivative[2, 0][u][s, t] + 0.00016*Derivative[4, 0][u][s, t])) + 8.28*^10*(0.00016*Derivative[2, 0][u][s, t] + 0.00016*Derivative[4, 0][u][s, t]) - 0.224*Derivative[4, 2][u][s, t] + 8.28*^10*(0.00016*Derivative[4, 0][u][s, t] + 0.00016*Derivative[6, 0][u][s, t])) == 0

and

DSolve[{eq}, u, {s, t}]

just gives me the input back. Even adding boundary conditions doesn't lead to a solution.

What do I do wrong?

I hope you can help me! :)

• I don't think that this will work. First, you should us NDSolve to obtain numerical solutions. I'd say that one cannot hope for symbolic solutions. Second, you might have to specify a domain along with boundary conditions for the PDE. 3.) I doubt that Mathematica's FEM tools can handle PDEs of sixth order directly (Mathematica uses only $C^0$ elements while $C^2$ elements would be necessary.) But maybe you can reformulate your PDE as a coupled sytem of PDE of second order? – Henrik Schumacher Apr 19 '18 at 15:22
• Those coefficients make me sick, literally. This is not supposed to be solve by anything numerical. – Vsevolod A. Apr 19 '18 at 19:03

format: plain


text:
# Source code for astropy.visualization.wcsaxes.patches

# Licensed under a 3-clause BSD style license - see LICENSE.rst

import numpy as np
from matplotlib.patches import Polygon

from astropy import units as u
from astropy.coordinates.representation import UnitSphericalRepresentation
from astropy.coordinates.matrix_utilities import rotation_matrix, matrix_product

def _rotate_polygon(lon, lat, lon0, lat0):
"""
Given a polygon with vertices defined by (lon, lat), rotate the polygon
such that the North pole of the spherical coordinates is now at (lon0,
lat0). Therefore, to end up with a polygon centered on (lon0, lat0), the
polygon should initially be drawn around the North pole.
"""

# Create a representation object
polygon = UnitSphericalRepresentation(lon=lon, lat=lat)

# Determine rotation matrix to make it so that the circle is centered
# on the correct longitude/latitude.
m1 = rotation_matrix(-(0.5 * np.pi * u.radian - lat0), axis='y')
m2 = rotation_matrix(-lon0, axis='z')
transform_matrix = matrix_product(m2, m1)

# Apply 3D rotation
polygon = polygon.to_cartesian()
polygon = polygon.transform(transform_matrix)
polygon = UnitSphericalRepresentation.from_cartesian(polygon)

return polygon.lon, polygon.lat

[docs]class SphericalCircle(Polygon):
"""
Create a patch representing a spherical circle - that is, a circle that is
formed of all the points that are within a certain angle of the central
coordinates on a sphere. Here we assume that latitude goes from -90 to +90

This class is needed in cases where the user wants to add a circular patch
to a celestial image, since otherwise the circle will be distorted, because
a fixed interval in longitude corresponds to a different angle on the sky
depending on the latitude.

Parameters
----------
center : tuple or ~astropy.units.Quantity
This can be either a tuple of two ~astropy.units.Quantity objects, or
a single ~astropy.units.Quantity array with two elements.
radius : ~astropy.units.Quantity
resolution : int, optional
The number of points that make up the circle - increase this to get a
smoother circle.
vertex_unit : ~astropy.units.Unit
The units in which the resulting polygon should be defined - this
should match the unit that the transformation (e.g. the WCS
transformation) expects as input.

Notes
-----
Additional keyword arguments are passed to ~matplotlib.patches.Polygon
"""

def __init__(self, center, radius, resolution=100, vertex_unit=u.degree, **kwargs):

# Extract longitude/latitude, either from a tuple of two quantities, or
# a single 2-element Quantity.
longitude, latitude = center

# Start off by generating the circle around the North pole
lon = np.linspace(0., 2 * np.pi, resolution + 1)[:-1] * u.radian

lon, lat = _rotate_polygon(lon, lat, longitude, latitude)

# Extract new longitude/latitude in the requested units
lon = lon.to_value(vertex_unit)
lat = lat.to_value(vertex_unit)

# Create polygon vertices
vertices = np.array([lon, lat]).transpose()

super().__init__(vertices, **kwargs)

"""
Create a patch representing a latitude-longitude quadrangle.

The edges of the quadrangle lie on two lines of constant longitude and two
lines of constant latitude (or the equivalent component names in the
coordinate frame of interest, such as right ascension and declination).
Note that lines of constant latitude are not great circles.

Unlike matplotlib.patches.Rectangle, the edges of this patch will render
as curved lines if appropriate for the WCS transformation.

Parameters
----------
anchor : tuple or ~astropy.units.Quantity
This can be either a tuple of two ~astropy.units.Quantity objects, or
a single ~astropy.units.Quantity array with two elements.
width : ~astropy.units.Quantity
The width of the quadrangle in longitude (or, e.g., right ascension)
height : ~astropy.units.Quantity
The height of the quadrangle in latitude (or, e.g., declination)
resolution : int, optional
The number of points that make up each side of the quadrangle -
increase this to get a smoother quadrangle.
vertex_unit : ~astropy.units.Unit
The units in which the resulting polygon should be defined - this
should match the unit that the transformation (e.g. the WCS
transformation) expects as input.

Notes
-----
Additional keyword arguments are passed to ~matplotlib.patches.Polygon
"""

def __init__(self, anchor, width, height, resolution=100, vertex_unit=u.degree, **kwargs):

# Extract longitude/latitude, either from a tuple of two quantities, or
# a single 2-element Quantity.
longitude, latitude = u.Quantity(anchor).to_value(vertex_unit)

# Convert the quadrangle dimensions to the appropriate units
width = width.to_value(vertex_unit)
height = height.to_value(vertex_unit)

# Create progressions in longitude and latitude
lon_seq = longitude + np.linspace(0, width, resolution + 1)
lat_seq = latitude + np.linspace(0, height, resolution + 1)

# Trace the path of the quadrangle
lon = np.concatenate([lon_seq[:-1],
np.repeat(lon_seq[-1], resolution),
np.flip(lon_seq[1:]),
np.repeat(lon_seq[0], resolution)])
lat = np.concatenate([np.repeat(lat_seq[0], resolution),
lat_seq[:-1],
np.repeat(lat_seq[-1], resolution),
np.flip(lat_seq[1:])])

# Create polygon vertices
vertices = np.array([lon, lat]).transpose()

super().__init__(vertices, **kwargs)


text:
# Information structure

===========  ================================================
Field        Description
===========  ================================================
tau          Value of :math:\tau in final Lasso subproblem
rNorm        Norm of the final residual
gNorm        Norm of the final gradient vector
rGap         Relative duality gap
stat         Exit status (see below)
success      Exit status (see below)
statusStr    Exit status (see below)
iter         Number of iterations
nProdA       Number of products with A
nProdAt      Number of products with A transpose
nNewton      Number of Newton root-finding iterations
timeProject  Time spent in the projection function
timeMatProd  Time spent in matrix-vector products
timeTotal    Total runtime
options      Options provided to the solver
xNorm1       History of the primal norm of x (optional)
rNorm2       History of the residual norm (optional)
lambda       History of the gradient norm (optional)
===========  ================================================

The history fields are updated every iteration if options.history is set to true.


text:
# nLab rational number

Rational numbers

### Context

#### Algebra

higher algebra

universal algebra

# Rational numbers

## Definition

A rational number is a fraction of two integer numbers.

### As a field

The field of rational numbers, $\mathbb{Q}$, is the field of fractions of the commutative ring of integers, $\mathbb{Z}$, hence the field consisting of formal fractions (“ratios”) of integers.

### As a commutative ring

Let $(\mathbb{N}^+,1:\mathbb{N}^+,s:\mathbb{N}^+\to \mathbb{N}^+)$ be the set of positive integers. The positive integers are embedded into every commutative ring $R$: there is an injection $inj:\mathbb{N}^+\to\R$ such that $inj(1) = 1$ and $inj(s(n)) = inj(n) + 1$ for all $n:\mathbb{N}^+$.

Suppose $R$ has an injection $inv:\mathbb{N}^+\to\R$ such that $inj(n) \cdot inv(n) = 1$ and $\inv(n) \cdot \inj(n) = 1$ for all $n:\mathbb{N}^+$. Then $R$ is called a $\mathbb{Q}$-algebra, and the commutative ring of rational numbers $\mathbb{Q}$ is the initial commutative $\mathbb{Q}$-algebra.

It can then be proven from the ring axioms and the properties of the integers that every rational number apart from zero and has a multiplicative inverse, making $\mathbb{Q}$ a field.

### As an directed colimit in CRing

Let $(\mathbb{N},\leq)$ be the directed set of positive integers, and let $A:\mathbb{N}\to CRing$ be a family of commutative rings where $A_n$ is defined to be $\mathbb{Z}[1/n!]$, the localization of the integers $\mathbb{Z}$ away from the factorial $n!$, and for $i, j:\mathbb{N}$, $i\leq j$, there is a commutative ring homomorphism from $f_{ij}:\mathbb{Z}[1/i!]\to\mathbb{Z}[1/j!]$, with $f_{ii}$ being the identity commutative ring homomorphism on $\mathbb{Z}[1/i!]$. Then the commutative ring of rational numbers $\mathbb{Q}$ is the directed colimit $\underset{\to}\lim_i A_i$ of the system.

### As an abelian group

Let $(\mathbb{N}^+,1:\mathbb{N}^+,s:\mathbb{N}^+\to \mathbb{N}^+)$ be the set of positive integers and let $(\mathbb{Z},0,+,-,1)$ be the free abelian group on the set ${1}$.

Let $A$ be an abelian group containing $\mathbb{Z}$ as an abelian subgroup. The positive integers are embedded into the function abelian group $A \to A$, with $id_A:A \to A$ being the identity function on $A$; i.e. there is an injection $inj:\mathbb{N}^+\to (A \to A)$ such that $inj(1) = id_A$ and $inj(s(n)) = inj(n) + id_A$ for all $n:\mathbb{N}^+$.

Suppose $A$ has an injection $inv:\mathbb{N}^+\to (A \to A)$ such that for all $n:\mathbb{N}^+$, $inj(n) \circ inv(n) = id_A$ and $inv(n) \circ inj(n) = id_A$. Then the abelian group of rational numbers $\mathbb{Q}$ is the initial such abelian group.

## Properties

### Algebraic closure

The algebraic closure $\overline{\mathbb{Q}}$ of the rational numbers is called the field of algebraic numbers. The absolute Galois group $Gal(\overline{\mathbb{Q}}\vert \mathbb{Q})$ has some curious properties, see there.

### Topologies

There are several interesting topologies on $\mathbb{Q}$ that make $\mathbb{Q}$ into a topological group under addition, allowing us to define interesting fields by taking the completion with respect to this topology:

1. The discrete topology is the most obvious, which is already complete.

2. The absolute-value topology is defined by the metric $d(x,y) \coloneqq {|x - y|}$; the completion is the field of real numbers.

(This topology is totally disconnected (this exmpl.))

3. Fixing a prime number $p$, the $p$-adic topology is defined by the ultrametric $d(x,y) \coloneqq 1/n$ where $n$ is the highest exponent on $p$ in the prime factorization of ${|x - y|}$; the completion is the field of $p$-adic numbers.

According to Ostrowski's theorem this are the only possibilities.

Interestingly, (2) cannot be interpreted as a localic group, although the completion $\mathbb{R}$ can. (Probably the same holds for (3); I need to check.)

Last revised on May 8, 2021 at 14:34:29. See the history of this page for a list of all contributions to it.


text:
Borůvka's algorithm

Borůvka's algorithm is used to find the minimum/maximum spanning tree in the given graph (a spanning tree, in which is the sum of its edges weights minimal/maximal). The algorithm was developed in 1926 by Czech mathematician Otakar Borůvka, when he was trying to find an optimal routing for the electrical grid in Moravia. Because the algorithm was later several times reinvented (among others by M. Sollin), the procedure is also sometimes called Sollin's algorithm.

## Description

The Borůvka's algorithm is based on merging of disjoint components. At the beginning of the procedure each vertex is considered as a separate component. In each step the algorithm connects (merges) every component with some other using strictly the cheapest outgoing edge of the given component (every edge must have a unique weight). This way it is guaranteed that no cycle may occur in the spanning tree.

Because every step connects at least half of the currently unconnected components, it is clear that the algorithm terminates in steps. Because each step takes up to operations to find the cheapest outgoing edge for all the components, the asymptotic complexity of Borůvka's algorithm is .

### Parallelization of the algorithm

A significant advantage of the Borůvka's algorithm is that is might be easily parallelized, because the choice of the cheapest outgoing edge for each component is completely independent of the choices made by other components.

## Code

/**
* Boruvka's algorithm
*
* @param graph graph (each edge has a different weight)
* @param weight weights of all the edges
* @return minimal spanning tree
*/
boruvkaAlgorithm(graph, weight)
SpanningTree tree //spanning tree
components = graph.vertices //at the beginning every vertex is a component
while components.size > 1 do
for each component in components
edge e = connectWithMinimalEdge(component, weight) //connect with some other component using a minimal edge
return tree


text:
# Unit Fractions – Definition with Examples

## What is a Unit Fraction?

In math, a unit fraction can be defined as a fraction whose numerator is 1. It represents 1 shaded part of all the equal parts of the whole.

Here are a few examples of unit fractions.

## Let’s Sing!

One part of a whole,
One candy from a full bowl!
One piece from an apple pie.
Unit stay units, even when multiplied!


text:
location:  Publications → journals
Search results

Search: All articles in the CMB digital archive with keyword $E_7$

 Expand all        Collapse all Results 1 - 1 of 1

1. CMB 2013 (vol 56 pp. 795)

MacDonald, Mark L.
 Upper Bounds for the Essential Dimension of $E_7$ This paper gives a new upper bound for the essential dimension and the essential 2-dimension of the split simply connected group of type $E_7$ over a field of characteristic not 2 or 3. In particular, $\operatorname{ed}(E_7) \leq 29$, and $\operatorname{ed}(E_7;2) \leq 27$. Keywords:$E_7$, essential dimension, stabilizer in general positionCategories:20G15, 20G41
 top of page | contact us | privacy | site map |


text:
# The Arctic Research of the Composition of the Troposphere from Aircraft and Satellites (ARCTAS) Mission: Design, Execution, and First Results

 Title: The Arctic Research of the Composition of the Troposphere from Aircraft and Satellites (ARCTAS) Mission: Design, Execution, and First Results Author: Jacob, Daniel James; Crawford, J. H.; Maring, H.; Clarke, A. D.; Dibb, J. E.; Emmons, L. K.; Ferrare, R. A.; Hostetler, C. A.; Russell, P. B.; Singh, H. B.; Thompson, A. M.; Shaw, G. E.; McCauley, E.; Pederson, J. R.; Fisher, J. A. Note: Order does not necessarily reflect citation order of authors. Citation: Jacob, Daniel James, J. H. Crawford, H. Maring, A. D. Clarke, J. E. Dibb, L. K. Emmons, R. A. Ferrare, et al. 2010. “The Arctic Research of the Composition of the Troposphere from Aircraft and Satellites (ARCTAS) Mission: Design, Execution, and First Results.” Atmospheric Chemistry and Physics 10 (11) (June 14): 5191–5212. doi:10.5194/acp-10-5191-2010. http://dx.doi.org/10.5194/acp-10-5191-2010. Full Text & Related Files: Jacob-arctic-research.pdf (1.312Mb; PDF) Abstract: The NASA Arctic Research of the Composition of the Troposphere from Aircraft and Satellites (ARCTAS) mission was conducted in two 3-week deployments based in Alaska (April 2008) and western Canada (June–July 2008). Its goal was to better understand the factors driving current changes in Arctic atmospheric composition and climate, including (1) influx of mid-latitude pollution, (2) boreal forest fires, (3) aerosol radiative forcing, and (4) chemical processes. The June–July deployment was preceded by one week of flights over California (ARCTAS-CARB) focused on (1) improving state emission inventories for greenhouse gases and aerosols, (2) providing observations to test and improve models of ozone and aerosol pollution. ARCTAS involved three aircraft: a DC-8 with a detailed chemical payload, a P-3 with an extensive aerosol and radiometric payload, and a B-200 with aerosol remote sensing instrumentation. The aircraft data augmented satellite observations of Arctic atmospheric composition, in particular from the NASA A-Train. The spring phase (ARCTAS-A) revealed pervasive Asian pollution throughout the Arctic as well as significant European pollution below 2 km. Unusually large Siberian fires in April 2008 caused high concentrations of carbonaceous aerosols and also affected ozone. Satellite observations of BrO column hotspots were found not to be related to Arctic boundary layer events but instead to tropopause depressions, suggesting the presence of elevated inorganic bromine (5–10 pptv) in the lower stratosphere. Fresh fire plumes from Canada and California sampled during the summer phase (ARCTAS-B) indicated low $$NO_x$$ emission factors from the fires, rapid conversion of $$NO_x$$ to PAN, no significant secondary aerosol production, and no significant ozone enhancements except when mixed with urban pollution. Published Version: doi:10.5194/acp-10-5191-2010 Terms of Use: This article is made available under the terms and conditions applicable to Other Posted Material, as set forth at http://nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of-use#LAA Citable link to this page: http://nrs.harvard.edu/urn-3:HUL.InstRepos:11957016 Downloads of this work:


text:
#### Volume 7, issue 1 (2003)

 Recent Issues
 The Journal About the Journal Editorial Board Subscriptions Editorial Interests Editorial Procedure Submission Guidelines Submission Page Ethics Statement ISSN (electronic): 1364-0380 ISSN (print): 1465-3060 Author Index To Appear Other MSP Journals
On invariants of Hirzebruch and Cheeger–Gromov

### Stanley Chang and Shmuel Weinberger

Geometry & Topology 7 (2003) 311–319
 arXiv: math.GT/0306247
##### Abstract

We prove that, if $M$ is a compact oriented manifold of dimension $4k+3$, where $k>0$, such that ${\pi }_{1}\left(M\right)$ is not torsion-free, then there are infinitely many manifolds that are homotopic equivalent to $M$ but not homeomorphic to it. To show the infinite size of the structure set of $M$, we construct a secondary invariant ${\tau }_{\left(2\right)}:S\left(M\right)\to ℝ$ that coincides with the $\rho$–invariant of Cheeger–Gromov. In particular, our result shows that the $\rho$–invariant is not a homotopy invariant for the manifolds in question.

##### Keywords
signature, $L^2$–signature, structure set, $\rho$–invariant
##### Mathematical Subject Classification 2000
Primary: 57R67
Secondary: 46L80, 58G10


text:
# Function of a random variable

## Homework Statement

Suppose a random variable X has probability density function(pdf)
f(x) { 1/3 for $$1 \leq x \leq 4$$

find the density function of $$Y= \sqrt{X}$$

## The Attempt at a Solution

$$y=g(x)=\sqrt{x}$$
so $$g^-1(y)=x=y^2$$

$$A= \{ x: 1 \leq x \leq 4 \}$$
is monotonic onto
$$B= \{y: 1 \leq y \leq 2 \}$$

$$(g^-1(y))^'$$$$=2y$$

$$f(y)=fx (g^-1(y). |(g^-1(y))^'$$$$|$$
which gives me
$$f(x)=$$$$\{ 2y/3$$ for $$1 \leq y \leq 2 \}$$

This seems to be an invalid pdf as for y=2 f(y)=1.3333 which is >1
Can anyone tell me where I went wrong?
thanks

Related Calculus and Beyond Homework Help News on Phys.org
Dick


text:
# How to see through two cameras simultaneously?

In my scene I have two cameras (let's say camera1 and camera2), and in my GUI I have two panes both displaying the 3D-View.

In the first pane I'd now like to see through camera1. This can easily be done by activating camera1 by selecting it, pressing Crtl+NumPad 0 (or if it is already active, just pressing NumPad 0). The problem comes with the second camera: When I try to activate it, both panes automatically switch to the perspective of the second camera. Is there a way to avoid this, such that both panes show the corresponding perspectives?


text:
Timezone: »

Score Matching via Differentiable Physics
Benjamin Holzschuh · Simona Vegetti · Nils Thuerey
Diffusion models based on stochastic differential equations (SDEs) gradually perturb a data distribution $p(\mathbf{x})$ over time by adding noise to it. A neural network is trained to approximate the score $\nabla_\mathbf{x} \log p_t(\mathbf{x})$ at time $t$, which can be used to reverse the corruption process. In this paper, we focus on learning the score field that is associated with the time evolution according to a physics operator in the presence of natural non-deterministic physical processes like diffusion. A decisive difference to previous methods is that the SDE underlying our approach transforms the state of a physical system to another state at a later time. For that purpose, we replace the drift of the underlying SDE formulation with a differentiable simulator or a neural network approximation of the physics. At the core of our method, we optimize the so-called probability flow ODE to fit a training set of simulation trajectories inside an ODE solver and solve the reverse-time SDE for inference to sample plausible trajectories that evolve towards a given end state.


text:
# Prove the following Inequality [3]

Suppose $m>x$, where $x$ belongs to positive Real Numbers and letting $n\ge m$, show that $${x^n\over n!}\le{x^n\over m^n}\cdot{m^m\over (m-1)!}$$ Frankly, I consider myself as a beginner in Inequalities and therefore, I don't know how to approach such problems. So,in essence I have two main questions for the community:

1) How to solve the above written problem?

2) How to check whether one's proof is correct or not? (This is major issue as I have often made gross errors while proving inequalities, even though I felt quite convinced with my argument)

Any inputs and suggestions will be much appreciated.

• Is it $x^m$ on the right side? – Jimmy R. Jan 31 '16 at 12:23
• My book mentions $x^n$ on the right side.. – model_checker Jan 31 '16 at 12:24
• So, $x^n$ just cancels out from both sides? – Jimmy R. Jan 31 '16 at 12:26
• Yeah, I guess... – model_checker Jan 31 '16 at 12:27

I suppose $m,n$ are natural numbers. This inequality is equivalent to $\;n!\ge m^{n-m} (m-1)!$

Now, as $n\ge m$, we can rewrite $n!$ as $$n!=(1\cdot2\cdots(m-1))(\underbrace{m(m+1)\cdots n}_{\text{each factor is }\ge~ m})\ge\begin{cases}(m-1)!\; m^{n-m+1} \ge (m-1)!\; m^{n-m}\\[1ex] m!\;m^{n-m}\end{cases}$$

In such kind of problems start with cancelling the common terms on both the sides since in this case it is $x^n$ which is positive so you can demolish that term without any mercy ...also notice that the RHS can also be reduced so we can write this as (new inequality) $$\frac{1}{n!}\le\left(\frac{1}{m^{n-m-1}×m×\left((m-1)!\right)}\right)$$ or this can also be written as $$\frac{1}{n!}\le\left(\frac{1}{m^{n-m-1}×(m!)}\right)$$ now I think you can easily solve the problem as you can easily compare to prove the inequality also we know that $(n!)\le(m!)$

Edit:as pointed out in other answers this is obviously same as the inequality $$\;n!\ge m^{n-m-1}m!$$ which has also been solved ...good for you...and about the part how you can check whether it is true or not...well most of the begginers like me just use basic principle of mathematical induction which is very easy to use...but then again I use it only for natural numbers...but the question here is a more general case ....that is for real numbers ...but still since $N$ is a subset of $R^+$ so it is a fine proof checker at least for a beginner...also another thing you should take care is while multiplying in an inequality as I also used to neglect reversing the inequality whenever i used to multiply negative numbers on both the sides of the inequality ....also the inequalities on logarithm will be a nightmare in the beginning but you will get used to them overtime...also I would like to advice you to try solving more and more questions on your own instead of just asking a question here which doesn't show any effort from your side in solving the question...best of luck..

As written, is equivalent to the obvious inequality $$(m-1)!\, m^{n-m} \le (m-1)!m(m+1)\cdots n = n!.$$

I can't leave a comment yet, so here's a maybe incomplete answer: Assuming that $n$ and $m$ are natural numbers, the inequation can be rewritten as:

$m^{n-m-1} \le (m+1)*(m+2)*...*n$

which is simply stricter than

$m^{n-m} \le (m+1)*(m+2)*...*n$

$n-m$ is non negative and the left hand side has the same amount of factors ($n-m$ times $m$) as the right hand side, which has $n-m$ times a number $> m$.


text:
# Is the double commutant $A''$ commutative if $A$ is commutative?

If $A$ is a commutative C*-subalgebra of linear bounded operator space $B(H)$ on some Hilbert space $H$, so is the double commutant $A''$. It follows from $A$ is dense in $A''$ and the multiplication is continuous on each factor respectively, respect to the strong operator topology.

But note that "double commutant" and "commutative" are both algebraic terms, I want to ask:

1. Can the assertion "$A''$ is commutative" be verified in an algebraic way?

2. Or, a more general question: If $A$ is a commutative subalgebra of an algebra $B$, is the double commutant $A''$ of $A$ also commutative?

If $A$ is commutative, you have $$A\subset A'.$$ Then $$A'\supset A''.$$ And then $$A''\subset A'''.$$ So $A''$ is contained in its commutant and is thus commutative.
The above reasoning shows that all even higher commutants of $A$ are commutative.


text:
# Extending the birthday paradox to more than 2 people

In the traditional Birthday Paradox the question is "what are the chances that two or more people in a group of $n$ people share a birthday". I'm stuck on a problem which is an extension of this.

Instead of knowing the probability that two people share a birthday, I need to extend the question to know what is the probability that $x$ or more people share a birthday. With $x=2$ you can do this by calculating the probability that no two people share a birthday and subtract that from $1$, but I don't think I can extend this logic to larger numbers of $x$.

To further complicate this I also need a solution which will work for very large numbers for $n$ (millions) and $x$ (thousands).

• I presume that it's bioinformatics problem – csgillespie Aug 5 '10 at 14:41
• It is actually a bioinformatics problem, but since it boils down to the same concept as the birthday paradox I thought I'd save the irrelevant specifics! – Simon Andrews Aug 5 '10 at 14:50
• Normally I would agree with you, but in this case the specifics might matter since there could already be a bioconductor package that does what you ask. – csgillespie Aug 5 '10 at 14:53
• If you really want to know, it's a pattern finding problem where I'm trying to accurately estimate the probability of a given level of enrichment of a subsequence within a set of larger sequences. I therefore have a set of subsequences with associated counts and I know how many subsequences I observed and how many theoretically observable sequences are available. If I saw a particular sequence 10 times out of 10,000 observations I need to know how likely that was to have occurred by chance. – Simon Andrews Aug 5 '10 at 15:21
• Almost eight years later, I posted an answer to this problem at stats.stackexchange.com/questions/333471. The code there does not work for large $n,$ though, because it takes quadratic time in $n$. – whuber Mar 17 '18 at 21:58

This is a counting problem: there are $b^n$ possible assignments of $b$ birthdays to $n$ people. Of those, let $q(k; n, b)$ be the number of assignments for which no birthday is shared by more than $k$ people but at least one birthday actually is shared by $k$ people. The probability we seek can be found by summing the $q(k;n,b)$ for appropriate values of $k$ and multiplying the result by $b^{-n}$.

These counts can be found exactly for values of $n$ less than several hundred. However, they will not follow any straightforward formula: we have to consider the patterns of ways in which birthdays can be assigned. I will illustrate this in lieu of providing a general demonstration. Let $n = 4$ (this is the smallest interesting situation). The possibilities are:

• Each person has a unique birthday; the code is {4}.
• Exactly two people share a birthday; the code is {2,1}.
• Two people have one birthday and the other two have another; the code is {0,2}.
• Three people share a birthday; the code is {1,0,1}.
• Four people share a birthday; the code is {0,0,0,1}.

Generally, the code $\{a[1], a[2], \ldots\}$ is a tuple of counts whose $k^\text{th}$ element stipulates how many distinct birthdates are shared by exactly $k$ people. Thus, in particular,

$$1 a[1] + 2a[2] + ... + k a[k] + \ldots = n.$$

Note, even in this simple case, that there are two ways in which the maximum of two people per birthday is attained: one with the code $\{0,2\}$ and another with the code $\{2,1\}$.

We can directly count the number of possible birthday assignments corresponding to any given code. This number is the product of three terms. One is a multinomial coefficient; it counts the number of ways of partitioning $n$ people into $a[1]$ groups of $1$, $a[2]$ groups of $2$, and so on. Because the sequence of groups does not matter, we have to divide this multinomial coefficient by $a[1]!a[2]!\cdots$; its reciprocal is the second term. Finally, line up the groups and assign them each a birthday: there are $b$ candidates for the first group, $b-1$ for the second, and so on. These values have to be multiplied together, forming the third term. It is equal to the "factorial product" $b^{(a[1]+a[2]+\cdots)}$ where $b^{(m)}$ means $b(b-1)\cdots(b-m+1)$.

There is an obvious and fairly simple recursion relating the count for a pattern $\{a[1], \ldots, a[k]\}$ to the count for the pattern $\{a[1], \ldots, a[k-1]\}$. This enables rapid calculation of the counts for modest values of $n$. Specifically, $a[k]$ represents $a[k]$ birthdates shared by exactly $k$ people each. After these $a[k]$ groups of $k$ people have been drawn from the $n$ people, which can be done in $x$ distinct ways (say), it remains to count the number of ways of achieving the pattern $\{a[1], \ldots, a[k-1]\}$ among the remaining people. Multiplying this by $x$ gives the recursion.

I doubt there is a closed form formula for $q(k; n, b)$, which is obtained by summing the counts for all partitions of $n$ whose maximum term equals $k$. Let me offer some examples:

With $b=5$ (five possible birthdays) and $n=4$ (four people), we obtain

\eqalign{ q(1) &= q(1;4,5) &= 120 \\ q(2) &= 360 + 60 &= 420 \\ q(3) &&= 80 \\ q(4) &&= 5.\\ }

Whence, for example, the chance that three or more people out of four share the same "birthday" (out of $5$ possible dates) equals $(80 + 5)/625 = 0.136$.

As another example, take $b = 365$ and $n = 23$. Here are the values of $q( k;23,365)$ for the smallest $k$ (to six sig figs only):

\eqalign{ k=1: &0.49270 \\ k=2: &0.494592 \\ k=3: &0.0125308 \\ k=4: &0.000172844 \\ k=5: &1.80449E-6 \\ k=6: &1.48722E-8 \\ k=7: &9.92255E-11 \\ k=8: &5.45195E-13. }

Using this technique, we can readily compute that there is about a 50% chance of (at least) a three-way birthday collision among 87 people, a 50% chance of a four-way collision among 187, and a 50% chance of a five-way collision among 310 people. That last calculation starts taking a few seconds (in Mathematica, anyway) because the number of partitions to consider starts getting large. For substantially larger $n$ we need an approximation.

One approximation is obtained by means of the Poisson distribution with expectation $n/b$, because we can view a birthday assignment as arising from $b$ almost (but not quite) independent Poisson variables each with expectation $n/b$: the variable for any given possible birthday describes how many of the $n$ people have that birthday. The distribution of the maximum is therefore approximately $F(k)^b$ where $F$ is the Poisson CDF. This is not a rigorous argument, so let's do a little testing. The approximation for $n = 23$, $b = 365$ gives

\eqalign{ k=1: &0.498783 \\ k=2: &0.496803\\ k=3: &0.014187\\ k=4: &0.000225115. }

By comparing with the preceding you can see that the relative probabilities can be poor when they are small, but the absolute probabilities are reasonably well approximated to about 0.5%. Testing with a wide range of $n$ and $b$ suggests the approximation is usually about this good.

To wrap up, let's consider the original question: take $n = 10,000$ (the number of observations) and $b = 1\,000\,000$ (the number of possible "structures," approximately). The approximate distribution for the maximum number of "shared birthdays" is

\eqalign{ k=1: &0 \\ k=2: &0.8475+\\ k=3: &0.1520+\\ k=4: &0.0004+\\ k\gt 4: &\lt 1E-6. }

(This is a fast calculation.) Clearly, observing one structure 10 times out of 10,000 would be highly significant. Because $n$ and $b$ are both large, I expect the approximation to work quite well here.

Incidentally, as Shane intimated, simulations can provide useful checks. A Mathematica simulation is created with a function like

simulate[n_, b_] := Max[Last[Transpose[Tally[RandomInteger[{0, b - 1}, n]]]]];

which is then iterated and summarized, as in this example which runs 10,000 iterations of the $n = 10000$, $b = 1\,000\,000$ case:

Tally[Table[simulate[10000, 1000000], {n, 1, 10000}]] // TableForm

Its output is

2 8503

3 1493

4 4

These frequencies closely agree with those predicted by the Poisson approximation.

• What a fantastic answer, thank you very much @whuber. – JKnight Aug 21 '14 at 20:21
• "There is an obvious and fairly simple recursion" — Namely? – Kodiologist Oct 14 '16 at 20:28
• @Kodiologist I inserted a brief description of the idea. – whuber Oct 14 '16 at 20:56
• +1 but where in the original question did you see that n=10000 and b=1mln? The OP looks like it is asking about n=1mln and k=10000, with b unspecified (presumably b=365). Not that it matters at this point :) – amoeba Oct 14 '16 at 21:20
• @amoeba After all this time (six years, 1600 answers, and closely reading tens of thousands of posts) I cannot recall, but most likely I misinterpreted the last line. In my defense, note that if we read it literally the answer is immediate (upon applying a version of the Pigeonhole Principle): it is certain that among $n$=millions of people there will be at least one birthday that is shared among at least $x$=thousands of them! – whuber Oct 14 '16 at 21:25

It is always possible to solve this problem with a monte-carlo solution, although that's far from the most efficient. Here's a simple example of the 2 person problem in R (from a presentation I gave last year; I used this as an example of inefficient code), which could be easily adjusted to account for more than 2:

birthday.paradox <- function(n.people, n.trials) {
matches <- 0
for (trial in 1:n.trials) {
birthdays <- cbind(as.matrix(1:365), rep(0, 365))
for (person in 1:n.people) {
day <- sample(1:365, 1, replace = TRUE)
if (birthdays[birthdays[, 1] == day, 2] == 1) {
matches <- matches + 1
break
}
birthdays[birthdays[, 1] == day, 2] <- 1
}
birthdays <- NULL
}
print(paste("Probability of birthday matches = ", matches/n.trials))
}

• I am not sure if the multiple types solution will work here. – user28 Aug 5 '10 at 14:32
• I think that generalisation still only works for 2 or more people sharing a birthday - just that you can have different sub-classes of people. – Simon Andrews Aug 5 '10 at 14:45

This is an attempt at a general solution. There may be some mistakes so use with caution!

First some notation:

$P(x,n)$ be the probability that $x$ or more people share a birthday among $n$ people,

$P(y|n)$ be the probability that exactly $y$ people share a birthday among $n$ people.

Notes:

1. Abuse of notation as $P(.)$ is being used in two different ways.

2. By definition $y$ cannot take the value of 1 as it does not make any sense and $y$ = 0 can be interpreted to mean that no one shares a common birthday.

Then the required probability is given by:

$P(x,n) = 1 - P(0|n) - P(2|n) - P(3|n) .... - P(x-1|n)$

Now,

$P(y|n) = {n \choose y} (\frac{365}{365})^y \ \prod_{k=1}^{k=n-y}(1 -\frac{k}{365})$

Here is the logic: You need the probability that exactly $y$ people share a birthday.

Step 1: You can pick $y$ people in ${n \choose y}$ ways.

Step 2: Since they share a birthday it can be any of the 365 days in a year. So, we basically have 365 choices which gives us $(\frac{365}{365})^y$.

Step 3: The remaining $n-y$ people should not share a birthday with the first $y$ people or with each other. This reasoning gives us $\prod_{k=1}^{k=n-y}(1 -\frac{k}{365})$.

You can check that for $x$ = 2 the above collapses to the standard birthday paradox solution.

• Will this solution suffer from the curse of dimensionality? If instead of n=365, n=10^6 is this solution still feasible? – csgillespie Aug 5 '10 at 15:38
• Some approximations may have to be used to deal with high dimensions. Perhaps, use Stirling's approximation for factorials in the binomial coefficient. To deal with the product terms you could take logs and compute the sums instead of the products and then take the anti-log of the sum. – user28 Aug 5 '10 at 15:45
• There are also several other forms of approximations possible using for example the Taylor series expansion for the exponential function. See the wiki page for these approximations: en.wikipedia.org/wiki/Birthday_problem#Approximations – user28 Aug 5 '10 at 16:15
• Suppose y=2, n=4, and there are just two birthdays. Your formula, adapted by replacing 365 by 2, seems to say the probability that exactly 2 people share a birthday is Comb(4,2)*(2/2)^2*(1-1/2)*(1-2/2) = 0. (In fact, it's easy to see--by brute force enumeration if you like--that the probabilities that 2, 3, or 4 people share a "birthday" are 6/16, 8/16, and 2/16, respectively.) Indeed, whenever n-y >= 365, your formula yields 0, whereas as n gets large and y is fixed the probability should increase to a non-zero maximum before n reaches 365*y and then decrease, but never down to 0. – whuber Aug 18 '10 at 15:05
• Why you are replacing 365 by $n$? The probability that 2 people share a birthday is computed as: 1 - Prob(they have unique birthday). Prob(that they have unique birthday) = (364/365). The logic is as follows: Pick a person. This person can have any day of the 365 days as a birthday. The second person can then only have a birthday on one of the remaining 364 days. Thus, the prob that they have a unique birthday is 364/365. I am not sure how you are calculating 6/16. – user28 Aug 18 '10 at 15:39


text:
What’s the best way for a group of people to make collective decisions? Democracy may be, as Churchill said, the worst system that’s better than anything else, but in practice there’s a lot of variation possible in democractic voting systems. How should we set up voting systems that result in effective collective decisions?

Designing a good voting system seems like a simple task, but it’s surprisingly complicated. A famous result known as Arrow’s theorem, proved by the economist Kenneth Arrow in 1950, vividly demonstrates just how difficult it is. Arrow picked out three properties that (arguably) you would like any good voting system to have – and then mathematically proved that no voting system with all three properties can possibly exist! What is especially remarkable about Arrow’s achievement is that there is no obvious a priori reason to suppose that these three requirements are incompatible. Arrow was a joint recipient of the 1972 Nobel Memorial Prize for economics, in part because of this work.

These notes explain what Arrow’s theorem says, why it’s true (i.e., I give a proof), and discuss briefly what it means for collective cognition. I’ve tried to keep the notes easy to read, favouring a relaxed and discursive discussion over the terse presentation favoured in most mathematical works. I have also tried to assume minimal mathematical background, no more than some facility with basic mathematical notation and mathematical argument. The main drawback of this approach is that the notes have become rather lengthy, clocking in at nearly words. Hopefully, however, they’ll be a rewarding read.

My notes are based on a very nice paper by John Geanakoplos (Cowles Foundation discussion paper No.1123RRRR, available at http://cowles.econ.yale.edu, and reprinted in Economic Theory (2005), 26: 211-215), which gives three proofs of Arrow’s theorem. The proof I give is Geanakoplos’ first (and simplest) proof. Note that there are other (related) results in the literature which go by the name Arrow’s theorem. Understanding the version presented here should enable you to understand the variants with a minimum of fuss. Arrow’s original paper appeared as “A Difficulty in the Concept of Social Welfare” in The Journal of Political Economy, Volume 58, page 328 (1950).

### Voting systems

To explain what Arrow’s theorem says, we need to define more precisely what we mean by a voting system. We imagine a population of “voters”, to whom we assign convenient labels , like . This population might be, for example, all the mentally competent people over the age of in some country (e.g., Australia).

These voters are going to vote amongst alternative options, which we’ll label with capital letters, , to keep distinct from the voters. These voting options might be the political parties running for control of the Federal Government, for example.

What each voter does is produce an ordered ranking of the options, with ties allowed. For example, voter number might rank as number , and as a tie for number , as number , and so on.

(You might wonder whether shouldn’t really be ranked number , in view of the tie between and for the ranking of . Below we’ll make an assumption about the voting system that means that only the relative ranking matters, not the exact value of the number assigned, and so we’re justified in ignoring this issue.)

A helpful shorthand is to write to indicate that voter ranked strictly ahead of . For example, maybe voter ranked as and as . It’s worth keeping in mind that this notation for ordering is the reverse of the conventional numerical order – politicians usually campaign to be “number ” rather than “number ”! Similarly, we’ll write to indicate that voter ranked at least as highly as ; this allows that maybe and had the same rank. By the way, we’ve been using and here simply to indicate generic voting options; we’ll do this throughout, occasionally using as well.

As an example, imagine there are voters choosing among alternatives, . The overall voting profile might look something like this:

• Voter : ; ; .
• Voter : ; ; .
• Voter : ; ; .
• Voter : ; ; .
• Voter : ; ; .

A voting system is a function which takes the profile as input, and produces a single social ranking of the options as its output. For example, we might add up the numerical value of the votes associated to each voting option, and then order the options accordingly. So, for example, option above has a total vote , option a total and option a total . As a result, in this voting system the social ranking has as , as , and as .

Once a voting system has been fixed, we write to indicate that has a higher social rank than . Similarly, we write to indicate that ’s social ranking is at least as high as ’s.

### What makes a good voting system?

What properties should a good voting system have?

Obviously, this is a potentially controversial question! Arrow’s theorem is based on several reasonable properties that, arguably, we should expect to be satisfied in any good voting system.

The first property is that the voting system should respect unaninmity, in the sense that if for all voters, then we should have . Restating this verbally instead of symbolically, if every voter prefers to , then the social ranking should place ahead of . This is pretty obviously a highly desirable property for any voting system to have – imagine if the electoral commission announced that candidate had won, despite the fact that every single voter ranked ahead of !

The second property is that the voting system should respect the independence of irrelevant alternatives, meaning that the relative social ranking of and (higher, lower, or the same) depends only on the relative ranking of and by individual voters, and isn’t influenced by the position of other options (e.g., ).

It’s rather less obvious that any good voting system will respect the independence of irrelevant alternatives. For example, the simple voting system I described above (where we summed the votes) turns out not to have this property, yet it’s not so obviously a bad voting system.

However, for the purposes of this discussion we’re going to assume that this property of respecting the independece of irrelevant alternatives is regarded as highly desirable. Can we design a voting system which respects both unanimity and the independence of irrelevant alternatives?

It turns out that if there are just two voting options, and , then it’s possible to design a voting system with this property. We could, for example, just sum up the the respective votes of the two voting options, and declare the winner to be whichever option has the lower total.

What happens if there are three voting options, and ? What Arrow’s theorem shows in this case is that in any voting system which respects unanimity and the independence of irrelevant alternatives there must automatically be a voter, , who can act as a dictator for the voting system, in the sense that if , then , no matter how the other voters rank their options!

Stated another way, what Arrow’s theorem shows is that the requirements of respecting unanimity and the independence of irrelevant alternatives are incompatible with a third desirable requirement, namely that the voting system not be a dictatorship.

In full generality, what Arrow’s theorem shows is as follows:

Arrow’s theorem: Suppose we have a voting system to rank or more voting options. Suppose that system respects unanimity and the independence of independent alternatives. Then there must be a dictator for the voting system.

This theorem ought to shock you. How can the assumptions of unanimity and independence of irrelevant alternatives possibly imply the existence of a dictator?

I’ll now give a short proof of Arrow’s theorem, to give you some feeling for why the theorem is true. However, much of interest can be said about Arrow’s theorem even if you don’t understand the proof, so if you’re so inclined you should feel free to skim or skip the following proof. Of course, those who want to understand Arrow’s theorem deeply should spend some time trying to prove it themselves, before reading the proof in detail.

Proof of Arrow’s theorem: The first step of the proof is to argue that if every voter ranks either strictly first or strictly last, then ’s social ranking must be either strictly first or strictly last. To see this, we use a proof by contradiction, supposing that in fact ’s social ranking is neither strictly first nor strictly last. That is, we suppose that there exist and such that . Suppose we rearrange each voter’s rankings so that , but without changing the relative ranking of and , or of and , so the rearrangement doesn’t affect the fact that and . (Understanding why such a rearrangement can always be done requires a little thought, and maybe some working out on a separate sheet of paper, which you should do.) Unanimity then requires that , which is inconsistent with the fact that . This is the desired contradiction.

Suppose now that we start out with a profile in which is ranked strictly first by every voter, and thus by unanimity must be ranked strictly first in the social ranking. Suppose we move through the voting population, and for each voter in turn change their ranking for from strictly first to strictly last. When this has been done for all the voters, unanimity implies that must be ranked strictly last, and so at some point we see that there must be a voter (who will turn out to be the dictator, ), whose vote change causes to move from first to last in the social ranking.

Consider the voting profile immediately before changes their vote. We will say that any profile which has the same rankings for as this profile is an -profile. Similarly, an -profile is one which has the same rankings for as the profile just after changes their vote. It follows from the independence of irrelevant alternatives that the overall ranking of must be first in any -profile, and last in any -profile.

Suppose now that and are voting options that are not equal to . Suppose ranks higher than , i.e., . We will show that we must have , no matter how the other voters rank and . That is, ’s vote dictates that be ranked above in the social ranking. To see this, first we rearrange the profile so that it becomes an -profile, without changing the relative ordering of and anywhere, and so not affecting whether or not. We can do this simply by changing each voter’s ranking for in an appropriate way, placing it either at the top or the bottom of their ranking. Second, we change ’s rankings so that . This can be done without changing the relative ranking of and , and so does not affect whether . We call the resulting voting profile after these two rearrangements the final profile. Observe that in the final profile we have , since if changes to be ranked strictly first then we have an -profile. Similarly, in the final profile we have , since if changes to be strictly last, then we have an -profile. As a result, we have in the final profile, and thus . But we constructed the final profile so that holds only if also in the actual voting profile, and so we must have had in the actual voting profile, as we desired to show.

The final step of the proof is to argue that can also dictate the order of and , for an arbitrary . To see this, pick an element which is neither nor , and consider an -profile in which is placed strictly last everywhere that is first, and vice versa. The results of the first and second paragraph of this proof imply that can change the rank of from last to first simply by changing their vote. We now apply the same argument as in the paragraph before this, but with taking the place of , to argue that can dictate the relative ordering of and . QED

Arrow’s theorem is a striking result in the theory of collective decision making. It shows the great advantages that can come by formalizing ideas in a simple mathematical model – the fact that the model can lead to striking unforseen conclusions that entirely change our perception of the phenomenon. More prosaically, by thinking closely about our values and our desired social outcomes, we can try to formalize models of those properties, and then study which models of collective decision making best respect those properties (if, indeed, any such models exists).

What of the implications of Arrow’s theorem for voting? It is, of course, true that the restrictions in Arrow’s theorem can be relaxed, and there is a large literature studying other models of voting and the extent to which they can be made fair. I’m not an expert on this literature, and so won’t comment other than to point out that economists have, of course, not been silent on the matter in the 50 plus years since Arrow’s paper!

My own interest in the subject is due to a more general hobby interest in the problem of collective cognition. In particular, I’m interested in the question of how we can design institutions which result in good collective decision making. It seems that the subject of institutional design is still in its infancy, and I find it remarkable how small a fraction of “institution space” humans have explored. One of the most interesting things about the web, in my opinion, is that it has greatly cut the cost of developing new institutions, and as a result we’re seeing new institutional models, and new types of collective cognition, develop at an incredible rate.

There are a lot of typos in your first paragraph (or I am missing something.) Here is my attempt to correct them:

The first step of the proof is to argue that if every voter ranks S either strictly first or strictly last, then Sâ€™s social ranking must be either strictly first or strictly last. To see this, we use a proof by contradiction, supposing that in fact Sâ€™s social ranking is neither strictly first nor strictly last. That is, we suppose that there exist T and U such that T >= S >= U. Suppose we rearrange each voterâ€™s rankings so that U>_v T , but without changing the relative ranking of S and T, or of S and U, so the rearrangement doesnâ€™t affect the fact that T >= S and S >= U . (Understanding why such a rearrangement can always be done requires a little thought, and maybe some working out on a separate sheet of paper, which you should do.) Unanimity then requires that U>T , which is inconsistent with the fact that T >= S >= U. This is the desired contradiction.

2. Is > a perfect ordering or a partial one? IE is it required that for every pair of options S, T every voter must have one of the three alternatives S>T, S

3. David: Thanks for pointing this out! I think I’ve fixed the errors. Unfortunately, in so doing my webserver started generating heaps of its own errors, as you can now see 🙁 Hopefully the problem will be solved later in the day.

Alejandro: Votes are numbers, so it’s the same as the usual order on numbers (except reversed).

4. Do you have version of these notes available in .pdf?

5. Steve: No, I don’t.

6. “Iâ€™m interested in the question of how we can design institutions which result in good collective decision making.”

Bryan Eastin and I talk about this all the time. We think it’s very analogous to the theory of fault-tolerance. We want the institution to be robust to some (possibly large) fraction of “bad” voters. Unfortunately, I think the reason this field is still in it’s infancy is that it’s so darn hard to find solutions that don’t just have good theoretical properties once implemented, but that might actually be possible to attain starting from our current institutions. If we’re at a “stable fixed point” in “institution space”, it will be very hard to leave, even if we find good alternatives.

There’s a few of these:
[Unparseable or potentially dangerous latex formula. Error 6 ]
in the proof

8. Jon: I don’t see any.

9. â€œIâ€™m interested in the question of how we can design institutions which result in good collective decision making.â€

It’s the people in the institutions, and the culture within which they work, which produce good collective decision making. My guess is that it’s a mistake to not think of people.

If you’re talking about policy making, then my suggestion is that the people in the institution should be open to different ideas, perhaps even ones that they have previously or instinctively rejected, and that they be guided by data, evidence and reasoning.


text:
# Within-subjects model in JAGS/stan

I have a general question regarding a varying intercept / varying slope model in jags/stan:

I have data from a psychophysics experiment, with one covariate, one within-subjects factor and several subjects:

The response variable y is binary, and I want to model the probability of giving a response as a function of the (centred) covariate x in all conditions. I think the lme4 model should be:

glm_fit <- glmer(formula = y ~ x + (1 | cond/subject),
data = df,
family = binomial(probit))

where the slope and intercept vary among conditions and among subjects within conditions.

My question is: how do I correctly model the correlations between subjects' interecepts and slopes in all conditions in jags or stan?

The data are in long format, and the jags model uses nested indexing for the condition factor. The jags model is:

model {
# likelihood
for (n in 1:N) { # loop over N observations
# varying intercept/slope for every condition*subject combination
probit(theta[n]) <- alpha[cond[n], subject[n]] + beta[cond[n], subject[n]] * x[n]
y[n] ~ dbern(theta[n])
}

# priors
for (j in 1:J) { # loop over J conditions
for (s in 1:S) { # loop over S subjects
# each subjects intercept/slope in each condition comes from a
# group-level prior
alpha[s, j] ~ dnorm(mu_a[j], tau_a[j])
beta[s, j] ~ dnorm(mu_b[j], tau_b[j])
}

# non-informative group level priors
mu_a[j] ~ dnorm (0, 1e-03)
mu_b[j] ~ dnorm (0, 1e-03)
tau_a[j] <- pow(sigma_a[j], -2)
tau_b[j] <- pow(sigma_b[j], -2)
sigma_a[j] ~ dunif (0, 100)
sigma_b[j] ~ dunif (0, 100)
}
}

I have left out all correlations between the parameters on purpose. The problem I'm having is that the intercepts and slope are correlated for each subject in each condition, and the intercept/slope pairs are correlated across conditions.

Does anyone have any ideas? What is the best way to implement this?

• How many conditions do you have? Unless you have like 10+, it probably shouldn't be a random effect (it should be a fixed effect). Are they a sample of conditions among a population of possible conditions? (Stated differently, do you want to generalize to these specific conditions, or to a larger population of conditions) – Patrick Coulombe Apr 1 '14 at 0:43
• I wanted a general solution to the problem, but in my dataset I have either 2 or 4 conditions. I see your point when using lme4, but I'm not sure what the difference would be in a Bayesian setting, where everything is basically a random effect. I am specifically asking about how to implement this using jags or stan. – Andrew Ellis Apr 1 '14 at 7:20
• I would agree that with a small, fixed number of conditions and a large, conceptually unlimited number of subjects, I would tend to just estimate a flat model. But I think in other circumstances you could do the hierarchical model you want with, for example, a multivariate normal prior over the alphas and betas jointly. – Ben Goodrich Apr 4 '14 at 23:20
• For later readers: tau_a[j] <- pow(sigma_a[j], -2) is too much BUGSy. Stan has dnorm parmeterized as standard deviation, not a precison. – Dieter Menne May 28 '15 at 9:54


text:
Here are some quick notes on two of Pandas data structures: Series and Data Frame.

#### Series

A series is a one-dimensional container containing an array of data and its corresponding labels (its index).

There are multiple different ways to create or initialize a Pandas series:

From an existing python list or numpy array

s = Series([1,2,3,4,5,6,7])

or

s1 = Series(np.array([1,2,3,4,5,6,7]))

If you do not provide an index, the Series will default index is provide consisting of integers 0 to N-1 where N is the length of your data

In [8]: s.index
Out[8]: Int64Index([0, 1, 2, 3, 4, 5, 6], dtype='int64')

You can also initialize a Series with a dict (you could even think of a Series as an ordered-dict):

Finally, you can initialize a series by explicitly defining the data and the index:

A series index can be altered in place also:

#### Data Frames

Pandas Data Frames are like matrices where each column can be of a different type. As it can be thought of as an dictionary of Series, you can initailize a Data Frame using a dictionary of python lists:

Again, you will see that if you do not provide an index, it defaults to the same standard integer index as the Series data structure does. You can specify the index in the Data Frame constructor.

You can access a single column or multiple columns using the following format

Column names can be changed in place, or specified using the column attribute in the Data Frame constructor:

Rows in a Data Frame can be accessed a number of different ways:

Using the ix attribute:

Adding a new column is pretty easy also. For example, if we want to create a new column of a single value 3.14, you can do that like this

Or, you can create a new column using a list/np.array as long as you keep the dimensionality correct:

And check this out, can you transpose a Data Frame by using the T property

You can also easily export the Data Frame to json:

#### Re-indexing

Re-indexing is a pretty useful feature than can be applied to both Series and Data Frames. Reindexing creates a new object which conforms to a new index: