text:
## LOG#038. Relativity: Examples(II).

Example 1. Completely inelastic collision of 2 particles .

We will calculate the mass and velocity after the collision, when a cluster is formed.

From the consevation of momentum in the collision, we get

Then,

Squaring both sides:

In the rest frame of the particle labelled with “a”:

Now, with and

and

And thus,

From this equation, we get

and

If , then , as we should expect from classical physics ( Lavoisier’s law: the mass is conserved).

We observe that, in general, there is NO rest mass conservation law in relativistic physics ( as we have mentioned before). Momentum and energy can be transformed into rest mass and viceversa. From the next equations:

We get

is the center or mass velocity in the laboratory frame. If and , then

And if we write , the formula provides

And it is the classical center of mass equation for two particles, as we expected to be.

Example 2. Production of a proton-antiproton pair in the chemical highly energetic process given by .

If we get an extremely energetic beam of protons. Then, we collide one proton A of the beam with another proton B, at rest. If the kinetic energy is enough, we can create a proton-antiproton pair! The question is, what is the minimum (total) energy, sometimes called threshold energy?What is the minimum kinetic energy, or threshold kinetic energy? And what is the velocity of the incident proton A in order to get the pair production? We are going to solve this really nice problem.

The proton B at rest has and then .

Note that we have and , for the system after the collision when the pair is created.

Using the formulae we have studied

and thus

It implies for the kinetic threshold energy. The necessary velocity can be obtained in a simple way:

And thus,

Energetically, we find that the collision is more “favourable”, in general, when we get a storage ring with 2 protons and we crash them with . In that case, the energy threshold and the kinetic energy threshold, provide:

and then, the minimum velocity of each proton has to be:

Thus, the minimun threshold total energy of each proton is:

Therefore, the minimum kinetic energy, the kinetic threshold energy, is given by . For each proton PAIR, the total energy threshold is . This value differs from the relativistic value previously obtained by an amount . Now the kinetic threshold energy to obtain the pair equals i.e., 1/3 ()of the total energy in the previous example () is saved smashing 2 protons in opposite directions in order to create the pair proton-antiproton.

We can generalize the problem to the creation of n-pairs proton-antiproton. The equations yield:

and then

The threshold kinetic energy will be in this case:

and the incident minimum velocity to hit the proton at rest is now:

In the case of a very large number of pairs, we get that

In the case of a storage ring,

and from this equation, algebra provides

and

## LOG#037. Relativity: Examples(I)

Problem 1. In the S-frame, 2 events are happening simultaneously at 3 lyrs of distance. In the S’-frame those events happen at 3.5 lyrs. Answer to the following questions: i) What is the relative speed between frames? ii) What is the temporal distance of events in the S’-frame?

Solution. i)

And by simultaneity,

Then

ii)

since we have simultaneity implies . Then,

Problem 2. In S-frame 2 events occur at the same point separated by a temporal distance of 3yrs. In the S’-frame, is their spatial separation. Answer the next questions: i) What is the relative velocity between the two frames? ii) What is the spatial separation of events in the S’-frame?

Solution. i) with

As the events occur in the same point

ii)

implies

Therefore, the second event happens 1.8 lyrs to the “left” of the first event. It’s logical: the S’-frame is moving with relative speed for .

Problem 3. Two events in the S-frame have the following coordinates in spacetime: , i.e., and , i.e., . The S’-frame moves with velocity v respect to the S-frame. a) What is the magnitude of v if we want that the events were simultaneous? b) At what tmes t’ do these events occur in the S’-frame?

Solution. a)

and then

b)

Problem 4. A spaceship is leaving Earth with . When it is away from our planet, Earth transmits a radio signal towards the spaceship. a) How long does the electromagnetic wave travel in the Earth-frame? b) How long does the electromagnetic wave travel in the space-ship frame?

For the spaceship, and for the signal . From these equations, we get

and , and it yields and thus for the intersection point. But, and . Putting this value in the intersection point, we deduce that the intersection point happens at . Moreover,

b) We have to perform a Lorentz transformation from to , with .

and . Then . And thus, we obtain that . The Lorentz transformation for the two events read

Remarks: a) Note that and differ by 3 instead of . This is due to the fact we haven’t got a time interval elapsing at a certain location but we face with a time interval between two different and spatially separated events.

b)The use of the complete Lorentz transformation (boost) mixing space and time is inevitable.

Problem 5. Two charged particles A and B, with the same charge q, move parallel with . They are separated by a distance d. What is the electric force between them?

In the S-frame, we obtain the Lorentz force:

The same result can be obtained using the power-force (or forpower) tetravector performing an inverse Lorentz transformation.

Problem 6. Calculate the electric and magnetic field for a point particle passing some concrete point.

The electric field for the static charge is:

with when the temporal origin coincides, i.e., at the time .  Suppose now two points that for the rest observer provide:

and . For the electric field we get:

and

Then, implies that

There are two special cases from the physical viewpoint in the observed electric fields:

a) When P is directly above the charge q. Then

b) When P is directly in front of ( or behind) q. Then, for a=0,

Note that we have if .

## LOG#036. Action and relativity.

The hamiltonian formalism and the hamiltonian H in special relativity has some issues with the definition. In the case of the free particle one possible definition, not completely covariant, is the relativistic energy

There are two others interesting scalars in classical relativistic theories. They are the lagrangian L and the action functional S. The lagrangian is obtained through a Legendre transformation from the hamiltonian:

From the hamiltonian, we get the velocity using the so-called hamiltonian equation:

Then,

and finally

The action functional is the time integral of the lagrangian:

However, let me point out that the above hamiltonian in SR has some difficulties in gauge field theories. Indeed, it is quite easy to derive that a more careful and reasonable election for the hamiltonian in SR should be zero!

In the case of the free relativistic particle, we obtain

Using the relation between time and proper time (the time dilation formula):

direct substitution provides

And defining the infinitesimal proper length in spacetime as , we get the simple and wonderful result:

Sometimes, the covariant lagrangian for the free particle is also obtained from the following argument. The proper length is defined as

The invariant in spacetime is related with the proper time in this way:

Thus, dividing by

and

so

that is

and the free coordinate action for the free particle would be:

Note, that since the election of time “t” is “free”, we can choose to obtain the generally covariant free action:

Remark: the (rest) mass is the “coupling” constant for the free particle proper length to guess the free lagrangian

Now, we can see from this covariant action that the relativistic hamiltonian should be a feynmanity! From the equations of motion,

The covariant hamiltonian , different from H, can be build in the following way:

The meaning of this result is hidden in the the next identity ( Noether identity or “hamiltonian constraint” in some contexts):

since

This strange fact that in SR, a feynmanity as the hamiltonian, is related to the Noether identity for the free relativistic lagrangian, indeed, a consequence of the hamiltonian constraint and the so-called reparametrization invariance . Note, in addition, that the free relativistic particle would also be invariant under diffeomorphisms if we were to make the metric space-time dependent, i.e., if we make the substitution . This last result is useful and important in general relativity, but we will not discuss it further in this moment. In summary, from the two possible hamiltonian in special relativity

the natural and more elegant (due to covariance/invariance) is the second one. Moreover, the free particle lagrangian and action are:

Remark: The true covariant lagrangian dynamics in SR is a “constrained” dynamics, i.e., dynamics where we are undetermined. There are more variables that equations as a result of a large set of symmetries ( reparametrization invariance and, in the case of local metrics, we also find diffeomorphism invarince).

The dynamical equations of motion, for a first order lagrangian (e.g., the free particle we have studied here), read for the lagrangian formalism:

By the other hand, for the hamiltonian formalism, dynamical equations are:

## LOG#035. Doppler effect and SR.

The Doppler effect is a very important phenomenon both in classical wave motion and relativistic physics. For instance, nowadays it is used to the detect exoplanets and it has lots of applications in Astrophysics and Cosmology.

Firstly, we remember the main definitions we are going to need here today.

Sometimes, we will be using the symbol for the frequency . We also have:

A plane (sometimes electromagnetic) wave is defined by the oscillation:

where

If , then the wave number is lightlike (null or isotropic) and then

Using the Lorentz transformations for the wave number spacetime vector, we get:

i.e., if the angle with the direction of motion is so

we deduce that

or for the normalized frequency shift

This is the usual formula for the relativistic Doppler effect when we define , and thus, the angular frequency (also the frecuency itself, since there is only a factor 2 times the number pi of difference) changes with the motion of the source. When the velocity is “low”, i.e., , we obtain the classical Doppler shift formula:

We then calculate the normalized frequency shift from

The classical Doppler shift states that when the source approaches the receiver (), then the frequency increases, and when the source moves away from the receiver (), the frequency decreases. Interestingly, in the relativistic case, we also get a transversal Doppler shift which is absent in classical physics. That is, in the relativistic Doppler shift, for , we obtain

and the difference in frequency would become

There is an alternative deduction of these formulae. The time that an electromagnetic wave uses to run a distance equal to the wavelength, in a certain inertial frame S’ moving with relative speed V to another inertial frame S at rest, is equal to:

where is the frequency of the source. Due to the time dilation of special relativity

and thus

so we get

The redshift (or Doppler displacement) is generally defined as:

When , i.e., , we get the classical result

The generalization for a general non-parallel motion of the source/observer is given by

If we use the stellar aberration formula:

the last equation can be recasted in terms of instead of as follows:

and then

Again, for a transversal motion, , we get a transversal Doppler effect:

Remark: Remember that the Doppler shift formulae are only valid if the relative motion (of both source and observer/receiver) is slower than the speed of the (electromagnetic) wave, i.e., if .

In the final part of this entry, we are going to derive the most general formula for Doppler effect, given an arbitrary motion of source and observer, in both classical and relativistic Physics. Recall that the Doppler shift in Classical Physics for an arbitrary observer is given by a nice equation:

Here, is the velocity of the (electromagnetic) wave in certain medium, is the velocity of the observer in certain direction forming an angle with the “line of sight”, while is the velocity of the source forming an angle with the line of sight/observation. If we write

we can rewrite this last Doppler formula in the following way ( for ):

or with

and

and

The most general Doppler shift formula, in the relativistic case, reads:

or equivalently

and where are the velocities of the source and the observer at the time of emission and reception, respectively, are the corresponding beta boost parameters, is the “light” or “wave” velocity vector and we have defined the angles to be the angles formed at the time of emission and the time of reception/observation between the source velocity and the “wave” velocity, respectively, between the source and the wave and the observer and the wave. Two simple cases of this formula:

1st. Parallel motion with .

2nd. Antiparallel motion with going in the contrary sense than that of . Then, .

The deduction of this general Doppler shift formula can be sketched in a simple fashion. For a signal using some propagating wave, we deduce:

with

Differentiating with respect to carefully, it provides

Solving for we get

Using the known formula , we obtain in a simple way:

Finally, using the fact that , the similar result , and that the proper time induces an extra gamma factor due to time dilation

and we calculate for the frequency:

where the PREFACTOR denotes the previously calculated ratio between differential times. Finally, elementary algebra let us derive the expression:

Q.E.D.

An interesting remark about the Doppler effect in relativity: the Doppler effect allows us to “derive” the Planck’s relation for quanta of light. Suppose that a photon in the S’-frame has an energy and momentum is being emitted along the negative x’-axis toward the origin of the S-frame. The inverse Lorentz transformation provides:

, i.e.,

By the other hand, by the relativistic Doppler effect we have seen that the frequency f’ in the S’-frame is transformed into the frequency f in the S-frame if we use the following equation:

If we divide the last two equations we get:

Then, if we write , and and .

AN ALTERNATIVE HEURISTIC DEDUCTION OF THE RELATIVISTIC DOPPLER EFFECT

In certain rest frame S, there is an observer receiving light beams/signals. The moving frame is the S’-frame and it is the emitter of light. The source of light approaches at velocity V, and it sends pulses with frequency . What is the frequency that the observer at S observes? Due to time dilation, the observer at S observes a longer period

with

The distance between two consecutive light beams seen by the observer at S will be:

Therefore, the observer frequency in the S-frame is:

i.e.

If the source approaches the observer, then . If the source moves away from the observer, then . In the case, the velocity of the source forms certain angle in the direction of observation, the same argument produces:

that is

In the case of transversal Doppler effect, we get , and so:

Q.E.D.

Final remark (I): If or AND , therefore we have that there is no Doppler effect at all.

Final remark (II): If , there is no Doppler effect in certain observation directions. Those directions can be deduced from the above relativistic Doppler effect formula with the condition and solving for . This gives the next angular direction in which Doppler effect can not be detected

## LOG#034. Stellar aberration.

In this entry, we are going to study a relativistic effect known as “stellar aberration”.

From the known Lorentz transformations of velocities (inverse case), we get:

The classical result (galilean addition of velocities) is recovered in the limit of low velocities or sending the light speed get the value “infinite” . Then,

Let us define

Thus, we get the component decomposition into the xy and x’y’ planes:

From this equations, we get

If

and then

From the last equation, we get

From this equation, if , i.e., if and with , we obtain the result

By these formalae, the angle of a light beam propagating in space depends on the velocity of the source respect to the observer. We can observe this relativistic effect every night (supposing a good approximation that Earth’s velocity is non-relativistic, as it shows). The physical interpretation of the above aberration formulae (for the stars we watch during a sky night) is as follows: due to the Earth’s motion, a star in the zenith is seen under an angle .

Other important consequence from the stellar aberration is when we track ultra-relativistic particles (). Then, and then, the observer moves close to the source of light. In this case, almost every star (excepting those behind with ) are seen “in front of” the observer. If the source moves with almost the speed of light, then the light is “observed” as it were concentrated in a little cone with an aperture .

## LOG#033. Electromagnetism in SR.

The Maxwell’s equations and the electromagnetism phenomena are one of the highest achievements and discoveries of the human kind. Thanks to it, we had radio waves, microwaves, electricity, the telephone, the telegraph, TV, electronics, computers, cell-phones, and internet. Electromagnetic waves are everywhere and everytime (as far as we know, with the permission of the dark matter and dark energy problems of Cosmology). Would you survive without electricity today?

The language used in the formulation of Maxwell equations has changed a lot since Maxwell treatise on Electromagnetism, in which he used the quaternions. You can see the evolution of the Maxwell equations “portrait” with the above picture. Today, from the mid 20th century, we can write Maxwell equations into a two single equations. However, it is less know that Maxwell equations can be written as a single equation using geometric algebra in Clifford spaces, with , or the so-called Kähler-Dirac-Clifford formalism in an analogue way.

Before entering into the details of electromagnetic fields, let me give some easy notions of tensor calculus. If , how does transform under Lorentz transformations? Let me start with the tensor components in this way:

Then:

Note, we have used with caution:

1st. Einstein’s convention: sum over repeated subindices and superindices is understood, unless it is stated some exception.

2nd. Free indices can be labelled to the taste of the user segment.

3rd. Careful matrix type manipulations.

We define a contravariant vector (or tensor (1,0) ) as some object transforming in the next way:

where denotes the Jabobian matrix of the transformation.
In similar way, we can define a covariant vector ( or tensor (0,1) ) with the aid of the following equations

Note:

Contravariant tensors of second order ( tensors type (2,0)) are defined with the next equations:

Covariant tensors of second order ( tensors type (0,2)) are defined similarly:

Mixed tensors of second order (tensors type (1,1)) can be also made:

We can summarize these transformations rules in matrix notation making the transcript from the index notation easily:

1st. Contravariant vectors change of coordinates rule:

2nd. Covariant vectors change of coordinates rule:

3rd. (2,0)-tensors change of coordinates rule:

4rd. (0,2)-tensors change of coordinates rule:

5th. (1,1)-tensors change of coordinates rule:

Indeed, without taking care with subindices and superindices, and the issue of the inverse and transpose for transformation matrices, a general tensor type (r,s) is defined as follows:

We return to electromagnetism! The easiest examples of electromagnetic wave motion are plane waves:

where

Indeed, the cuadrivector K can be “guessed” from the phase invariant ( since the phase is a dot product):

where is the four dimensional nabla vector defined by

and so

Now, let me discuss different notions of velocity when we are considering electromagnetic fields, beyond the usual notions of particle velocity and observer relative motion, we have the following notions of velocity in relativistic electromagnetism:

1st. The light speed c. It is the ultimate limit in vacuum and SR to the propagation of electromagnetic signals. Therefore, it is sometimes called energy transfer velocity in vacuum or vacuum speed of light.

2nd. Phase velocity . It is defined as the velocity of the modulated signal in a plane wave, if , we have

where k is the modulus of .

It measures how much fast the phase changes with the wavelength vector.

From the definition of cuadrivector wave length, we deduce:

Then, we can rewrite the distinguish three cases according to the sign of the invariant :

a) . The separation is spacelike and we get .

b). The separation is lightlike or isotropic. We obtain .

c). The separation is timelike. We deduce that . This situation is not contradictory with special relativity since phase oscillations can not transport information.

3rd. Group velocity . It is defined like the velocity that a “wave packet” or “pulse” has in its propagation. Therefore,

where we used the Planck relationships for photons and , with

4th. Particle velocity. It is defined in SR by the cuadrivector

5th. Observer relative velocity, V. It is the velocity (constant) at which two inertial observes move.

There is a nice relationship between the group velocity, the phase velocity and the energy transfer, the lightspeed in vacuum. To see it, look at the invariant:

Deriving this expression, we get

so we have the very important equation

Other important concept in electromagnetism is “light intensity”. Light intensity can be thought like the “flux of light”, and you can imagine it both in the wave or particle (photon corpuscles) theory in a similar fashion. Mathematically speaking:

so where u is the energy density of the electromagnetic field and c is the light speed in vacuum. By Lorentz transformations, it can be showed that for electromagnetic waves, energy, wavelength, energy density and intensity change in the following way:

The relativistic momentum can be related to the wavelength cuadrivector using the Planck relation . Under a Lorentz transformation, momenergy transforms . Assign to the wave number vector a direction in the S-frame:

and then

In matrix notation, the whole change is written as:

so

Using the first two equations, we get:

Using the first and the third equation, we obtain:

Dividing the last two equations, we deduce:

This formula is the so-called stellar aberration formula, and we will dedicate it a post in the future.

If we write the first equation with the aid of frequency f (and ) instead of angular frequency,

where we wrote the frequency of the source as and the frequency of the receiver as . This last formula is called the relativistic Doppler shift.

Now, we are going to introduce a very important object in electromagnetism: the electric charge and the electric current. We are going to make an analogy with the momenergy . The cuadrivector electric current is something very similar:

where is the electric current density, and is the charge velocity. Moreover, and where is the electric charge and is the electric charge density number, i.e., the number of “elementary” charges in certain volume. Indeed, we can identify the components of such a cuadrivector:

.

We can make some interesting observations. Suppose certain rest frame S where we have , i.e., a frame with equilibred charges , and suppose we move with the relative velocity of the electron (or negative charge) observer. Then and , while the other components are . Then, the charge density current transforms as follows:

and

We conclude:

1st. Length contraction implies that the charge density increases by a gamma factor, i.e., .

2nd. The crystal lattice “hole” velocity in the primed frame implies the existence in that frame of a current density .

3rd. The existence of charges in motion when seen from an inertial frame (boosted from a rest reference S) implies that in a moving reference frame electric fields are not alone but with magnetic fields. From this perspective, magnetic fields are associated to the existence of moving charges. That is, electric fields and magnetic fields are intimately connected and they are caused by static and moving charges, as we do know from classical non-relativistic physics.

Remember now the general expression of the FORPOWER tetravector, or Power-Force tetravector, in SR:

and using the metric, with the mainly plus convention, we get the covariant componets for the power-force tetravector:

We define the Lorentz force as the sum of the electric and magnetic forces

Noting that , the Power-Force tetravector for the Lorentz electromagnetic force reads:

And now, we realize that we can understand the electromagnetic force in terms of a tensor (1,1), i.e., a matrix, if we write:

so

Therefore,

where the components of the (1,1) tensor can be read:

We can lower the indices with the metric in order to have a more “natural” equation and to read the symmetry of the electromagnetic tensor (note that we can not study symmetries with indices covariant and contravariant),

with

Similarly

Please, note that . Focusing on the components of the electromagnetic tensor as a tensor type (1,1), we have seen that under Lorentz transformations its components change as under a boost with in such a case. So, we write:

From this equation we deduce that:

Example: In the S-frame we have the fields and . The Coulomb force is and the Lorentz force is . How are these fields seen from the S’-frame? It is easy using the above transformations. We obtain that

Surprinsingly, or not, the S’-observer sees a boosted electric field (non null!), a boosted magnetic field,  a boosted non-null Coulomb force and a null Lorentz force!

We can generalize the above transformations to the case of a general velocity in 3d-space

The last equal in the last two equations is due to the orthogonality of the position vector to the velocity in 3d space due to the cross product. From these equations, we easily obtain:

and similarly with the magnetic field. The final tranformations we obtain are:

Equivalently

In the limit where or , we get that

There are two invariants for electromagnetic fields:

and

It can be checked that

and

under Lorentz transformations. It is obvious since, up to a multiplicative constant,

and where we have defined the dual electromagnetic field as

or if we write it in components ( duality sends to and to )

We can guess some consequences for the electromagnetic invariants:

1st. If , then and thus in every frame! This fact is important, since it shows that plane waves are orthogonal in any frame in SR. It is also the case of electromagnetic radiation.

2nd. As can be in the non-orthogonal case either positive or negative. If is positive, then it will be positive in any frame and similarly in the negative case. Morevoer, a transformation into a frame with (null electric field) and/or (null magnetic field) is impossible. That is, if a Lorentz transformation of the electric field or the magnetic field turns it to zero, it means that the electric field and magnetic field are orthogonal.

3rd. If , i.e., if , then it is valid in every frame.

4th. If there is a electric field but there is no magnetic field B in S, a Lorentz transformation to a pure B’ in S’ is impossible and viceversa.

5th. If the electric field is such that or , then they can be turned in a pure electric or magnetic frame only if the electric field and the magnetic field are orthogonal.

6th. There is a trick to remember the two invariants. It is due to Riemann. We can build the hexadimensional vector( six-vector, or sixtor) and complex valued entity

The two invariants are easily obtained squaring F:

We can introduce now a vector potencial tetravector:

This tetravector is also called gauge field. We can write the Maxwell tensor in terms of this field:

It can be easily probed that, up to a multiplicative constant in front of the electric current tetravector, the first set of Maxwell equations are:

The second set of Maxwell equations (sometimes called Bianchi identities) can be written as follows:

The Maxwell equations are invariant under the gauge transformations in spacetime:

where the potential tetravector and the function are arbitrary functions of the spacetime.

Some elections of gauge are common in the solution of electromagnetic problems:

A) Lorentz gauge:

B) Coulomb gauge:

C) Temporal gauge:

If we use the Lorentz gauge, and the Maxwell equations without sources, we deduce that the vector potential components satisfy the wave equation, i.e.,

Finally, let me point out an important thing about Maxwell equations. Specifically, about its invariance group. It is known that Maxwell equations are invariant under Lorentz transformations, and it was the guide Einstein used to extend galilean relativity to the case of electromagnetic fields, enlarging the mechanical concepts. But, the larger group leaving invariant the Maxwell equation’s invariant is not the Lorentz group but the conformal group. But it is another story unrelated to this post.

## LOG#032. Invariance and relativity.

Invariance, symmetry and invariant quantities are in the essence, heart and core of Physmatics. Let me begin this post with classical physics. Newton’s fundamental law reads:

Suppose two different frames obtained by a pure translation in space:

or

We select to make things simpler

We can easily observe by direct differentiation that Newton’s fundamental is invariant under translations in space, since mere substitution provides:

since

By the other hand, rotations around a fixed axis, say the z-axis, are transformations given by:

If we multiply by the mass these last equations and we differentiate with respect to time twice, keeping constant and , we easily get

or

Thus, we can say that Newton’s fundamental law is invariant under spatial translations and rotations. Its form is kept constant under those kind of transformations. Generally speaking, we also say that Newton’s law is “covariant”, but nowadays it is an abuse of language since the word covariant means something different in tensor analysis. So, be aware about the word “covariant” (specially in old texts). Today, we talk about “invariant laws”, or about the symmetry of certain equations under certain set of (group) transformations.

Newton’s law use the concept of acceleration:

with

or, in compact form

And then, the following equations are invariant under translations in space and rotations:

or

with

Intrinsic components of the aceleration provide a decomposition

where we define

where is a unit vector in the direction of the velocity, and

In the case of motion along a general curve, we can approximate the motion in every point of the curve by a circle of radius R, and thus

By the other hand,

and we get the known expression for the centripetal acceleration:

More about invariant quantities in Classical Physics: the scalar (sometimes called dot) product of two vectors is invariant, since the length of every vector is constant in euclidean spaces under rotations and translations. For instance,

In matrix form,

where we have introduced the symbol to be the so-called Kronecker delta as “certain object” with components: its components are “1” whenever and “0” otherwise. Of course, the Kronecker delta symbol “is” the identity matrix when the symbol have two indices. However, let me remark that “generalized delta Kronocker” with more indices do exist and it is not always posible to express easily that “tensor” in a matrix way, excepting using some clever tricks.

The scalar (dot) product can be computed with any vector quantity:

Moreover, there is a coordinate free definition as well:

Note that the invariance of the dot product implies the invariance of classical kinetic energy, since:

We have also the important invariant quantities:

where the second equality holds if the force is constant along the trajectory. Moreover, in relativistic electromagnetism, you also get the wave-number 4-vector:

and the invariant , that you can get from the plane wave solution:

where the phase invariant reads

Therefore, we deduce that

and the wave number  vector satisfies the following relation with the wave-length

There is another important set of transformations or symmetry in classical physics. It is related to inertial frames. Galileo discovered that the laws of motion are the same for every inertial observer, i.e., the laws of Mechanics are invariant for inertial frames! A Galilean transformation is defined by:

where . Differentiating with respect to time, we get

and then

And thus, the accelerations (and forces) that observe different inertial ( i.e., reference frames moving with constant relative velocity) frames are the same

And now, about symmetry. What are the symmetries of Physics? There are many interesting transformations and space-time symmetries. A non-completely exhaustive list is this one:

1. Translations in space.

2. Translations in time.

3. Rotations around some axis ( and with fixed angle).

4. Uniform velocity in straight line, a.k.a., galilean transformations for inertial observers. This symmetry “becomes” Lorentz boosts in the spacetime analogue of special relativity.

5. Time reversal ( inversion of the direction of time), T.

6. Reflections in space (under “a mirror”). It is also called parity P.

7. Matter-antimatter interchange, or charge conjugation symmetry, C.

8. Interchange of identical atoms/particles.

9. Scale transformations .

10. Conformal transformations (in the complex plane or in complex spaces).

11. Arbitrary coordinate transformations (they are also called general coordinate transformations).

12. Quantum-mechanical (gauge) phase symmetry: .

Beyon general vectors, in classical physics we also find “axial” vectors (also called “pseudovectors”). Pseudovectors or axial vectors are formed by the 3d “cross”/outer/vector  product:

Some examples are the angular momentum

or the magnetic force

Interestingly, the main difference between axial and polar vectors, i.e., between common vectors and pseudovectors is the fact that under P (parity), pseudovectors are “invariant” while common vectors change their sign, i.e., polar vectors become the opposite vector under reflection, and pseudovectors remain invariant. It can be easily found by inspection in the definition of angular momentum or the magnetic force ( or even the general definition of cross product given above).

Now, we turn our attention to invariants in special relativity. I will introduce a very easy example to give a gross idea of how the generalization of “invariant theory” works as well in special relativity. From the classical definition of power:

Using the relativistic definition of 4-momentum:

where , we are going to derive a known result, since . Note that, in agreement with classical physics, from this

Therefore, inserting the relativistic expressions for energy and force into the power equation, we obtain:

Multiplying by 2M, and using the Leibniz rule for the differentiation of a product of two functions:

or equivalently

and so

Integrating this, we deduce that

If we plug

then

and thus, we have rederived the notion of “relativistic mass”

Special relativity generalizes the notion of dot product ( scalar product) to a non-euclidean (pseudoeuclidean to be more precise) geometry. The dot product in special relativity is given by:

The sign of the temporal fourth component is conventional in the sense some people uses a minus sign for the purely spatial components and a positive sign for the temporal component. Using a more advanced notation we can write the new scalar product as follows:

where the repeated dummy index implies summation over it. This convention of understanding summation over repeated indices is called Einstein’s covention and it is due to Einstein himself. Another main point about notation is that some people prefer the use of a while other people use . We will use the notation with unless we find some notational issue. Unlikely to the 3d world, the 4d world of special relativity forces us to use something different to the Kronecker delta in the above scalar product. This new object is generally called pseudoeuclidean “metric”, or Minkovski metric:

In matrix form,

Important remarks:

1st. in our convention. The opposite convention for the scalar product would give .

2nd. The square of a “spacetime” vector is its “lenght” in spacetime. It is given by:

In particular, for the position spacetime vector

3rd. Unlike the euclidean 3d space, 4d noneuclidean spacetime introduces “objects” non-null that whose “squared lenght” is equal to zero, and even weirder, objects that could provide a negative dot product!

4th. For spacetime events given by a spacetime vector , and generally for any arbitrary events A and B (or 4-vectors) we can distinguish:

i) Vectors with are called space-like vectors.

ii) Vectors with are called null-vectors, isotropic vectors or sometimes light-like vectors.

iii) Vectos with are called time-like vectors.

Thus, in the case of the spacetime (position) vector, every event can be classified into space-like, light-like (null or isotropic) and time-like types, depending on the sign of . Moreover, the metric itself allows us to “raise or lower” indices, defining the following rules for components:

The minkovskian metric has a very cool feature too. Its “square” is the identity matrix. That is,

Then, the metric is its own inverse:

In components, it reads

with

and where we have introduced the Kronecker delta symbol in four dimensions in the same manner we did in the 3d space. Therefore, the Kronecker delta has only non-null components when , so that

Subindices are called generally “covariant” components, while superindices are called “contravariant” components. It is evident that euclidean spaces don’t distinguish between covariant and contravariant components. The metric is the gadget we use in non-euclidean metric spaces to raise and lower indices/components from tensor quantities. Tensors are multi-oriented objects. The metric itself is a second order tensor, more precisely, the metric is a second order rank 2 covariant tensor. 4-vectors are contravariant object with a single index. Upwards single-indexed tensors are contravariant vectors, downwards single-indexed tensores are covariant vectors. When a metric is introduced, there is no need to distinguish covariant and contravariant tensors, since the components can be calculated with the aid of the metric, so we speak about n-th rank tensors. Multi-indixed objects can have some features of symmetry. The metric is symmetric itself, for instance, under the interchange of subindices ( columns and rows). So, then

What kind of general objects can we use in Minkovski spacetime or even more general spaces? Firstly, we have scalar fields or functions, i.e., functions depending only on the spacetime coordinates:

Another objetct we have found are “vectors” or “oriented segments”. In 3d space, they transform as . In 4d spacetime, we found .

In 3d space, we also found pseudovectors. They are defined via the cross product, that in components read: , where the new symbol is a completely antisymmetric object under the interchange of any pair of indices (with ) is generally called Levi-Civita symbol. This symbol is the second constant object that we can use in any number of dimensions, like the Kronecker delta

The completely antisymmetric Levi-Civita symbol has some interesting identities related with the Kronecker delta. Thus, for instance, in 2d and 3d respectively:

or

We have also the useful identity:

The n-dimensional Levi-Civita symbol is defined as:

and its product in n-dimensions

or equivalently, given a nxn matrix

This last equation provides some new quantity called pseudoscalar, different from the scalar function in the sense it changes its sign under parity in 3d, while a common 3d scalar is invariant under parity! Generally speaking, determinants (pseudoscalars) in even dimensions are parity conserving, while determinants in odd dimensions don’t conserve parity.

Like the Kronecker delta, the epsilon or Levi-Civita can be generalized to 4 dimensions (or even to D-dimensions). In 4 dimensions:

In general, unlike the Kronecker deltas, the Levi-Civita epsilon symbols are not ordinary “tensors” (quantities with subindices and superindices, with some concrete properties under coordinate transformations) but more general entities called “weighted” tensors (sometimes they are also called tensorial densities). Indeed, the generalized Kronecker delta can be defined of order 2p is a type (p,p) tensor that is a completely antisymmetric in its ”p” upper indices, and also in its ”p” lower indices.  This characterization defines it up to a scalar multiplier.

Using an anti-symmetrization procedure:

In terms of an determinant:

Equivalently, it could be defined by induction in the following way:

and so on.

In the particular case where  p=n  (the dimension of the vector space), in terms of the Levi-Civita symbol:

Under a Lorentz transformation, we have ( using matrix notation) the next transformations:

iff

so the metric itself is “invariant” under a Lorentz transformation (boost). I would like to remark that the metric can be built from the basis vectors in the following way:

For Lorentz transformations, we get that

with

Moreover, the equation , i.e., for pseudo-orthogonal Lorentz transformations, taking the determinant, we deduce that

We can fully classify the Lorentz transformations according to the sign of the determinant and the sign of the element as follows:

For instance, let us write 5 kind of Lorentz transformations:

1) Orthogonal rotations. They are continuous (proper) Lorentz transformations with a 3×3 submatrix :

2) Boosts. They are continuous (proper) Lorentz transformations mixing spacelike and timelike coordinates. The matrix has in this case the form:

3) PT symmetry. Discrete non-proper Lorentz transformation. It “inverts” space and time coordinates in the sense and . They belongs to . The matrix of this transformation is:

4) Parity. Discrete non-proper Lorentz transformation. It inverts only the spacelike components of true vectors ( be aware of pseudovectors!) in the sense . Sometimes, it is denoted by P, parity, and this transformation belongs to . It is defined as follows:

5) Time reversal, T. Discrete non-proper Lorentz transformation. It inverts the direction of time in the sense that . belongs to the set

Remark: If , then don’t change the sense of time. This is why they are called orthochronous!

## LOG#031. Entropic Gravity (II).

We will generalize the entropic gravity approach to include higher dimensions in this post. The keypoint from this theory of entropic gravity, according to Erik Verlinde, is that gravity does not exist as “fundamental” force and it is a derived concept. Entropy is the fundamental object somehow. And it can be generalized to a a d-dimensional world as follows.

The entropic force is defined as:

The entropic force is a force resulting from the tendency of a system to increase its entropy. Since the sign of the force (whether repulsive or attractive) is determined by how we take the definition of as it is related to the system in question.

An arbitrary mass distribution M induces a holographic screen   at some distance R that has encoded on it gravitational information. Today, we will consider the situation in d spatial dimensions.Using the holographic principle, the screen owns all physical information contained within its volume in bits on the screen whose number N is given by:

This condition implies the quantization of the hyperspherical surface, where the hyperarea (from the hypersphere) is defined as:

By the equipartition principle:

Therefore,

The entropy shift due to some displacement is:

Plugging the expression for the temperature and the entropy into the entropic force equation, we get:

and thus we finally get

i.e.,

where we have defined the gravitational constant in d dimensions to be

## LOG#030. Entropic Gravity (I).

In 2010, Erik Verlinde made himself famous once again. Erik Verlinde is a theoretical physicist who has made some contributions to String Theory. In particular, the so-called Verlinde formula. However, this time was not apparently a contribution related to string theory. He guessed a way to derive both the Newton’s second law and the Newton’s law of gravity. He received a prize time later, and some critical voices against his approach were raised.

I will review in this post his deductions.

A. Newton’s second law.

There are some hypothesis to begin with:

1st. Entropic force ansatz. Forces aren’t really fundamental, they are derived from some entropy functional. More precisely, forces are ”entropy fluxes”. Mathematically speaking:

or

2nd. Acceleration has a temperature. Equivalently, this is the well known Unruh’s effect from QFT in curved spacetime. Any particle that is accelerated is equivalent to some thermal system. This parallels the Hawking’s effect in black hole physics as well. It stands mysterious for me yet, since indeed, the temperature is relative to some vacuum or rest system.

3rd. Holographic principle.   A variant of the holographic principle is postulated to hold. The idea is that a particle separated certain distance from a “holographic screen” has an entropy shift:

Then, plugging the holographic entropy and the Unruh’s temperature into the entropic force ansatz, we get easily

i.e. we get the Newton’s second law of Dynamics

B. Newton’s gravity.  In order to get the Newton’s law of gravitation, we have to modify a bit the auxiliary hypothesis but yet we conserve the core approach.

1st. The entropic force ansatz. Again,

2nd. Holographic principle. Again,

3rd. Equipartition principle of relativistic energy.   Temperature is obtained at the statistical level when you distribute N quanta in thermal equilibrium, and they equal the relativistic energy formula. Equivalently,

4th. Microscopical degrees of freedom and minimal length ( or area quantization). The number of allowed microscopical quanta or microstates can not exceed and must match in the extreme case the ration of the area available and the square of Planck’s length ( or some other squared fundamental length). In other words, the number of bits can not overcome the area of a ball in Planck’s units. EQuivalently, the (hyper)area must be quantized (through a number N). Mathematically speaking,

Then, we plug the hypothesis 2 and 3 into 1, to have:

and now we use 4, in order to get

that is

And now, recalling that in 3 spatial dimensions, a ball has an area and that the Newton’s constant of gravity is indeed given as function of Planck’s length as , we have what we wanted to derive

i.e. the Newton’s gravitational law has been derived from the entropic force too

It is done. Is it just a trick or something deeper is behing all this stuff? Nobody knows for sure…People think he is probably wrong, but there are a whole line of research opened from his works. It is quite remarkable his approach is quite general and he suggests that every fundamental force is “entropic” or “emergent”, i.e., also electromagnetic fields, or even Yang-Mills fields could be entropic according to this approach.

Is he right? Time will tell…Some doubts arise from the fact that he has only derived the “temporal” components of Einstein Field Equations for gravity (a.k.a. newtonian gravitation) but, indeed, he and other physicists have been able to derive the remaining components as well. Perhaps, the strongest critics comes from neutron interferometry results. However, theoretical ideas like this one, like extra dimensions, could be saved by some clever argument.

## LOG#029. Interstellar trips in SR.

My final article dedicated to the memory of Neil Armstrong. The idea is to study quantitatively the relativistic rocket motion with numbers, after all we have deduced the important formulae, and we will explain what is happening in the two frames: S’-frame (in motion), S-frame (in rest on Earth). There are many “variations” of this problem, also called “Langevin’s paradox” or “the Langevin’s interstellar trip” problem by some authors. Here, we will follow the approach suggested in the book Gravitation, by Misner, Wheeler and Thorne, and we will study the interstellar trip (in the frame of special relativity) with the following conditions:

1st. Spacetime is locally minkovskian (i.e., spacetime is flat). The solution we will expose would not be valid in the case of an interstellar trip to a very far away quasar, or a very very long distance (about thousand millions of lightyears) where we should take into account the effect of the expansion of the Universe, i.e., that on large scales, spacetime is curved (in particular, accordingly to the current data, it is pseudoriemannian). Thus, we can use special relativity in order to calculate distances, velocities and accelerations from the purely kinematical sense. After all, it is logical, since General Relativity says that locally, in small enough regions of spacetime, spacetime is described by a minkovskian metric.

2nd. We select a 4 stage accelerated motion with our rocket. We will assume that our rocket is 100% efficient in the sense it uses photons as propellant particles. The four stages are: acceleration from rest to g (acceleration step 1), decceleration to rest with -g until we approach the destination (that would be the one-way trip), acceleration with -g (seen from the S-frame) and decceleration with +g ( with respect to the S-frame) to reach Earth again in rest at the end of the round-way trip. Schematically, we can draw a spacetime sketch of this 4 stage journey:

Please, note the symmetry of the procedure and the different travel steps.

3rd. We set g=9.8m/s², or, as we saw in one of our previous posts, so we use g=1.03lyr/yr² (in units where c=1).

4th. We can not refuel during the travel.

5th. In the case we return to Earth, we proceed to come back after we stop at the destination immediately. In this case, there is no refuel of the starship or rocket in any point of the trip.

6th. We neglect any external disturbance which can stop us or even destroy us, e.g., micrometeorites, cosmic radiations, comets, and any other body that could alter our route. Indeed, this kind of stuff has to be seriously considered in any realistic travel, but we want to solve an ideal problem consisting in an ideal interstellar trip according to the current knowledge.

The main quantities we have to compute are:

1. In the S’-frame of the rocket , in years. They are, respectively, the time we are accelerating with +g, the time we are decelerating with -g, and the total time accelerating supposing we return to earth immediately from our destination target.

2. Distance in which we are accelerating (x, in light years), seen from the S-frame (we will not discuss the problem in the S’-frame, since it involves lenght contraction and it is more subtle in the calculations). According to our previous studies, we have

3. Maximum depth in space D=2x. This allows us to select our target or destination to set the remaining parameters of the trip. Due to the symmetry of our problem, we have

4. Total length travelled by the spaceship/rocket (in the S’frame) in the roundtrip ( to the destination and back).

5. Maximum speed to an specific destination, after accelerating in a given proper time. It reads:

Indeed, the relativistic gamma factor is

6. S-frame duration t(years) of the stage 1 (acceleration phase 1). It is

7. One way duration of the trip (according to the S-frame):

8. Total duration of the trip in the S-frame ( round way trip):

9. Mass ratio of the final mass with the initial mass of the spaceship after 1 stage, 2 stages ( one way trip) and the 4 stages total round way trip:

10. Fuel mass vs. payload mass ratio (FM/PM) after 1 stage, 2 stages (until the destination) and the total trip:

We can obtain the following data using these expressions varying the proper time:

Here in the last two entries, data provided to be out of the limits of our calculator ( I used Libre Office to compute them). Now, we can make some final observations:

1st. We can travel virtually everywhere in the observable universe in our timelife using a photon rocket, a priori. However, it shows that the mass-ratio turns it to be theoretically impossible.

2nd. Remember that in the case we select very long distances, these calculations are not valid since we should use General Relativity to take into account the expansion of spacetime.

3rd. Compare with t, with , with . For instance, for then we get 57700 years, and , FM/PM=30000 (multiplying por m-kilograms gives the fuel mass).

4th. In SR, the technological problems are associated to the way photon rockets have, the unfavorable mass ratios (of final mass with initial mass) and fuel mass/payload rations necessary in the voyage (supposing of course, current physics and that we can not refuel during the trip).

5th. You can choose some possible distance destinations (D=2x) and work out the different parameters of the travel with the above equations.

In this way, for instance, for some celebrated known space marks, arriving at complete stop ( you can make other assumptions and see how the answer changes varying g or varying the arrival velocity too), we can easily get:

Example 1: 4.3 ly Nearest star (Proxima Centauri) in yrs (S’-frame).

Example 2: 27 ly Vega (Contact movie and book) star in yrs (S’-frame).

Example 3: 30000ly, our galactic center, in yrs (S’-frame).

Example 4: 2000000ly , the Andromeda galaxy, in yrs(S’-frame).

Example 5: Generally, you can travel ly anywhere (neglecting curved spacetime) in years (S’-frame).


text:
# Final Exam: Question 8: same structure

 0 Sir, you have said in the question that "if lists contain the same elements in the same structure ...", but sample outputs show that the two given input lists p and q need not contain "same elements", but same number of elements. Ex: 1st sample output (i agree with all other statements you have specified). This is what i have interpreted from the question. correct me if i am wrong sir. asked 02 Apr '12, 09:31 niranjan-1 4●1●2●2 accept rate: 0%

 0 Given the examples given in the homework description, I would agree with your interpretation. [1, 2] has not the same structure as [1,2,3] or ['ab'] or [1, [2]] but has the same structure as ['a', 'b']. print same_structure([1, [2, [3, [4, 5]]]], ['a', ['b', ['c', ['d', 'e']]]]) >>> True print same_structure([1, [2, [3, [4, 5]]]], ['a', ['b', ['c', ['de']]]]) >>> False  answered 02 Apr '12, 09:37 Elise 3.7k●5●16●56
 0 Try to create the tree for both the inputs - they should match in the shape but the leaf values may be different. So, they have same structure but the values may not be the same. answered 02 Apr '12, 09:59 rakesh kumar 1.5k●5●14●44
 0 In the case: print same_structure([1, [2, [3, [4, 5]]]], ['a', ['b', ['c', ['d', 'exam']]]])  Have they the same structure???? answered 02 Apr '12, 15:05 Pedro Montero-4 40●1●4 @Pedro Yes, they do. (02 Apr '12, 15:11) fnenu-1 ♦♦ Yes they have the same structure. (03 Apr '12, 08:45) Nilesh K Mol...
 -1 I have a deliciously clever way to do this, but as I'm not allowed to tell, I won't! Mwahahaha! answered 02 Apr '12, 15:17 Charles Lin 9.2k●42●94●135 how does one evaluate [] element in the list to compare structure? For example if value of a is integer and value of b is [] structurally they are not the same. In this case how does evaluate b. I tried a == [] or b == []. For some reason it doesn't work. (06 Apr '12, 01:36) Parikh Jagdi...
Question text:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• image?![alt text](/path/img.jpg "Title")
• numbered list: 1. Foo 2. Bar
• to add a line break simply add two spaces to where you would like the new line to be.
• basic HTML tags are also supported

×15,218
×664
×637
×369
×19
×9

format: plain


text:
Update all PDFs

# Reflecting reflections

Alignments to Content Standards: 8.G.A.3

Below is a picture of a triangle on a coordinate grid:

1. Draw the reflection of $\triangle ABC$ over the line $x = -2$. Label the image of $A$ as $A^\prime$, the image of $B$ as $B^\prime$ and the image of $C$ as $C^\prime$.
2. Draw the reflection of $\triangle A^{\prime}B^{\prime}C^\prime$ over the line $x = 2$. Label the image of $A^\prime$ as $A^{\prime \prime}$, the image of $B^\prime$ as $B^{\prime \prime}$ and the image of $C^\prime$ as $C^{\prime \prime}$.
3. What single rigid transformation of the plane will map $\triangle ABC$ to $\triangle A^{\prime \prime}B^{\prime \prime}C^{\prime \prime}$? Explain.

## IM Commentary

The goal of this task is to give students an opportunity to experiment with reflections of triangles on a coordinate grid. Students are not prompted in the question to list the coordinates of the different triangle vertices but this is a natural extension of the task. Another valid approach would use the geometry of the coordinate grid without making explicit reference to the coordinates of the triangle vertices. This approach is also valuable in preparation for the coordinate-free transformation approach to reflections which will be seen in high school.

This task examines the composition of successive reflections about parallel lines. The result is a translation. If we denote by $L_1$ the first line, $x = -2$, and by $L_2$ the second line, $x = 2$, then the composition of reflection about $L_1$ followed by reflection about $L_2$ is a translation by twice the distance between $L_1$ and $L_2$ (in the direction going from $L_1$ to $L_2$).

If the teacher wishes to give students further work with reflections, a good question would be to have them first reflect $\triangle ABC$ about $x = 2$ and then about $x = -2$. This is also a translation but is it the same translation as in part (c) of the problem? This is an important example of two transformations (reflections of the plane) which do not commute: that is, the order in which the reflections are implemented changes the outcome.

The teacher may also wish to examine the case of successive reflections about lines which are not parallel: for example the line $y = x$ and the $x$-axis. Here again the order in which the reflections are performed will matter and the result will be a rotation. A little more work in this direction shows the remarkable fact that all rigid motions of the plane can be written in terms of reflections.

## Solution

1. Below is a picture of triangle $ABC$ and its reflection about $x = -2$, triangle $A^{\prime}B^{\prime}C^\prime$.

Note that $C^\prime = C$ becuase $C$ lies on the line $x = -2$. Points on $x = -2$ are not influenced by the reflection. For points which are not on $x = -2$, the $y$-coordinate remains the same. To see why, consider the point $A = (-5,2)$. This is on the line $y = 2$ which is perpendicular to the line $x = -2$. If we take $A^\prime = (1,2)$ then $x = -2$ is the perpendicular bisector of $\overline{AA^\prime}$ and this means that $A^\prime$ is the reflection of $A$ over the line $x = -2$. Similarly, $B^\prime = (-1,1)$ because $x = -2$ is the perpendicular bisector of $\overline{BB^\prime}$.

2. Below is the picture of triangle $ABC$ and its reflection $A^{\prime}B^\prime C^\prime$ together with the reflection of $A^{\prime}B^{\prime}C^\prime$ over the line $x = 2$.

As in part (a), the $y$-coordinates of $A^{\prime \prime}$, $B^{\prime \prime}$, and $C^{\prime \prime}$ are the $y$-coordinates of $A,B,$ and $C$. Also as in part (a), the $x$-coordinate of $A^{\prime \prime}$, $B^{\prime \prime}$, and $C^{\prime \prime}$ is selected so that the line $x = 2$ is the perpendicular bisector of segments $\overline{A^{\prime}A^{\prime \prime}}$, $\overline{B^{\prime}B^{\prime \prime}}$, and $\overline{C^{\prime}C^{\prime \prime}}$.

3. The picture below shows triangles $ABC$ and $A^{\prime \prime}B^{\prime \prime}C^{\prime \prime}$ and the blue arrows indicate that to transform $\triangle ABC$ to $\triangle A^{\prime \prime}B^{\prime \prime}C^{\prime \prime}$ we can translate by $8$ units to the right. So the composition of these two reflections about $x = -2$ and $x = 2$ is a translation by $8$ units to the right.

Further experimentation with reflections about parallel lines will show that the fact that the translation here moves to the right comes from the fact that the line $x = 2$ is to the right of $x = -2$. The fact that it is a translation by $8$ units is related to the fact that $x = 2$ is one half of this, or $4$ units, to the right of $x = -2$.

#### James King says:

over 5 years

This is very nicely presented and thought out as far as it goes, but I would suggest that it should go further, and not as an extension but as an essential piece of the story.

It is very common for students to successfully go through an example like this but not to understand that one gets the same translation whatever figure is double-reflected. So I think teachers should be encouraged to have students apply the same reflections to a variety of triangles or maybe other shapes. If different students or groups got different sets of two or three different triangles or shapes, this would generate a rich supply of examples.

Also, I would suggest that this triangle is too "nice" to be the only sort of example, though it is a good place to start. Examples should include a triangle to the right of the first reflection line, between the reflection lines, or a triangle with a side intersecting a reflection line.

The fact that all of these are translated in the same way is surprising and interesting, but it is really the point of the whole topic.

And, yes, it would also be very good to give multiple examples of pairs of mirror lines.

#### Kristin says:

over 5 years

What you suggest sounds like a lesson plan or part of a unit. We are in the process of developing templates and review criteria for larger chunks such as these. Once we have that infrastructure in place, it will be great to have these kinds of suggestions that can be used to develop our tasks into coherent units.


text:
The "average" value of a function, f, on the interval $a\le x\le b$ is $\frac{\int_a^b f(x)dx}{b-a}$ so knowing that the average of f on [tex]a\le x\le 5[/itex] is 4 tells you that $\frac{\int_2^5 f(x)dx}{3}= 4$ so $\int_2^5 f(x)dx= 4(3)= 12$.
$\int_2^5 (3f(x)+ 2)dx= 3\int_2^5 f(x)dx+ 2\int_2^5 dx$.


text:
# On the test track: New JackRabbit, open the throttle wide …

I know, I know, I really should wait until the drive build is done. I know I should do that.

[root@Mj?lnir ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/md0 89G 6.8G 77G 9% /
tmpfs 127G 0 127G 0% /dev/shm
/dev/sdc 48T 393G 47T 1% /data/3
/dev/sdb 48T 395G 47T 1% /data/2
/dev/sdd 33T 367G 33T 2% /data/4
/dev/sda 48T 374G 47T 1% /data/1

I called it Mj?lnir, as I liked this quote:

Mj?lnir is depicted in Norse mythology as one of the most fearsome weapons, capable of leveling mountains.

(or as I like to think of it)

… of data.

But I gotta know. How fast can this system run?

Start up our 1TB write. This is simply streaming 1TB of data out to the drives. Thats it. Only a file system. Simple stream. Uncached. So this is really … really streaming.

And its being burdened by the volume build. So we aren’t at maximum speed.

Light up fio with our test, and …

… start up dstat in another window, give it some time, and then …

  1   2  90   7   0   0|   0  6482M| 240B 1048B|   0     0 |  19k 6228
1   2  90   7   0   0|   0  5908M|   0     0 |   0     0 |  18k 5523
1   2  90   8   0   0|   0  5667M|4970B   11k|   0     0 |  18k 5565
1   2  88  10   0   0|   0  6042M|   0     0 |   0     0 |  16k 5902
1   2  90   8   0   0|   0  6663M|5894B   11k|   0     0 |  21k 6567
1   2  90   7   0   0|   0  6479M|   0     0 |   0     0 |  20k 6229
1   2  90   7   0   0|   0  6808M|7118B   14k|   0     0 |  22k 6660
----total-cpu-usage---- -dsk/total- -net/total- ---paging-- ---system--
usr sys idl wai hiq siq| read  writ| recv  send|  in   out | int   csw
1   2  90   7   0   0|   0  6517M|   0     0 |   0     0 |  20k 6234
1   2  90   7   0   0|   0  6905M|5090B   11k|   0     0 |  21k 6588
1   2  90   7   0   0|   0  6696M|   0     0 |   0     0 |  23k 6331
1   2  89   9   0   0|   0  6668M|1284B 2797B|   0     0 |  19k 6202
1   1  89   9   0   0|   0  5301M|   0     0 |   0     0 |  15k 5020
1   2  90   7   0   0|   0  5979M| 240B 1048B|   0     0 |  18k 5876

Yeah, its like that.

Imagine what this baby could do when its done with the build.

Imagine.

I’ll try to show you in a few hours.

Viewed 59687 times by 4411 viewers


text:
# Finding Goroutine Bugs with TLA+

Posted on

My job these days is teaching TLA+ and formal methods: specifying designs to find bugs in them. But just knowing the syntax isn’t enough to write specs, and it helps to have examples to draw from. I recently read Chris Siebenmann’s Even in Go, concurrency is still not easy and thought it would make a good case study for writing a spec. In it, he gives an example of Go code which deadlocks:

/*1 */ func FindAll() []P { //P = process data
/*2 */    pss, err := ps.Processes()
/*3 */    [...]
/*4 */    found := make(chan P)
/*5 */    limitCh := make(chan struct{}, concurrencyProcesses)
/*6 */
/*7 */    for _, pr := range pss {
/*8 */       limitCh <- struct{}{}
/*9 */       pr := pr
/*10*/       go func() {
/*11*/          defer func() { <-limitCh }()
/*12*/          [... get a P with some error checking ...]
/*13*/          found <- P
/*14*/       }()
/*15*/    }
/*16*/    [...]
/*17*/
/*18*/    var results []P
/*19*/    for p := range found {
/*20*/       results = append(results, p)
/*21*/    }
/*22*/    return results
/*23*/ }

In his words:

The bug is that the goroutines only receive from limitCh to release their token after sending their result to the unbuffered found channel, while the main code only starts receiving from found after running through the entire loop, and the main code takes the token in the loop and blocks if no tokens are available.

Let’s model this in TLA+!

Note: this example assumes some basic knowledge of TLA+ and PlusCal. If you know what a process label is, then you’re fine. We’re not looking at race conditions so you shouldn’t need to know the finer points of labels and actions, but it might make things more intuitive. I included syntax explanations where appropriate. It also assumes some basic knowledge of Go, which I am in no way qualified to explain.

It’s good to start with some upfront thinking of how we are going to approach this problem. There’s two parts to formally specifying something: describing the system and describing the properties of the system. In this case we can ignore the second part, since we’re only looking for deadlocks. It would be good modeling practice to add sanity check properties, like type invariants, but they are not strictly necessary.

We have a choice of doing everything in TLA+ or using a mix of TLA+ and PlusCal, a sequential algorithm DSL that compiles to TLA+. Since the Go code is highly sequential and because PlusCal is easier for outsiders to understand, I will use PlusCal. This will cause a bit of impedance mismatch down the road for unbuffered channels but overall it’s a net benefit. The core structure of a PlusCal spec is a set of defined processes with both local and global state. At the very least we will have one process for main and one process for each of the goroutines.

There are three “complex bits” to Chris’s code sample: go, defer, and the nature of Go channels. defer runs cleanup code when a goroutine is finished running. For now we’ll represent this by moving the deferred code to its own label, but we could also use a PlusCal procedure to be more accurate. go spawns a new goroutine. Since PlusCal requires us to define all of our processes in advance, we can’t “spawn” a new goroutine. What we can do instead is define each process but prevent them from running. Then we add a flag that says whether or not the goroutine was initialized in the behavior yet. It would look something like this:

variables
initialized = [w \in Routines |-> FALSE];

\* ...

process goroutine \in Routines
begin
Work:
await initialized[self];
\* ...

syntax explanation
• Routines is a set of identifiers I’ll define in the spec itself. Let’s assume it’s {1, 2, 3} for now.
• initialized is a TLA+ function, or mapping. It’s a mathematical function, not a programmatic one. initialized[1] = FALSE, initialized[2] = FALSE, etc.
• By writing goroutine \in Routines, I’m declaring one independent concurrent process for element of Routines. In this case, that’d be 3 processes.
• self is the local identifier assigned to a process.

So each goroutine awaits being initialized by the main process before it does anything. This is how we can emulate spawning new processes.

That leaves the channels, which are the most complicated part to specify. There are two kinds of Go channels: buffered and unbuffered. Sends to a buffered channel are blocked if the channel is full. Receives from a buffered channel are blocked if the channel is empty. Both of these are representable with PlusCal macros:

macro send_buffered(chan) begin
await channels[chan] < buffered[chan];
channels[chan] := channels[chan] + 1;
end macro;

await channels[chan] > 0;
channels[chan] := channels[chan] - 1;
end macro;

For the purposes of pedagogy I’m not modeling what we actually read or write. This is good practice when writing real-world specs too: write the simplest specification that usefully captures behavior and iteratively add detail to that.

That covers buffered channels. Unbuffered channels, by contrast, always block unless there is both a sender and receiver. In pure TLA+ this wouldn’t be too tricky to specify, but PlusCal assumes each step of the behavior is one process doing one thing. Unbuffered channels can’t be represented natively without adding some annoying bookkeeping, as we need to have one process block “first”. We’ll address that when we get to the spec.

So now that we know a rough approach and what the pain points are likely to be, let’s write the spec.

### The spec

---- MODULE channels ----
EXTENDS Integers, TLC, Sequences

CONSTANTS NumRoutines, NumTokens
Routines == 1..NumRoutines

show syntax
• EXTENDS are imports.
• CONSTANTS are values configurable per run, so I can run one model check with 2 goroutines and 1 token and a different check with 6 goroutines and 25 tokens. Both constants are assumed to be positive integers, which I am not enforcing out of pure laziness.
• == defines a new operator, or airquotes “programming function”. We’re saying that Routines is the set {1, 2, ... , NumRoutines}.

(* --algorithm channels

variables
channels = [tokens |-> 0, found |-> {}];
buffered = [tokens |-> NumTokens];
initialized = [w \in Routines |-> FALSE];

channels is the current contents of each channel. For buffered channels, we treat their contents as a single number and store the maximum capacity in a separate buffered variable. For unbuffered channels, we instead store the set of senders waiting for a receiver. initialized is for emulating goroutines.

macro go(routine) begin
initialized[routine] := TRUE;
end macro

An extra macro I added to more closely match the Go syntax.

macro write_buffered(chan) begin
await channels[chan] < buffered[chan];
channels[chan] := channels[chan] + 1;
end macro;

if chan \in DOMAIN buffered then
await channels[chan] > 0;
channels[chan] := channels[chan] - 1;
else
await channels[chan] /= {};
with w \in channels[chan] do
channels[chan] := channels[chan] \ {w}
end with;
end if;
end macro;

This is a change from our old read_buffered because it handles both buffered and unbuffered channels. Buffered channels work as expected. For unbuffered channels, we wait for the set of blocked writers to be nonempty and nondeterministically declare that we read from one of them.1

procedure write_unbuffered(chan) begin
DeclareSend:
channels[chan] := channels[chan] \union {self};
Send:
await self \notin channels[chan];
return;
end procedure

show syntax
• procedure declares a multistep programmatic function. Other processes are allowed to interrupt between running DeclareSend and Send.
• return terminates the procedure. Finishing a procedure without a return is considered an error.

To model unbuffered channels we can either put state on senders or put state on receivers. I opted to place it on the sender because Go permits reading from multiple unbuffered channels at once.2 In two separate temporal steps we 1) add the process to the set of channel senders and 2) wait to be removed from that set by a receiver.

process goroutine \in Routines
begin
A:
await initialized[self];
call write_unbuffered("found");
B:
end process;

Our goroutine process is a straightforward translation of the Go code. First we wait for the goroutine to be initialized, corresponding to line 10. Then we write to the found channel (line 13). If I was trying to be more faithful I would write special defer semantics, but for this I’m happy to just stick it on a label at the end of the process.

process main = 0
variables i = 1;
begin
Main:
while i <= NumRoutines do
write_buffered("tokens");
go(i);
i := i + 1;
end while;
Get:
while i > 1 do
i := i - 1;
end while;
end process;

end algorithm; *)

TLA+ doesn’t have a native for loop, so we have to emulate it with while. Unlike programming languages, we count 1..N, not 0..(N-1). Our emulation uses one token to initialize each goroutine. Since write_channel has an await in it, it will block if there are more goroutines than tokens. It will then stay blocked until a goroutine releases a token.3 Final spec:

show spec
---- MODULE channels ----
EXTENDS Integers, TLC, Sequences

CONSTANTS NumRoutines, NumTokens

Routines == 1..NumRoutines

(* --algorithm channels

variables
channels = [limitCh |-> 0, found |-> {}];
buffered = [limitCh |-> NumTokens];
initialized = [w \in Routines |-> FALSE];

macro send_buffered(chan) begin
await channels[chan] < buffered[chan];
channels[chan] := channels[chan] + 1;
end macro;

if chan \in DOMAIN buffered then
await channels[chan] > 0;
channels[chan] := channels[chan] - 1;
else
await channels[chan] /= {};
with w \in channels[chan] do
channels[chan] := channels[chan] \ {w}
end with;
end if;
end macro;

macro go(routine) begin
initialized[routine] := TRUE;
end macro

procedure send_unbuffered(chan) begin
DeclareSend:
channels[chan] := channels[chan] \union {self};
Send:
await self \notin channels[chan];
return;
end procedure

process goroutine \in Routines
begin
A:
await initialized[self];
call send_unbuffered("found");
B:
end process;

process main = 0
variables i = 1;
begin
Main:
while i <= NumRoutines do
send_buffered("limitCh");
go(i);
i := i + 1;
end while;
Get:
while i > 1 do
i := i - 1;
end while;
end process;

end algorithm; *)
====

Now that we have a full spec, we can use the model checker, TLC, to see if it satisfies any properties. We didn’t specify any, but TLC will check for deadlocks by default. I’m going to model check it with 3 goroutines and 2 tokens. 4

show error
State 1: <Initial predicate>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 0, found |-> {}]
/\ i = 1
/\ pc = (0 :> "Main" @@ 1 :> "A" @@ 2 :> "A" @@ 3 :> "A")
/\ initialized = <<FALSE, FALSE, FALSE>>

State 2: <Main line 128, col 9 to line 137, col 48 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 1, found |-> {}]
/\ i = 2
/\ pc = (0 :> "Main" @@ 1 :> "A" @@ 2 :> "A" @@ 3 :> "A")
/\ initialized = <<TRUE, FALSE, FALSE>>

State 3: <Main line 128, col 9 to line 137, col 48 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 2, found |-> {}]
/\ i = 3
/\ pc = (0 :> "Main" @@ 1 :> "A" @@ 2 :> "A" @@ 3 :> "A")
/\ initialized = <<TRUE, TRUE, FALSE>>

State 4: <A line 106, col 12 to line 114, col 64 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 2, found |-> {}]
/\ i = 3
/\ pc = (0 :> "Main" @@ 1 :> "A" @@ 2 :> "DeclareSend" @@ 3 :> "A")
/\ initialized = <<TRUE, TRUE, FALSE>>

State 5: <A line 106, col 12 to line 114, col 64 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 2, found |-> {}]
/\ i = 3
/\ pc = (0 :> "Main" @@ 1 :> "DeclareSend" @@ 2 :> "DeclareSend" @@ 3 :> "A")
/\ initialized = <<TRUE, TRUE, FALSE>>

State 6: <DeclareSend line 92, col 22 to line 95, col 77 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 2, found |-> {1}]
/\ i = 3
/\ pc = (0 :> "Main" @@ 1 :> "Send" @@ 2 :> "DeclareSend" @@ 3 :> "A")
/\ initialized = <<TRUE, TRUE, FALSE>>

State 7: <DeclareSend line 92, col 22 to line 95, col 77 of module base>
/\ buffered = [limitCh |-> 2]
/\ channels = [limitCh |-> 2, found |-> {1, 2}]
/\ i = 3
/\ pc = (0 :> "Main" @@ 1 :> "Send" @@ 2 :> "Send" @@ 3 :> "A")
/\ initialized = <<TRUE, TRUE, FALSE>>

It’s the same issue that Chris had. The goroutines can only return their tokens if there is a receiver on the found channel, the only receiver of that channel is main, main only reads after it initializes all the goroutines, and main will block if there are more goroutines than tokens. The goroutines can’t return tokens until all goroutines are initialized, and main can’t initialize all goroutines until some goroutines have returned their tokens.

### Fixing This

Chris suggests three possible ways of fixing this. We can test each of the three by modifying our spec:

If the goroutines took the token by sending to limitCh instead of the main for loop doing it, the bug would not exist;

process goroutine \in Routines
begin
A:
await initialized[self];
+   write_buffered("limitCh");

\* ...

while i <= NumRoutines do
-     write_buffered("limitCh");
initialized[i] := TRUE;
i := i + 1;
end while;

This passes model checking.

If the goroutines received from limitCh to release their token before sending to found, it wouldn’t exist (but because of error handling, it’s simpler and more reliable to do the receive in a defer).

process goroutine \in Routines
begin
A:
await initialized[self];
-   call write_unbuffered("found");
B:
+   call write_unbuffered("found");
end process;

This passes model checking.

And if the entire for loop was in an additional goroutine…

This one’s a little more complicated. We create a new process for the loop and add its identifier to initialized. I’ll use -1 to represent the for loop.

initialized = [w \in Routines \union {-1} |-> FALSE];

\* After goroutines

process for_loop = -1
variables i = 1;
begin
Loop:
while i <= NumRoutines do
write_buffered("limitCh");
go(i);
i := i + 1;
end while;
end process;

Then we modify main to initialize this instead of doing the loop itself:

process main = 0
variables i = NumRoutines;
begin
Main:
go(-1);
Get:
while i > 0 do
i := i - 1;
end while;
end process;

This passes model checking.

## Discussion

Ultimately we wrote about 75 lines of specification to test 20 lines of Go code. Over half the spec is channel logic which we can now reuse in other specs. Discounting those puts us a little closer, though I’ll admit that a real TLA+ spec would be a lot longer because you’d be writing a lot more sanity checking properties. Noneless, writing the TLA+ version wouldn’t be significantly more effort than writing the original version and could save you net time if it caught the deadlock before production.

Obviously I’m inclined towards using TLA+, given it’s my professional language of choice. However, I suspect that TLA+ isn’t exactly the right tool for modeling Go channels. That’s because there’s another formal method, called Spin, which is much closer to Go’s native semantics. It even has channels as a native datatype. I’ve not used Spin so cannot comment on how effective it truly is but I imagine it would work very well in this domain. It’s also been used before to model the runtime scheduler, though that spec was removed when it eventually fell out of sync. You can see a Spin specification of the same problem here.

If you’re interested in learning more about formal methods, I wrote a book and am running a 3-day TLA+ workshop in October. You can also follow my newsletter where I discuss formal methods techniques and patterns.

Thanks to Richard Whaling and Damian Gryski for feedback.

I shared the first draft of this essay on my newsletter. If you like my writing, why not subscribe?

1. with blocks if the set is empty, making the await statement above it redundant. I added it purely for clarity. [return]
2. You can also use a select to send to multiple channels, but I think that’s less common? This is where being able to write a raw TLA+ action could be really helpful. [return]
3. Get is an inaccurate representation of how channel receives in a range work: it should loop until the channel is closed. I left that out here because the rest of the spec doesn’t depend on closing channels and I didn’t want to add extra complexity to this example. [return]
4. Note for people following along: while I strongly recommend beginners use the official IDE, I personally prefer to run things from the command line while writing essays. I wrote a simple cli wrapper, which isn’t nearly as full-featured as the toolbox but gets what I need done. With the wrapper, you can reproduce the model run with tlacli check channels.tla --constant NumRoutines 3 --constant NumTokens 2 --model-value defaultInitValue. [return]
5. I removed the stack and chan variables from the trace to make it a little clearer. PlusCal uses stack to track bookkeeping information in procedures, while chan tracks what inputs were passed in as arguments. [return]


text:
Equal Factors over Equal Intervals

Alignments to Content Standards: F-LE.A.1.a

1. Complete the table below. Is $\Delta x$ a constant? If so, what constant is it? What do you notice about the 3rd column of the table?

$x$ $f(x)=128\cdot \left({\frac {1}{2}}\right)^x$ Successive quotients
0 128 ----
1 64 $\frac{f(1)}{f(0)}=\frac {64}{128} = \frac{1}{2}$
2 $\frac{f(2)}{f(1)}=$
3
4
2. Complete the table below. Is $\Delta x$ a constant? If so, what constant is it? What do you notice about the 3rd column of the table?

3. $x$ $f(x)=128\cdot \left({\frac {1}{2}}\right)^x$ Successive quotients
0 128 ---
2 32 $\frac{f(2)}{f(0)} = \frac {32}{128} = \frac{1}{4}$
4 $\frac{f(4)}{f(2)}=$
6
8
4. Let $f(x)=a \cdot b^x$. Let $x_0$ be any particular $x$-value. Show that if $x_0$ is increased by a constant, $\Delta x$, the successive quotient $$\frac{f(x_0+ \Delta x)}{f(x_0)}$$ is always the same no matter what $x_0$ is.
5. Is b) an example of the result of c)? Explain.

IM Commentary

This problem assumes that students are familiar with the notation $x_0$ and $\Delta x$. However, the language "successive quotient" may be new. Examples in the third columns of the charts are designed to help students become familiar with this language. Depending on the students's prior exposure to exponential functions and their growth rates, instructors may wish to encourage students to repeat part (b) for a variety of exponential functions and step sizes before proceeding to the most general algebraic setting in part (c).

Two other problems (F-LE Equal Differences over Equal Intervals 1 and F-LE Equal Differences over Equal Intervals 2) illustrate the linear function portion of F-LE.1a.

Solution

1. $x$ $f(x)=128\cdot \left({\frac {1}{2}}\right)^x$ Successive quotients
0 128 ----
1 64 $\frac {64}{128} = \frac{1}{2}$
2 32 $\frac {32}{64} = \frac{1}{2}$
3 16 $\frac {16}{32} = \frac{1}{2}$
4 8 $\frac {8}{16} = \frac{1}{2}$
$\Delta x$, the change in successive $x$ values, is constant, as its value is 1. The third column in the table always takes the value $\frac{1}{2}$.
2. $x$ $f(x)=128\cdot \left({\frac {1}{2}}\right)^x$ Successive quotients
0 128 ---
2 32 $\frac {32}{128} = \frac{1}{4}$
4 8 $\frac{8}{32} = \frac{1}{4}$
6 2 $\frac{2}{8} = \frac{1}{4}$
8 $\frac{1}{2}$ $\frac{\frac{1}{2}}{2} = \frac{1}{4}$
$\Delta x$, the change in successive $x$ values, is constant, as its value is 2. The third column of the table always takes the value $\frac{1}{4}$.

3. $f(x_0)=a \cdot b^{x_0}$ and $f(x_0+\Delta x)=a \cdot b^{x_0+\Delta x}$. So, the quotient can be rewritten as follows: $$\frac{a \cdot b^{x_0+\Delta x}}{a \cdot b^{x_0}} = \frac{b^{x_0} \cdot b^{ \Delta x}}{b^{x_0}}=b^{ \Delta x}$$ Since both $b$ and $\Delta x$ are constants, the quotient is constant. In particular, the quotient does not depend on the value of $x_0$.
4. In b) the $\Delta x = 2$ and the base, $b$, is $\frac {1}{2}$. The constant successive quotients were $\frac{1}{4}=\frac{1}{2}^{2}=b^{ \Delta x}$. So b) is an example of the result in c).


text:
Thread: Distribution until the First Increase?

1. Distribution until the First Increase?

Hey,

On a homework I've been given this problem. I don't even know where to start. Is there a name for this distribution or a way I can look up more information about it? Thanks!

----

Let $\displaystyle X_1, X_2,...$ be independent identically distributed continous random variables. We call $\displaystyle n$ the first time of increase if

$\displaystyle X_1>X_2>X_3>...>X_{n-1}<X_n$

Let $\displaystyle N$ be the time until the first increase. Show that $\displaystyle E[N]=e$.

----

The hint we were given was to use the tail sum formula for a random variable taking values in the positive integers. But how do you go from a discrete formula to a continuous one? I am completely lost. What is this distribution called?

Thanks guys!

2. Originally Posted by mbaboy
Hey,

On a homework I've been given this problem. I don't even know where to start. Is there a name for this distribution or a way I can look up more information about it? Thanks!

----

Let $\displaystyle X_1, X_2,...$ be independent identically distributed continous random variables. We call $\displaystyle n$ the first time of increase if

$\displaystyle X_1>X_2>X_3>...>X_(n-1)<X_n$

Let $\displaystyle N$ be the time until the first increase. Show that $\displaystyle E[N]=e$.

----

The hint we were given was to use the tail sum formula for a random variable taking values in the positive integers. But how do you go from a discrete formula to a continuous one? I am completely lost. What is this distribution called?

Thanks guys!
The nice fact is that the distribution of $\displaystyle N$ does not depend on the distribution of the $\displaystyle X_i$'s (provided it is diffuse: $\displaystyle P(X_i=x)=0$ for any $\displaystyle x$).

You should notice that all the orderings of $\displaystyle X_1,\ldots,X_n$ are equally likely. This is just because the r.v. $\displaystyle X_1,\ldots,X_n$ play symmetric roles (you should try to write a full proof). Therefore, there is only 1 chance out of $\displaystyle n!$ to have $\displaystyle X_1>\cdots>X_{n-1}>X_n$, for instance.

Use this to compute $\displaystyle P(N=n)=P(X_1>\cdots>X_{n-1}\mbox{ and }X_{n-1}<X_n)$...

After this (short) computation, the expected value will be straightforward.

3. Ok tell me if I am on the right track. I'm not exactly sure how to compute this.

$\displaystyle P(N=n)=P(X_1>\cdots>X_{n-1}\mbox{ and }X_{n-1}<X_n)$

$\displaystyle =P(X_1>X_2)P(X_2>X_3)P(X_3>X_4)...P(X_{n-2}>X_{n-1})P(X_{N-1}<Xn)$

$\displaystyle =\frac{1}{2} \times \frac{1}{2^2} \times \frac{1}{2^3}...\frac{1}{2^{n-1}}$

Ok clear I make no sense. Maybe if someone could tell me what this evaluates to I could find my way to it? I just don't see how an $\displaystyle e$ can pop out whereas the only two ways to calculate $\displaystyle e$ I know are

$\displaystyle \lim_{k\to\infty}(1+\frac{1}{k})^k$ and $\displaystyle e^z=\sum_{i=1}^\infty \frac{z^i}{i!}$

I'm guessing the first comes up when evaluating an integral to get the expected value. Any help? I have take only a little probability.

4. Originally Posted by mbaboy
Ok tell me if I am on the right track. I'm not exactly sure how to compute this.

$\displaystyle P(N=n)=P(X_1>\cdots>X_{n-1}\mbox{ and }X_{n-1}<X_n)$

$\displaystyle =P(X_1>X_2)P(X_2>X_3)P(X_3>X_4)...P(X_{n-2}>X_{n-1})P(X_{N-1}<Xn)$

$\displaystyle =\frac{1}{2} \times \frac{1}{2^2} \times \frac{1}{2^3}...\frac{1}{2^{n-1}}$

Ok clear I make no sense.
Indeed, the events are not independent, so the probability isn't just the product of the probabilities.

Read again my previous post. It tells that the only property you need is that, for any permutation $\displaystyle \sigma$ of $\displaystyle \{1,\ldots,n\}$, $\displaystyle P(X_{\sigma(1)}>\cdots >X_{\sigma(n)})=\frac{1}{n!}$. This is just because these events have same probability and they partition the probability space (one and only one of these events happens).

Now, you can write the event $\displaystyle \{N=n\}$ using these events: to which orders does it correspond? Each order has probability $\displaystyle \frac{1}{n!}$, so... It is a one-liner but I would like you to find it.

5. Ok so tell me if this makes sense.

$\displaystyle P(N=n)=P(X_1>\cdots>X_{n-1}\mbox{ and }X_{n-1}<X_n)$

so $\displaystyle E(X)=\sum_{n=1}^\infty \frac{n}{n!}=e$

Is that right? Can I do that summation since $\displaystyle n!$ only takes values on the positive integers? I'm just confused because $\displaystyle X_i$ can be defined continuously on all real numbers, yet somehow I am suppose to end up with a summation that evaluates to $\displaystyle e$.

Edit: Ok ok I see what you are saying! What I have above is wrong. The number of orderings is $\displaystyle (n-1)!$. Give me a few minutes with this I think I got it! Many thanks. I guess what I couldn't fathom is that although $\displaystyle X_i$ are continuous, the distribution for $\displaystyle N$ obviously is not.


text:
Forum moved here!

# Home / How to set origin when measuring PDF coordinates

SayYo1983

I noticed the origin is set as the left upper corner, can I set the origin as left bottom corner

GitHubRulesOK

No, although a PDF input construction is defined in cartesian terms so raw page units are most frequently measured from Bottom Left (except when transformed), SumatraPDF as a multiformat renderer works consistently from screen rendered / image output page origin which is in most cases Upper Left.


text:
# Partial Differentiation -- y deleted or ignored?

Tags:
1. May 2, 2015

### Prof. 27

1. The problem statement, all variables and given/known data
Given: z = f(x,y) = x^2-y^2
To take the partial derivative of f with respect to x hold y constant then take the derivative of x.
∂f/∂x = 2x

What I don't understand is why such would equal 2x, when the y is still there it just isn't variable and is ignored. Wouldn't it be:

2x - y^2

where y is a constant squared?
In another example this kind of thing occurred:
z = f(x,y) = x^3*y
∂f/∂x = 3x^2*y

where y is a constant unknown.

So why the different pertaining to y in these two answers?

Thanks so much, Bertrand Russell
2. Relevant equations
None really.

3. The attempt at a solution
http://en.wikipedia.org/wiki/Partial_derivative
http://www.centerofmath.org/mc_pdf/sec2_1.pdf [Broken]

Last edited by a moderator: May 7, 2017
2. May 2, 2015

### cnh1995

We take the partial derivative of the entire function..So for f(x,y)=x2-y2, the derivative of x^2 is 2x but the derivative of y^2 w.r.t.x must be 0 since it is constant..Same goes for 3x^2*y..

Last edited by a moderator: May 7, 2017
3. May 2, 2015

### Prof. 27

Got it. Thanks so much.

4. May 2, 2015

### PeroK

First, in both cases y is treated as a constant. For example:

$\frac{d}{dx}(x^2 + a^2) = 2x$

And

$\frac{d}{dx}(x^3a) = 3xa$

On your main point: a partial derivative (wrt x) is the gradient of the curve you get when you hold y constant. You could think of taking y = 0, 1, 2... and see what curves you get. Whatever value of y you choose, you get a parabola $z = x^2 + n^2$ where $n$ is whatever value of y you are considering. This curve has the usual derivative and does not get steeper as y increases: it's the same shape for any value of y.

Whether y appears in the partial derivative depends on whether the value of y affects the derivative. For $z = x^2 + y^2$ it doesn't: the partial derivative is independent of y. But for $z = x^3y$ the partial derivative wrt x does depend on y.

It's exactly the same as whether a constant $a$ affects the ordinary derivative of a function of x.

Last edited by a moderator: May 7, 2017


text:
1. ## Combinatorial Math Problem

I've forgotten the methodology for deducing the number of ways to select N groups from M objects. For example, if I had 11 flags, how many ways would there be to put the 11 flags in 5 piles?

The real question I'm working on is:

"How many integer solutions are there to the equation x1 + x2 + x3 + x4 + x5 = 21, if xi >= 2 for i = 1, 2, 3, 4, 5."

I was going to try and think about it as having 5 groups of at least 2 (since each xi much be at least 2) and then distribute the remaining 11 groups of 1 between the 5 groups.

The number of non-negative integer solutions to $x_1 + x_2 + x_3 + x_4 + x_5 = 21$ is the standard ${{21+5-1} \choose {21}}$.
But if you want to restrict $x_i \ge 2$ the answer is ${{11+5-1} \choose {11}}$.
Note the change to 11. The mind trick here is to think of putting two ones into each variable.
That uses ten ones leaving eleven ones to distribute.

The first one is really ambiguous. Not sure about piles. Can you have an empty pile?
Are the piles distinguishable other that by number contained?

3. Originally Posted by Moo
To complete on that... If you want $x_i \ge 2$, substitute : $y_i=x_i-2 \quad (\implies x_i=y_i+2)$

Thus $y_i \ge 0$ and $21=x_1+x_2+x_3+x_4+x_5=y_1+y_2+y_3+y_4+y_5+5 \cdot 2 \implies y_1+y_2+y_3+y_4+y_5=11$

Hence the formula Plato gave =)

4. Originally Posted by Plato
The number of non-negative integer solutions to $x_1 + x_2 + x_3 + x_4 + x_5 = 21$ is the standard ${{21+5-1} \choose {21}}$.
But if you want to restrict $x_i \ge 2$ the answer is ${{11+5-1} \choose {11}}$.
Note the change to 11. The mind trick here is to think of putting two ones into each variable.
That uses ten ones leaving eleven ones to distribute.
So I'm trying to rationalize this here, and I'm having some difficulty.

In the first situation, I evaluate:

(21+5+1)! / 21!4! = 12650

This seems plausible, but it seems to me that:

4+4+8+2+3 = 21

is counted twice, once for the arrangement you see there and once for:

4+4+8+3+2 = 21

I tried dividing by 5!, but 12650 is not evenly divisible by 5!, which seemed odd to me at first.

But then I thought, because of the nature of what we're doing, taking a set of "a"s and putting "b"s in-place to separate groups, the two different "orderings" of the identical "4"s isn't double-counted, but "3" and "2" in reversed order is counted twice.

Help?

5. Originally Posted by InfinitePartsInHarmony
This seems plausible, but it seems to me that: 4+4+8+2+3 = 21
is counted twice, once for the arrangement you see there and once for:
4+4+8+3+2 = 21
Those two solutions are different if $x_4 \ne x_5$.
What is the exact wording of the question?


text:
Georgian Mathematical Journal ( IF 0.500 ) Pub Date : 2020-07-16 , DOI: 10.1515/gmj-2020-2068
Antonio J. Calderón Martín

Let $(ℌ,μ,α)$ be a regular Hom-algebra of arbitrary dimension and over an arbitrary base field $𝔽$. A basis $ℬ={ei}i∈I$ of $ℌ$ is called multiplicative if for any $i,j∈I$, we have that $μ(ei,ej)∈𝔽ek$ and $α(ei)∈𝔽ep$ for some $k,p∈I$. We show that if $ℌ$ admits a multiplicative basis, then it decomposes as the direct sum $ℌ=⊕rℑr$ of well-described ideals admitting each one a multiplicative basis. Also, the minimality of $ℌ$ is characterized in terms of the multiplicative basis and it is shown that, in case $ℬ$, in addition, it is a basis of division, then the above direct sum is composed by means of the family of its minimal ideals, each one admitting a multiplicative basis of division.

down
wechat
bug