text:
[[File:Circle radians.gif|thumb|right|300px|An arc of a circle with the same length as the radius of that circle subtends an angle of 1 radian.wikipedia
378 Related Articles

### Angle

acute angleobtuse angleoblique
The radian is the SI unit for measuring angles, and is the standard unit of angular measure used in many areas of mathematics. The length of an arc of a unit circle is numerically equal to the measurement in radians of the angle that it subtends; one radian is just under 57.3 degrees (expansion at ). Radian describes the plane angle subtended by a circular arc as the length of the arc divided by the radius of the arc. One radian is the angle subtended at the center of a circle by an arc that is equal in length to the radius of the circle.
The ratio of the length s of the arc by the radius r of the circle is the measure of the angle in radians.

### Degree (angle)

°degreesdegree
The length of an arc of a unit circle is numerically equal to the measurement in radians of the angle that it subtends; one radian is just under 57.3 degrees (expansion at ).
It is not an SI unit, as the SI unit of angular measure is the radian, but it is mentioned in the SI brochure as an accepted unit.

### International System of Units

SISI unitsSI unit
The radian is the SI unit for measuring angles, and is the standard unit of angular measure used in many areas of mathematics.

### SI derived unit

derived unitderived unitsJ/kg
The unit was formerly an SI supplementary unit, but this category was abolished in 1995 and the radian is now considered an SI derived unit.
The International System of Units assigns special names to 22 derived units, which includes two dimensionless derived units, the radian (rad) and the steradian (sr).

### Arc (geometry)

arccircular arcarcs
Radian describes the plane angle subtended by a circular arc as the length of the arc divided by the radius of the arc. One radian is the angle subtended at the center of a circle by an arc that is equal in length to the radius of the circle.
If the two points are not directly opposite each other, one of these arcs, the minor arc, will subtend an angle at the centre of the circle that is less than radians (180 degrees), and the other arc, the major arc, will subtend an angle greater than radians.

### Arc length

rectifiable curvearclengthlength
The relation can be derived using the formula for arc length.

### Trigonometric functions

cosinetrigonometric functiontangent
Most notably, results in analysis involving trigonometric functions are simple and elegant when the functions' arguments are expressed in radians.
In a right angled triangle, the sum of the two acute angles is a right angle, that is 90° or \frac \pi 2 radians.

### Polar coordinate system

polar coordinatespolarpolar coordinate
Although polar and spherical coordinates use radians to describe coordinates in two and three dimensions, the unit is derived from the radius coordinate, so the angle measure is still dimensionless.
Angles in polar notation are generally expressed in either degrees or radians (2[[pi|]] rad being equal to 360°).

### Euler's formula

complex exponentialcomplex exponentialsEuler's exponential formula
Mathematically important relationships between the sine and cosine functions and the exponential function (see, for example, Euler's formula) are, again, elegant when the functions' arguments are in radians and messy otherwise.
are the trigonometric functions cosine and sine respectively, with the argument x given in radians.

### Angular velocity

angular speedangular velocitiesOrders of magnitude (angular velocity)
For example, angular velocity is typically measured in radians per second (rad/s).
If angle is measured in radians, the linear velocity is the radius times the angular velocity, v = r\omega.

### Spherical coordinate system

spherical coordinatessphericalspherical polar coordinates
Although polar and spherical coordinates use radians to describe coordinates in two and three dimensions, the unit is derived from the radius coordinate, so the angle measure is still dimensionless.
The spherical coordinate systems used in mathematics normally use radians rather than degrees and measure the azimuthal angle counterclockwise from the x-axis to the y-axis rather than clockwise from north (0°) to east (+90°) like the horizontal coordinate system.

A milliradian, often called a mil or mrad, is an SI derived unit for angular measurement which is defined as a thousandth of a radian (0.001 radian).

For example, angular velocity is typically measured in radians per second (rad/s).
The radian per second is also the unit of angular frequency.

### Phase (waves)

phasephase shiftout of phase
Likewise, the phase difference of two waves can also be measured in radians.
If it is expressed in radians, the same increase in t will increase the phase by 2\pi.

### Dimensionless quantity

dimensionlessdimensionless numberdimensionless quantities
As the ratio of two lengths, the radian is a "pure number" that needs no unit symbol, and in mathematical writing the symbol "rad" is almost always omitted.
Other common proportions are percentages % (= 0.01), ‰ (= 0.001) and angle units such as radians, degrees (°= undefined⁄180) and grads(= undefined⁄200).

### Roger Cotes

Coates [''sicCotes, RogerR. Cotes
The concept of radian measure, as opposed to the degree of an angle, is normally credited to Roger Cotes in 1714.

### Minute and second of arc

masarcsecondarc second
More common is arc second, which is undefined⁄648,000 rad (around 4.8481 microradians).
A minute of arc is undefined⁄10,800 of a radian.

### Angular acceleration

Similarly, angular acceleration is often measured in radians per second per second (rad/s 2 ).
In SI units, it is measured in radians per second squared (rad/s), and is usually denoted by the Greek letter alpha .

### Taylor series

Taylor expansionMaclaurin seriesTaylor polynomial
The trigonometric functions also have simple and elegant series expansions when radians are used; for example, the following Taylor series for sin x :
All angles are expressed in radians.

### Turn (angle)

turnturnsrevolution
Radians can be converted to turns (complete revolutions) by dividing the number of radians by 2. 2\pi radians equals one turn, which is by definition 400 gradians (400 gons or 400 g ).
A turn is a unit of plane angle measurement equal to 2degrees or 400 gradians.

### Angular frequency

angular rateangular speedangular frequencies
One revolution is equal to 2π radians, hence

It is used in three-dimensional geometry, and is analogous to the radian, which quantifies planar angles.

### Metric prefix

SI prefixunit prefixprefix
Metric prefixes have limited use with radians, and none in mathematics.
The SI unit of angle is the radian, but degrees, minutes, seconds and more rarely tierces see some scientific use.


text:
# Define Focal Length of a Divergent Lens. - Science

Define focal length of a divergent lens.

#### Solution

The focal length of a diverging lens is half the value of its radius of curvature. Conventionally, the sign of the focal length of the diverging lens is taken as negative.

Concept: Images Formed by Sperical Lenses
Is there an error in this question or solution?

Share

format: plain


text:
• FEATURED

View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# ID3dX11Effect constant buffer

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

3 replies to this topic

### #1osiris11  Members

Posted 20 March 2012 - 04:31 AM

Hey.

I am investigating the use of constant buffers in effect files. Say, my effect file had buffer declarations like this:

cbuffer cbPerViewBuffer
{
matrix viewMatrix;
};

When initializing my shader, i would get a pointer to this effect variable by name, and store it in my object:

ID3DX11EffectMatrixVariable *p_view;
ID3DX11Effect* p_effect;

//... Compiling effect ...//

p_view = p_effect->GetVariableByName("viewMatrix")->AsMatrix();

On rendering, I do

D3DXMATRIX v;
//... doing the math on v ...//

p_view->SetMatrix( v);

There is no buffer mapping or else involved. So my question is, is this even using the advantages of constant buffers, or is this an absurdely abuse of mentioned features?
Should I instead create a custom buffer type, create a buffer of this type, bind it as dynamic to the effect, and use map on each render call?
Can the view buffer even be updated, I have seen no flag specifying it as DYNAMIC?

### #2Quat  Members

Posted 20 March 2012 - 09:59 AM

The effects framework does a Map or UpdateResource behind the scenes. It's been a while since I looked at the effect code, but it should flag a variable as "dirty" and only update the constant buffer if one of the values changed. So it is not really an abuse.

However, one example of an improvement is your "per-frame" constant buffer. You only need one of these and all your effects can share it. I use a header and always put the per-frame cb in slot 0. Then I use ID3DX11Effect::GetConstantBufferByName and set the per-frame CB for each effect; this is just a bind operation (when Apply() is called), as the per-frame CB is only updated once per-frame.

If you don't do this, then each effect will maintain its own per-frame cbuffer. This is still not likely to make a performance impact, but still.
-----Quat

### #3Asesh  Members

Posted 20 March 2012 - 06:28 PM

This is how it's done:

// Retrieve the handles to the constant buffers

//

m_pD3DXEffectEveryFrameConstBuffer = m_pD3DXEffect->GetConstantBufferByName("CBEveryFrame"); // Constant buffer that changes every frame

if(!m_pD3DXEffectEveryFrameConstBuffer->IsValid())

return E_FAIL;

update constant buffer:

D3D11_MAPPED_SUBRESOURCE oD3DMappedSubresource;

CHECK_COM(pD3DDeviceContext->Map(m_pD3DMaterialConstbuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &oD3DMappedSubresource)); // Get a pointer to the data in the constant buffer

::memcpy(oD3DMappedSubresource.pData, pMaterialConstantBuffer, sizeof(SMaterialConstantBuffer)); // Copy the constant buffers

pD3DDeviceContext->Unmap(m_pD3DMaterialConstbuffer, 0);

CHECK_COM(m_pD3DXEffectMaterialConstBuffer->SetConstantBuffer(m_pD3DMaterialConstbuffer)); // Set material constant buffer in the shader

Assuming the constant buffer was created dynamic usage flag. If it's created with default usage flag then you have to use UpdateSubresource method to do so

### #4osiris11  Members

Posted 21 March 2012 - 03:47 AM

@ Quat: Your answer sounds good: it's easy, would not require me to do too much changes, and would not need me to do obscure things.

@ Asesh: It's quite the opposite to what Quat suggested: You tell me to actually take everything in my own responsibility, and actually mapping the buffer. In this case, would I have to create the buffers myself? As I see it, the effect creates the declared buffers within it on compilation(?) and I can just access it with the GetConstantBufferFunction. Where can I make it's usage DYNAMIC? Do I have to create the buffer myself and replace it with the one the shader generated?

Actually, now I'm as wise as before: It seems to me I have two concurring opinions on this topic, and (of course I am tempted to use the easier one for the time being) still can't decide which option to settle with.
Are there any more opinions?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
Right triangle calculator (B,b)

Please enter two properties of the right triangle

Use symbols: a, b, c, A, B, h, T, p, r, R

You have entered cathetus b and angle β.

Right scalene triangle.

Sides: a = 1351.683287848   b = 1175   c = 1790.997737688

Area: T = 794113.691111
Perimeter: p = 4317.688025536
Semiperimeter: s = 2158.844012768

Angle ∠ A = α = 49° = 0.85552113335 rad
Angle ∠ B = β = 41° = 0.71655849933 rad
Angle ∠ C = γ = 90° = 1.57107963268 rad

Height: ha = 1175
Height: hb = 1351.683287848
Height: hc = 886.7843756762

Median: ma = 1355.502236112
Median: mb = 1473.839949397
Median: mc = 895.499868844

Vertex coordinates: A[1790.997737688; 0] B[0; 0] C[1020.128801782; 886.7843756762]
Centroid: CG[937.0421798232; 295.5954585587]
Coordinates of the circumscribed circle: U[895.499868844; -0]
Coordinates of the inscribed circle: I[983.8440127682; 367.8432750803]

Exterior (or external, outer) angles of the triangle:
∠ A' = α' = 131° = 0.85552113335 rad
∠ B' = β' = 139° = 0.71655849933 rad
∠ C' = γ' = 90° = 1.57107963268 rad

How did we calculate this triangle?

The calculation of the triangle progress in two phases. The first phase is such that we try to calculate all three sides of the triangle from the input parameters. The first phase is different for the different triangles query entered. The second phase is the calculation of other characteristics of the triangle, such as angles, area, perimeter, heights, the center of gravity, circle radii, etc. Some input data also results in two to three correct triangle solutions (e.g., if the specified triangle area and two sides - typically resulting in both acute and obtuse) triangle).

1. Input data entered: cathetus b and angle β

$b = 1175 \ \\ β = 41^\circ$

2. From angle β we calculate angle α:

$α + β + 90^\circ = 180^\circ \ \\ α = 90^\circ - β = 90^\circ - 41 ^\circ = 49 ^\circ$

3. From cathetus b and angle α we calculate hypotenuse c:

$\cos α = b:c \ \\ c = b/\cos α = 1175/\cos(49 ^\circ ) = 1790.997$

4. From hypotenuse c and angle α we calculate cathetus a:

$\sin α = a:c \ \\ a = c \cdot \ \sin α = 1790.997 \cdot \ \sin(49 ^\circ ) = 1351.683$

Now we know the lengths of all three sides of the triangle, and the triangle is uniquely determined. Next, we calculate another its characteristics - same procedure as calculation of the triangle from the known three sides SSS.

$a = 1351.68 \ \\ b = 1175 \ \\ c = 1791$

5. The triangle perimeter is the sum of the lengths of its three sides

$p = a+b+c = 1351.68+1175+1791 = 4317.68$

6. Semiperimeter of the triangle

The semiperimeter of the triangle is half its perimeter. The semiperimeter frequently appears in formulas for triangles that it is given a separate name. By the triangle inequality, the longest side length of a triangle is less than the semiperimeter.

$s = \dfrac{ p }{ 2 } = \dfrac{ 4317.68 }{ 2 } = 2158.84$

9. Calculation of the inner angles of the triangle - basic use of sine function

$\sin α = \dfrac{ a }{ c } \ \\ α = \arcsin(\dfrac{ a }{ c } ) = \arcsin(\dfrac{ 1351.68 }{ 1791 } ) = 49^\circ \ \\ \sin β = \dfrac{ b }{ c } \ \\ β = \arcsin(\dfrac{ b }{ c } ) = \arcsin(\dfrac{ 1175 }{ 1791 } ) = 41^\circ \ \\ γ = 90^\circ$

An incircle of a triangle is a circle which is tangent to each side. An incircle center is called incenter and has a radius named inradius. All triangles have an incenter, and it always lies inside the triangle. The incenter is the intersection of the three angle bisectors. The product of the inradius and semiperimeter (half the perimeter) of a triangle is its area.

The circumcircle of a triangle is a circle that passes through all of the triangle's vertices, and the circumradius of a triangle is the radius of the triangle's circumcircle. Circumcenter (center of circumcircle) is the point where the perpendicular bisectors of a triangle intersect.

$R = \dfrac{ c }{ 2 } = \dfrac{ 1791 }{ 2 } = 895.5$

12. Calculation of medians

A median of a triangle is a line segment joining a vertex to the midpoint of the opposite side. Every triangle has three medians, and they all intersect each other at the triangle's centroid. The centroid divides each median into parts in the ratio 2:1, with the centroid being twice as close to the midpoint of a side as it is to the opposite vertex. We use Apollonius's theorem to calculate the length of a median from the lengths of its side.

The right triangle calculators compute angles, sides (adjacent, opposite, hypotenuse) and area of any right-angled triangle and use it in the real world. Two independent properties entirely determine any right-angled triangle. The calculator provides a step-by-step explanation for each calculation.

A right triangle is a kind of triangle that has one angle that measures C=90°. In aRight triangle, the side c that is opposite of the C=90° angle, is the longest side of the triangle and is called the hypotenuse. The variables a, b are the lengths of the shorter sides, also called legs or arms. Variables for angles are A, B, or α (alpha) and β (beta). Variable h refers to the altitude(height) of the triangle, which is the length from the vertex C to the hypotenuse of the triangle.

Examples for right triangle calculation:


text:
Combinatorics Seminar 2015

Date: Wed, May 20, 2015

Time: 15:00 - 16:00

Venue: Middle Meeting Room

Title: On matrix $D$-stability and related properties

Abstract:

We study the positive stability and $D$-stability of $P$-matrices. We also consider the property of $D_{\theta}$-stability, i.e. when a matrix remains positive stable being multiplied by a positive diagonal matrix from a special class. This class is defined by a given permutation $\theta$. We apply the obtained results to some problems connected with structured matrices. Namely, we study $M$-matrices and their rank one perturbations. With the help of the obtained results we introduce new classes of $D$-stable matrices and provide the proof for the still open conjecture of Bierkens--Ran concerning rank one perturbations of singular $M$-matrices.

Slides: View slides

Webmaster


text:
# Thread: Reduction of grain by 80%.

1. ## Reduction of grain by 80%.

a farmer has some grain, which he would like to have sold, but unfortunately there is very much moisture in the grain. there are actually 90% moisture in the grain and you will probably not call it corn any more , but there is a man who would like to buyit but he would only buy when the moisture percentage is down at 80%
it is about 100 kg grain (with moisture) and the question is now how much weight grain (with moisture) when it is down to 80% moisture when the man will buy?

2. ## Re: Help!!!!

Ok, so the grain has two components: the 'solid stuff' and the moisture. Moisture disappears during the drying process, but the mass of the solid stuff remains the same. You start out with $(100\% - 90\%)\cdot 100 \mathrm{kg}=10\mathrm{kg}$ of solid stuff. After the drying process you still have 10 kg of solid stuff, but now it's $(100\% - 80\%)$ of the total mass. I'll leave it up to you do the last calculation step.


text:
# Difference between revisions of "Ceva's Theorem"

Ceva's Theorem is an algebraic statement regarding the lengths of cevians in a triangle.

## Statement

(awaiting image)
A necessary and sufficient condition for AD, BE, CF, where D, E, and F are points of the respective side lines BC, CA, AB of a triangle ABC, to be concurrent is that

$BD * CE * AF = +DC * EA * FB$

where all segments in the formula are directed segments.

## Example

Suppose AB, AC, and BC have lengths 13, 14, and 15. If $\frac{AF}{FB} = \frac{2}{5}$ and $\frac{CE}{EA} = \frac{5}{8}$. Find BD and DC.

If $BD = x$ and $DC = y$, then $10x = 40y$, and ${x + y = 15}$. From this, we find $x = 12$ and $y = 3$.


text:
# Hamilton, D.P. 1996. The Asymmetric Time-Variable Rings of Mars. Icarus 119, 153-172.

In this paper, we investigate the dynamics and steady-state behavior of the hypothetical circumplanetary dust rings associated with the two tiny satellites of Mars, Phobos and Deimos. These moonlets are subject to a flux of micrometeoroids which erodes their surfaces and ejects material into orbit around Mars. We study the detailed orbital dynamics of ejected material between a micrometer and a millimeter in radius and find that these grains are significantly perturbed by solar radiation pressure and Mars' oblateness. The coupling between these two forces forms rings that are vertically and azimuthally asymmetric as well as time-variable. Our analytic and numerical results show that material of all sizes launched from Deimos forms a ring that is displaced {\it away} from the Sun. Grains with radii smaller than $\sim$270\mic launched from Phobos, however, form a ring that is displaced {\it toward} the Sun. This effect, as well as surprisingly large orbital changes for Phobos grains, is due to a near resonance between Mars' orbital motion and the precession of pericenter due to the oblateness force. When viewed from along Mars' vernal equinox (the intersection between Mars' orbital and equatorial planes), the ring formed by Deimos grains smaller than $\sim$100\mic is tilted out of the equatorial plane. We present a new analytical solution describing this vertical asymmetry and interpret it in terms of the Laplace Plane. Finally, we suggest that the martian rings may be sustained through the ejecta produced by energetic collisions between ring particles in the 20-50\mic range and the small moonlets Phobos and Deimos.


text:
OpenKattis
Kattis Set 06

#### Start

2019-02-18 13:00 UTC

## Kattis Set 06

#### End

2019-03-04 09:29 UTC
The end is near!
Contest is over.
Not yet started.
Contest is starting in -267 days 23:28:22

332:29:59

0:00:00

# Problem IYet Satisfiability Again!

Picture from Wikimedia Commons
Alice recently started to work for a hardware design company and as a part of her job, she needs to identify defects in fabricated integrated circuits. An approach for identifying these defects boils down to solving a satisfiability instance. She needs your help to write a program to do this task.

## Input

The first line of input contains a single integer, not more than $5$, indicating the number of test cases to follow. The first line of each test case contains two integers $n$ and $m$ where $1 \le n \le 20$ indicates the number of variables and $1 \le m \le 100$ indicates the number of clauses. Then, $m$ lines follow corresponding to each clause. Each clause is a disjunction of literals in the form X$i$ or ~X$i$ for some $1 \le i \le n$, where ~X$i$ indicates the negation of the literal X$i$. The “or” operator is denoted by a ‘v’ character and is seperated from literals with a single space.

## Output

For each test case, display satisfiable on a single line if there is a satisfiable assignment; otherwise display unsatisfiable.

Sample Input 1 Sample Output 1
2
3 3
X1 v X2
~X1
~X2 v X3
3 5
X1 v X2 v X3
X1 v ~X2
X2 v ~X3
X3 v ~X1
~X1 v ~X2 v ~X3

satisfiable
unsatisfiable


text:
A mixture Gaussian model with censoring data

In my example, suppose that there are some observations
y_1,y_2,\dots,y_n \sim \pi N(\mu_1,\sigma_1)+(1-\pi)N(\mu_2,\sigma_2).

However, in the real experiment, we observe some $y_i$s with right censoring at y=K.

Now I get the data y_i with its censoring indicator I_i and want to estimate parameters \mu and \sigma. Obviously, it is a mixture Normal problem with censoring data.

For a certain y_i and the censoring indicator I_i, which I_i=1 means right censoring,

y_i \sim \pi ~f(y_i|\mu_1,\sigma_1)^{1-I_i}(1-F(y_i|\mu_1,\sigma_1))^{I_i}+(1-\pi)~f(y_i|\mu_2,\sigma_2)^{1-I_i}(1-F(y_2|\mu_1,\sigma_2))^{I_i}.

So, according to the density function above, here is my stan code:

User-defined functions
Here is some user-defined functions, which mean that
{fun}_1=f(y_i|\mu_1,\sigma_1)^{1-I_i}(1-F(y_i|\mu_1,\sigma_1)),
{fun}_2=f(y_i|\mu_2,\sigma_2)^{1-I_i}(1-F(y_i|\mu_2,\sigma_2)),
and
fun1\_lpdf=\log(fun_1),fun2\_lpdf=\log(fun_2).
This 3 formulas define the p.d.f of two mixture right-censoring normal distributions.

functions {
real fun1_log(real y,real ind ,real mu1,vector sigma){
return (1-ind)*normal_lpdf(y|mu1,sigma[1])+ind*log(1-normal_cdf(y,mu1,sigma[1]));

}
real fun2_log(real y,real ind ,real mu2,vector sigma){
return (1-ind)*normal_lpdf(y|mu2,sigma[2])+ind*log(1-normal_cdf(y,mu2,sigma[2]));
}
}

Parameters and Data

parameters {
real  mu1;
real  mu2;
vector<lower=0>[2] sigma;
real<lower=0, upper=1> p;
}
data {
int<lower = 0> N;
vector[N] y;
vector[N] index;
}

Model

model {
mu1~normal(50,2);
mu2~normal(120,4);
sigma[1] ~ inv_gamma(0.01, 0.01);
sigma[2] ~ inv_gamma(0.01, 0.01);
p ~ beta(1, 1);
for (n in 1:N)
target += log_mix(p,
fun1_log(y[n] ,index[n]| mu1, sigma[1]),
fun2_log(y[n], index[n]| mu2, sigma[2]));
}

But when I compile the stan code, some ERROR appear:

PARSER EXPECTED: whitespace to end of file.
FOUND AT line 18:

Error in stanc(file = file, model_code = model_code, model_name = model_name,  :
failed to parse Stan model '95bdbfeb015fa8187a5778b30cd86959' due to the above error.

This model compiles. I didn’t try to check the math – just wiggled things around so they’d compile:

functions {
real fun1_log(real y,real ind ,real mu1,real sigma){
return (1-ind)*normal_lpdf(y|mu1,sigma)+ind*log(1-normal_cdf(y,mu1,sigma));

}
real fun2_log(real y,real ind ,real mu2,real sigma){
return (1-ind)*normal_lpdf(y|mu2,sigma)+ind*log(1-normal_cdf(y,mu2,sigma));
}
}

data {
int<lower = 0> N;
vector[N] y;
vector[N] index;
}

parameters {
real  mu1;
real  mu2;
vector<lower=0>[2] sigma;
real<lower=0, upper=1> p;
}

model {
mu1~normal(50,2);
mu2~normal(120,4);
sigma[1] ~ inv_gamma(0.01, 0.01);
sigma[2] ~ inv_gamma(0.01, 0.01);
p ~ beta(1, 1);
for (n in 1:N)
target += log_mix(p,
fun1_log(y[n] ,index[n], mu1, sigma[1]),
fun2_log(y[n], index[n], mu2, sigma[2]));
}

The error you were getting was because the data block should be defined before parameters. That error message wasn’t very helpful so thanks for reporting. I’ll make a Github issue about this.

Also, I got rid of the vertical bars in the fun1_log calls. I’m not 100% sure the syntax rules on those, but the way you’re using those functions is just like normal functions so they’re not needed.

I also make the last argument to both functions a real instead of a vector (since they’re only being passed one sigma), and then updated the sigma references in the function calls as well.

Functions with _log suffix do not use vertical bars, that syntax is a quirk of _lpdf functions. Also the bars are kind of stupid because they always assume your distribution is univariate. You’d have to put the bar after the first argument even if you’re trying to define the joint density of two variables.

You don’t need to wrap your densities in functions. You can just write the expression inside log_mix. Also I think it’s clearer if you use explicit control flow instead of that multiply-by-zero trick.

for (n in 1:N) {
if (index[n] == 0) {
target += log_mix(p, normal_lpdf(y[n]|mu1, sigma[1]),
normal_lpdf(y[n]|mu2, sigma[2]));
} else {
target += log_mix(p, normal_lccdf(y[n]|mu1, sigma[1]),
normal_lccdf(y[n]|mu2, sigma[2]));
}
}

By the way, those inverse gamma priors for sigma are pretty bad, you should consider something weakly informative instead.

2 Likes

Thanks for your answer. And It seems that you DID give a better improvement.
However, a new problem about initial value is put forward, which i also saw before:

Chain 1: Rejecting initial value:
Chain 1:   Log probability evaluates to log(0), i.e. negative infinity.
Chain 1:   Stan can't start sampling from this initial value.
Chain 1: Initialization between (-2, 2) failed after 100 attempts.
Chain 1:  Try specifying initial values, reducing ranges of constrained values, or reparameterizing the model.
[1] "Error in sampler\$call_sampler(args_list[[i]]) : Initialization failed."
error occurred during calling the sampler; sampling not done

Since I am a fresher about stan, i know little about debugging. How can I solve it? Thanks again!

Right, Stan always starts by computing the log likelihood of a guess where all parameters have values near zero. Your priors for mu are about 25 standard deviations away from that. It should work anyway but those cumulative probability functions have a bug that makes them fail when the guess is too far off.
You can use the initargument when calling Stan to start at a different guess but if you’re have the newest Stan you should just set the parameter offsets to their expected value.

parameters {
real<offset=50>  mu1;
real<offset=120>  mu2;
...
}

1 Like

Yes, just after replying you, i noticed that init argument does have a influence for the computation the log likelihood. So i change init argument with different values. So of them are available, while most of them are useless which result in log(0) . As a result，I think a proper init value in important!

Besides, I write code with R environment and the corresponding stan is rstan. I will try to add offset=x to parameters chunks.


text:
# I remember Remember The Milk

(written by lawrence krubner, however indented passages are often quotes). You can contact lawrence at: lawrence@krubner.com

I liked I Remember The Milk. We used it a lot from 2007 to 2009. It’s interface was simpler than Basecamp, but slightly more than Tada lists, so it fit a niche perfectly for me. But I no longer use it. The only todo software that would work for me is software that has total integration with my email, yet all such solutions tend to be heavyweight. So I’m still waiting for something good to show up. Perhaps it now exists? I have not checked in several years, which I suppose says a lot about how non-urgent this issue is.

Source


text:
Speed Distance Time Formula

Speed is the rate at which an object moves. It’s a very basic concept in motion and all about how fast or slow an object can move. Speed is simply Distance divided by time where Distance is directly proportional to Velocity when time is constant. Problems related to Speed, Distance, and Time, will ask you to calculate for one of three variables given.

Formula for Speed Distance Time is mathematically given as:

Speed = Distance/Time

Where

x = Speed in m/s,

d = Distance traveled in m,

t= time taken in s.

Distance traveled formula

$d=xt$

If any of the two values among speed, distance and time are given, we can use this formula and find the unknown quantity.

### SOLVED EXAMPLES

Question 1: Lilly is driving a scooty with the speed of 6 km/hr for 2hr. Calculate the distance traveled by her?

Solution:

Given:

Speed of the scooty x = 6km/hr

Time taken t = 2 hr

Distance traveled d = ?

Speed distance time formula is given as

d=xt

Distance traveled d = x × t

= 6 km/hr × 2 hr

= 12 km.

Question 2: A man has covered a distance of 80 miles in 4 hours. Calculate the speed of the bike?

Solution:

Given : Distance Covered d = 80 miles,

Time taken t = 4 hours

Speed is calculated using the formula: x = d/t

= 80/4

= 20 miles/hr.

Question 3: In a cycle race, a cyclist is moving with the speed of 2 km/hr. He has to cover a distance of 5 km. Calculate the time will he need to reach his destiny?

Solution:

Given: Speed x = 2 km/hr,

Distance Covered d = 5 km,

time taken t = ?

Speed is given by formula: x = d x t

Time taken t = x/d

= 2/5

= 0.4 hr

= 1440 s / 24 minutes

Time taken by the Cyclist = 0.4 hr


text:
# Presuming Too Little About Resulting and Constructive Trusts?

14 Sep 2017

It will be an all too obvious truth to readers of this journal that the law on implied trusts as it applies to the acquisition and quantification of interests in real property has undergone a period of considerable change and uncertainty over the last decade, and many questions and confusions remain. One principle had, however, seemed to emerge relatively clearly from the dicta in $\textit{Stack v Dowden}$,$^1$ $\textit{Laskar v Laskar}^2$ and $\textit{Jones v Kernott}^3$ : the starting presumptions identified by Lady Hale in $\textit{Stack}$ applied to domestic cases, broadly stated, but the presumption of a resulting trust was more appropriate where the purchase was for commercial purposes. If this approach was ever correct, it is no longer the case following the decision of the Judicial Committee of the Privy Council in $\textit{Marr v Collie}$.


text:
Rating changes for the last round are temporarily rolled back. They will be returned soon. ×
Codeforces celebrates 10 years! We are pleased to announce the crowdfunding-campaign. Congratulate us by the link https://codeforces.com/10years. ×

F. New Year and Finding Roots
time limit per test
2 seconds
memory limit per test
256 megabytes
input
standard input
output
standard output

This is an interactive problem. In the interaction section below you will find the information about flushing the output.

The New Year tree of height h is a perfect binary tree with vertices numbered 1 through 2h - 1 in some order. In this problem we assume that h is at least 2. The drawing below shows one example New Year tree of height 3:

Polar bears love decorating the New Year tree and Limak is no exception. To decorate the tree, he must first find its root, i.e. a vertex with exactly two neighbours (assuming that h ≥ 2). It won't be easy because Limak is a little bear and he doesn't even see the whole tree. Can you help him?

There are t testcases. In each testcase, you should first read h from the input. Then you can ask at most 16 questions of format "? x" (without quotes), where x is an integer between 1 and 2h - 1, inclusive. As a reply you will get the list of neighbours of vertex x (more details in the "Interaction" section below). For example, for a tree on the drawing above after asking "? 1" you would get a response with 3 neighbours: 4, 5 and 7. Your goal is to find the index of the root y and print it in the format "! y". You will be able to read h for a next testcase only after printing the answer in a previous testcase and flushing the output.

Each tree is fixed from the beginning and it doesn't change during your questions.

Input

The first line of the input contains a single integer t (1 ≤ t ≤ 500) — the number of testcases.

At the beginning of each testcase you should read from the input a single integer h (2 ≤ h ≤ 7) — the height of the tree. You can't read the value of h in a next testcase until you answer a previous testcase.

Interaction

To ask a question about neighbours of vertex x, print "? x" (without quotes) on a separate line. Note, you must print an end-of-line character after the last character of the line and flush your output to get a response.

The response will consist of two lines. The first line will contain a single integer k (1 ≤ k ≤ 3) — the number of neighbours of vertex x. The second line will contain k distinct integers t1, ..., tk (1 ≤ t1 < ... < tk ≤ 2h - 1) — indices of neighbours of vertex x, gives in the increasing order.

After asking at most 16 questions you have to say y — the index of the root. Print "! y" (without quotes) and an end-of-line character, and flush the output.

Each tree is fixed from the beginning and it doesn't change during your questions.

You can get Idleness Limit Exceeded if you don't print anything or if you forget to flush the output.

To flush you can use (just printing a query/answer and end-of-line):

• fflush(stdout) in C++;
• System.out.flush() in Java;
• stdout.flush() in Python;
• flush(output) in Pascal;
• See the documentation for other languages.

In any moment if the program reads h = 0 or k = 0 it should immediately terminate normally (for example, calling exit(0)). It means that the system detected incorrect request/output from your program and printed 0 because if can't process your requests anymore. In this case you'll receive verdict "Wrong Answer", but if you ignore case h = 0 or k = 0 it could lead to "Runtime Error", "Time/Memory limit exceeded" or any other verdict because your program could read a trash from the closed input stream.

Hacking. To hack someone, use the following format:

The first line should contain a single integer t equal to 1 (only one testcase is allowed in hacks). The second line should contain a single integer h. Each of next 2h - 2 lines should contain two distinct integers ai and bi (1 ≤ ai, bi ≤ 2h - 1), denoting two nodes connected with an edge. The printed edges must form a perfect binary tree of height h.

Of course, contestant programs will not be able to see this input.

Examples
Input
1334 5 721 212
Output
? 1? 5? 6! 5
Input
221321 221 2433 12 13
Output
? 1? 3? 3! 3? 6! 1
Note

In the first sample, a tree corresponds to the drawing from the statement.

In the second sample, there are two two testcases. A tree in the first testcase has height 2 and thus 3 vertices. A tree in the second testcase has height 4 and thus 15 vertices. You can see both trees on the drawing below.


text:
bug-lilypond
[Top][All Lists]

## Issue 1960 in lilypond: User-inserted stretchable vertical space

 From: lilypond Subject: Issue 1960 in lilypond: User-inserted stretchable vertical space Date: Sun, 09 Oct 2011 03:04:11 +0000

```Status: Accepted
Owner: ----
Labels: Type-Enhancement

```
New issue 1960 by address@hidden: User-inserted stretchable vertical space
```http://code.google.com/p/lilypond/issues/detail?id=1960

```
When placing several pieces in a book, we like each page to be flush-bottom, except when a piece ends before a page break.
```
```
One current solution is to begin with all the \scores, the pieces, in one \bookpart and let LilyPond choose page breaks. Then whenever we would prefer a piece to start on a new page, we close the previous \bookpart and start a new one, with a bookTitleMarkup="" to avoid re-printing the overall title of the set of pieces.
```
We could do this more simply if we could \vfill\pageBreak

```


text:
# Need help verifying my proof for inequality (I feel it's wrong)

I posted this yesterday $4x^{4} + 4y^{3} + 5x^{2} + y + 1\geq 12xy$ for all positive $x,y$ and I think I got a solution , Here it goes ,

this is the problem , if $x$ and $y$ are real positive numbers , I need to prove

$$4x^4 + 4y^3 + 5x^2 + y + 1 \ge 12xy$$

but $x^2 + y^2 \ge 2xy$, so $6x^2 + 6y^2 \ge 12xy$, from this if

$4x^4 + 4y^3 + 5x^2 + y + 1 \ge 6x^2 + 6y^2$ then the given inequality holds

let's try this $4x^4 + 4y^3 \ge 6x^2 + 6y^2$

$4x^4 + 4y^3 / (6x^2 + 6y^2) \ge 1$

$4x^4 + 4y^3 /(6x^2 + 6y^2) - 1 \ge 0$

$4x^4 + 4y^3 - 6x^2 - 6y^2 /(6x^2 + 6y^2) \ge 0$ , divide both sides by the numerator

$1/(6x^2 + 6y^2) \ge 0$

since this is true the inequality $4x^4 + 4y^3 \ge 6x^2 + 6y^2$ holds , so from this we can say that

$4x^4 + 4y^3 + 5x^2 + y + 1 \ge 4x^4 + 4y^3$

$5x^2 + y +1 \ge 0$

, this is obviously true and thus the above inequality holds but something tells me thing is wrong , I believe I proved this to be the case for all natural numbers but I intended to prove this equality for all positive real numbers .

Do tell me where i've messed up

Thanks

The inequality $4x^4 + 4y^3 \ge 6x^2 + 6y^2$ is wrong already for $x=y=1$. So when you divide both sides by the numerator, you don’t obtain neither $1/(6x^2 + 6y^2) \ge 0$ nor anything tree.


text:
Valuations

Let $K$ be a field with a valuation $\mathrm{val}$. Show that if $a,b \in K$ with $\mathrm{val}(a) \ne \mathrm{val}(b)$ then $\mathrm{val}(a+b) = \min(\mathrm{val}(a),\mathrm{val}(b))$.

Suppose $a,b \in K$ are such that $\mathrm{val}(a) \ne \mathrm{val}(b)$. Without loss of generality, one may assume that $\mathrm{val}(a) > \mathrm{val}(b)$. For purposes of contradiction, assume that $\mathrm{val}(a+b) > \min(\mathrm{val}(a),\mathrm{val}(b))=\mathrm{val}(b)$, so $\mathrm{val}(a+b)=\mathrm{val}(b)$. Now, $\mathrm{val}(b)=\mathrm{val}(a+b-a)> \min(\mathrm{val}(a+b),\mathrm{val}(-a))=\min(\mathrm{val}(a+b),\mathrm{val}(a))$. There are two possibilities. First, suppose the minimum is $\mathrm{val}(a)$. This is a contradiction, for one then has $\mathrm{val}(b)>\mathrm{val}(a)$, but the reverse was true. Thus, one must have $\mathrm{val}(b) \geq \mathrm{val}(a+b)$. However, this contradicts the assumption that $\mathrm{val}(a+b) > \min(\mathrm{val}(a),\mathrm{val}(b))=\mathrm{val}(b)$. Thus, it must be the case that $\mathrm{val}(a+b) = \min(\mathrm{val}(a),\mathrm{val}(b))$, as desired.


text:
# Relativistic system (mathematics)

Jump to: navigation, search

In mathematics, a non-autonomous system of ordinary differential equations is defined to be a dynamic equation on a smooth fiber bundle ${\displaystyle Q\to \mathbb {R} }$ over ${\displaystyle \mathbb {R} }$. For instance, this is the case of non-relativistic non-autonomous mechanics, but not relativistic mechanics. To describe relativistic mechanics, one should consider a system of ordinary differential equations on a smooth manifold ${\displaystyle Q}$ whose fibration over ${\displaystyle \mathbb {R} }$ is not fixed. Such a system admits transformations of a coordinate ${\displaystyle t}$ on ${\displaystyle \mathbb {R} }$ depending on other coordinates on ${\displaystyle Q}$. Therefore, it is called the relativistic system. In particular, Special Relativity on the Minkowski space ${\displaystyle Q=\mathbb {R} ^{4}}$ is of this type.

Since a configuration space ${\displaystyle Q}$ of a relativistic system has no preferable fibration over ${\displaystyle \mathbb {R} }$, a velocity space of relativistic system is a first order jet manifold ${\displaystyle J_{1}^{1}Q}$ of one-dimensional submanifolds of ${\displaystyle Q}$. The notion of jets of submanifolds generalizes that of jets of sections of fiber bundles which are utilized in covariant classical field theory and non-autonomous mechanics. A first order jet bundle ${\displaystyle J_{1}^{1}Q\to Q}$ is projective and, following the terminology of Special Relativity, one can think of its fibers as being spaces of the absolute velocities of a relativistic system. Given coordinates ${\displaystyle (q^{0},q^{i})}$ on ${\displaystyle Q}$, a first order jet manifold ${\displaystyle J_{1}^{1}Q}$ is provided with the adapted coordinates ${\displaystyle (q^{0},q^{i},q_{0}^{i})}$ possessing transition functions

${\displaystyle q'^{0}=q'^{0}(q^{0},q^{k}),\quad q'^{i}=q'^{i}(q^{0},q^{k}),\quad {q'}_{0}^{i}=\left({\frac {\partial q'^{i}}{\partial q^{j}}}q_{0}^{j}+{\frac {\partial q'^{i}}{\partial q^{0}}}\right)\left({\frac {\partial q'^{0}}{\partial q^{j}}}q_{0}^{j}+{\frac {\partial q'^{0}}{\partial q^{0}}}\right)^{-1}.}$

The relativistic velocities of a relativistic system are represented by elements of a fibre bundle ${\displaystyle \mathbb {R} \times TQ}$, coordinated by ${\displaystyle (\tau ,q^{\lambda },a_{\tau }^{\lambda })}$, where ${\displaystyle TQ}$ is the tangent bundle of ${\displaystyle Q}$. Then a generic equation of motion of a relativistic system in terms of relativistic velocities reads

${\displaystyle \left({\frac {\partial _{\lambda }G_{\mu \alpha _{2}\ldots \alpha _{2N}}}{2N}}-\partial _{\mu }G_{\lambda \alpha _{2}\ldots \alpha _{2N}}\right)q_{\tau }^{\mu }q_{\tau }^{\alpha _{2}}\cdots q_{\tau }^{\alpha _{2N}}-(2N-1)G_{\lambda \mu \alpha _{3}\ldots \alpha _{2N}}q_{\tau \tau }^{\mu }q_{\tau }^{\alpha _{3}}\cdots q_{\tau }^{\alpha _{2N}}+F_{\lambda \mu }q_{\tau }^{\mu }=0,}$
${\displaystyle G_{\alpha _{1}\ldots \alpha _{2N}}q_{\tau }^{\alpha _{1}}\cdots q_{\tau }^{\alpha _{2N}}=1.}$

For instance, if ${\displaystyle Q}$ is the Minkowski space with a Minkowski metric ${\displaystyle G_{\mu \nu }}$, this is an equation of a relativistic charge in the presence of an electromagnetic field.

## References

• Krasil'shchik, I. S., Vinogradov, A. M., [et al.], "Symmetries and conservation laws for differential equations of mathematical physics", Amer. Math. Soc., Providence, RI, 1999, ISBN 0-8218-0958-X.
• Giachetta, G., Mangiarotti, L., Sardanashvily, G., Geometric Formulation of Classical and Quantum Mechanics (World Scientific, 2010) ISBN 981-4313-72-6 (arXiv: 1005.1212).


text:
# Direct correlation function

• enrikofermi
enrikofermi
Hi all.
I'm learning something about critical phenomena and I have one problem.

I'm bad with Fourier transforms so I don't know how from 7.37 we have 7.38.
I have tryed everything I knew, but fruitless. I have attached picture of my problem.

Does anybody has any idea how I can solve this?

#### Attachments

• IMG988.jpg
67.1 KB · Views: 418

Multiply 7.37 with the denominator of the RHS and then Fourier transform using that a product in Fourier space becomes a convolution in direct space (and vice versa), i.e. the integral on the RHS of eq. 7.38.

https://en.wikipedia.org/wiki/Convolution_theorem

enrikofermi
Thanks!
Is the Fourier transform of C (with hat) just C without hat, taking into account deffinition of C?
What make me confused are the arguments of functions in 7.38. Why r-r', and so on...?

enrikofermi
Anybody? To help with this manybody? :)

That C and ##\hat{C}## are Fourier transforms of each other is clearly stated in the article.
r1-r2 is as valid a variable as e.g. x or y. In a homogeneous system, translation invariant quantities cannot depend on both r1 and r2 but via their difference r1-r2. I suppose this has been discussed in your text previously

enrikofermi
Yes, I know, it was discussed earlier. But that what confused me was arguments of those functions under integral. Why are they different? And why they differ from those arguments of function outside of integral?

I think you first have to convince yourself that the integral represents a convolution.

enrikofermi
I have used convolution theorem, but I didn't get exactly same solution as author. Look how I calculated that. Arguments of my functions are considerably different. And that is what confuses me...

#### Attachments

• IMG1000.jpg
25.7 KB · Views: 413


text:
## Making Emacs Buffer Names Unique Using the Uniquify Package

If you ever work in Emacs with different files that all have the same name, this tip may be very useful for you. In my experience, this most often happens when working with Makefiles from multiple projects or directories. Assuming you have a buffer visiting a file called Makefile, by default Emacs will call the second buffer Makefile<2>. This is not very useful for figuring out which one is which.

### The uniquify package

Enter the uniquify package. It offers several options for making buffer names unique. In my .emacs, I have the following two lines of code.

(require 'uniquify)
(setq uniquify-buffer-name-style 'forward)

You can set the value to any of the following options, nil being the default. These examples are taken from the help file within Emacs. They use the information from the directories the files are located in to make the names unique. The first buffer called “name” is visiting a file in the directory bar/mumble/, and the second buffer is visiting a file called “name” in directory quux/mumble.

value first buffer called “name” second buffer called “name”
forward bar/mumble/name quux/mumble/name
reverse name\mumble\bar name\mumble\quux
post-forward name|bar/mumble name|quux/mumble
post-forward-angle-brackets name<bar/mumble> name<quux/mumble>
nil name name<2>


text:
## Precalculus (6th Edition) Blitzer

Published by Pearson

# Chapter 10 - Review Exercises - Page 1126: 79

#### Answer

The number of ways four actors can be selected is 4845 ways

#### Work Step by Step

We know that the order in which the four actors are selected does not make a difference as the designation for all the four actors would be the same. The ordered arrangement in which the order of the arrangement does not make a difference is solved using the concepts of combinations. The four actors are to be selected from a group of twenty actors. So, $n=20,r=4$. Hence, \begin{align} & _{20}{{C}_{4}}=\frac{20!}{4!\left( 20-4 \right)!} \\ & =\frac{20!}{4!16!} \\ & =\frac{20\times 19\times 18\times 17\times 16!}{24\times 16!} \\ & =4845 \end{align}

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
<meta http-equiv="refresh" content="1; url=/nojavascript/">
You are reading an older version of this FlexBook® textbook: CK-12 Middle School Math Concepts - Grade 8 Go to the latest version.

# 6.9: Identifying Polygons

Difficulty Level: At Grade Created by: CK-12
%
Progress
Practice Polygon Classification
Progress
%

Have you ever heard of a geodesic dome? Take a look at this dilemma.

“I am going to design a house that no one has ever even thought of before,” Dylan said during Mrs. Patterson’s class on Tuesday.

“What do you mean?” Kelsey inquired.

“A dome made of triangles. How’s that for an idea!” Dylan said grinning from ear to ear.

“It’s great,” Kelsey agreed, “But it already exists. It is called a “geodesic dome”.”

Dylan looked at Kelsey as she pulled open a book and showed Dylan the exact page where there was information written on the geodesic dome. He shrugged his shoulders.

“Well, I am going to do it anyway,” he said.

Dylan began to explore the geodesic dome. He figured out that the average dome has isosceles triangles in it. These triangles, like all triangles, have a sum of $180^\circ$ for angle measures. Dylan wants to construct a geodesic dome.

As he begins to draw his design, he figures out that he will need a variety of hexagons and pentagons. Dylan is stuck. He can’t figure out how many degrees there will be in each hexagon and how many degrees there will be in each pentagon.

This is where you come in. Pay attention to this Concept on polygons. By the end of it, you will be able to help Dylan with his geodesic dome.

### Guidance

Polygons are two-dimensional figures that have three or more sides. Any figure with straight edges, such as a triangle or rectangle, is a polygon. If a figure has any curved sides or is open, it is not a polygon.

This is a figure that is not a polygon.

Polygons have special properties that determine their angle and side relationships. For instance, the number of sides a polygon has is related to the number of angles it has, and therefore determines the sum of its angles.

Now that we can distinguish polygons from other figures, let’s take a closer look at them. In general, there are two kinds of polygons: regular polygons and irregular polygons.

Regular polygons have sides and angles that are all congruent. It doesn’t matter how many sides and angles they have. As long as the sides are congruent and the angles are congruent, the figure is a regular polygon.

Irregular polygons , you may have guessed, are polygons that do not have congruent sides and angles. They are still polygons because they have straight, closed sides. Their sides are simply different lengths.

Here are two hexagons. The first one is a regular hexagon. You can see that the side lengths and the angle measures are all congruent. The second figure is still a hexagon, but it is an irregular hexagon. While it has six sides, it has different side lengths and angle measures.

While we can have different triangles and different quadrilaterals, we can also have different types of polygons besides regular and irregular. We can further identify polygons according to the number of sides that they have. The hexagon (6 sides) is an example of one of these types of polygons. Other examples include: triangles, pentagons, octagons and decagons. Let’s look at the different types of polygons in more detail.

We can distinguish between different types of polygons according to the number of sides that each has. This is how we can name the polygon. We can also look at different characteristics of each type of polygon. We can look at the number of sides, the number of diagonals that can be drawn in a figure, the number of triangles in the polygon and the sum of the angle measures.

The easiest way to approach this is through the use of a table. Let’s begin with naming polygons, looking at images of polygons, examining the number of angles and sides and the sum of the interior (inside) angles.

Polygon Name Polygon Number of Angles and Sides Sum of Interior Angles
triangle 3 $180^\circ$
rectangle/square 4 $360^\circ$
pentagon 5 $540^\circ$
hexagon 6 $720^\circ$
heptagon 7 $900^\circ$
octagon 8 $1,080^\circ$
nonagon 9 $1,260^\circ$
decagon 10 $1,440^\circ$

You can see that polygons have similar names. In the word polygon, poly -means “many” and- gon means “angle.” So polygon means “having many angles.” Now look at the name for the shape that has eight angles and sides. It is called an octagon . In octagon , oct -means “eight.” An octopus, for example, has eight arms. In pentagon , pent -means “five,” so this is a shape with five angles and sides.

One thing to notice about these polygons is that they can all be divided by diagonals. We can figure out how many diagonals there are and by doing this divide them up into triangles. We know that the sum of the angle measures of a triangle is $180^\circ$ , and we can use this information to figure out the sum of the angle measures of the different polygons.

Take a look at this situation.

Notice that this hexagon has been divided using diagonals. There are three diagonals in the hexagon which create four triangles. Each of these triangles has $180^\circ$ in it, so we can multiply $180 \times 4$ to find the sum of the degrees inside a hexagon.

$180 \times 4 = 720^\circ$

This is the answer and you can see how this corresponds to the number of degrees in the chart.

We can apply this information to any of the polygons. Simply divide the polygon into triangles and multiply the number of triangles by 180.

We can also use a formula to find the sum of a polygon’s interior angles. Knowing the total is helpful because we often can use it to find the measure of a particular angle in the polygon. Remember, in a regular polygon, all of the angles are congruent. We can find the angle of all of them if we know the total and how many angles there are.

As we have seen, we can find the total number of degrees in a polygon by using triangles. The formula sums this up nicely and gives us a shortcut:

$(n - 2) \times 180^\circ$

The letter $n$ represents the number of angles (or sides) in the polygon. In other words, we subtract 2 from the number of angles and then multiply by 180. Think about the different polygons, the number of triangles in a polygon is always 2 less than the number of sides. The formula is simply giving us a shortcut to find the number of triangles in the polygon. Then, as we know, we multiply by $180^\circ$ .

Find the sum of the angles a hexagon.

First, count the number of angles or sides. This polygon has six sides and six angles. We will put 6 in for $n$ in the formula and solve.

$(n - 2) &\times 180^\circ\\(6 - 2) &\times 180^\circ\\4 \times 180^\circ &= 720^\circ$

The formula tells us that a hexagon contains 4 triangles. When we multiply by $180^\circ$ , we find that the sum of the interior angles in a hexagon is $720^\circ$ . This is true for any hexagon, regular or irregular.

Write this formula down in your notebook.

Figure out the sum of the angle measures in each polygon.

#### Example A

Nonagon

Solution:  $1260^\circ$

#### Example B

Heptagon

Solution:  $900^\circ$

#### Example C

Pentagon

Solution:  $540^\circ$

Now let's go back to the dilemma from the beginning of the Concept.

Now let’s break down the solution to the problem. Let’s start with hexagons.

We know that there are six triangles in a hexagon. We know that the sum of the angle measures of a triangle is $180^\circ$ . However, we have to take the number of sides into consideration. We can use the following formula to help us. The letter $n$ represents the number of sides.

$(n - 2) &\times 180\\(6 - 2) &\times 180 = 720^\circ$

Now let’s look at the pentagon. The pentagon is comprised of 5 triangles. We know that the sum of the angle measures of each triangle is $180^\circ$ . We can use the same formula as we did with the hexagon.

$(n - 2) &\times 180\\(5 - 2) &\times 180 = 540^\circ$

### Vocabulary

Polygon
a simple closed figure made up of line segments.
Regular Polygon
a polygon with all sides congruent and all angles congruent.
Irregular Polygon
a polygon where all sides are not congruent, but all angle measures are congruent.

### Guided Practice

Here is one for you to try on your own.

What is the measure of each angle in a regular octagon?

Solution

If it is a regular octagon, all of the angles are congruent. We need to find the total number of degrees in an octagon and then divide by 8, because an octagon has 8 angles. Let’s use the formula to find the total of the angles.

$&(n - 2) \times 180^\circ\\&(8 - 2) \times 180^\circ\\&6 \times 180^\circ\\&1,080^\circ$

The 8 angles in an octagon must have a sum of $1,080^\circ$ . Check your table to be sure. Now that we know the total, we divide by 8 to find the measure of each angle.

$1,080^\circ \div 8 = 135^\circ$

Each angle in a regular octagon, no matter how big or small, always measures $135^\circ$ .

### Practice

Directions: Answer true or false to each question about regular and irregular polygons.

1. The angles of a regular polygon are all the same size.
2. A regular hexagon has six sides that are different lengths.
3. An irregular pentagon has sides that are the same length.
4. An irregular polygon is one that has one side open.
5. A regular triangle could also be called an equilateral triangle.
6. The side lengths of a regular octagon are all the same length.

Directions: Identify each figure as regular or irregular. Then identify the type of polygon that it is too.

1. An eight sided figure with sides of equal length.

Directions: Use the formula $(n - 2) \times 180$ to figure out the sum of the angle measures of each polygon.

1. Regular hexagon
2. Regular octagon
3. Triangle
4. Trapezoid
5. Decagon

### Vocabulary Language: English

Concave

Concave

A concave polygon has at least one interior angle greater than 180 degrees. A common way to identify a concave polygon is to look for a "caved-in" side of the polygon.
Convex

Convex

A convex polygon contains no interior angles greater than 180 degrees.
Diagonal

Diagonal

A diagonal is a line segment in a polygon that connects nonconsecutive vertices
Exterior angles

Exterior angles

An exterior angle is the angle formed by one side of a polygon and the extension of the adjacent side.
Interior angles

Interior angles

Interior angles are the angles inside a figure.
Irregular Polygon

Irregular Polygon

An irregular polygon is a polygon with non-congruent side lengths.
Polygon

Polygon

A polygon is a simple closed figure with at least three straight sides.
Regular Polygon

Regular Polygon

A regular polygon is a polygon with all sides the same length and all angles the same measure.
Vertices

Vertices

Vertices are points where line segments intersect.
Equilateral

Equilateral

A polygon is equilateral if all of its sides are the same length.

Jan 23, 2013

Feb 26, 2015


text:
# Flipping cards

Discrete Mathematics Level pending

You're given a deck of $$99$$ cards.

To perform one perfect shuffle, you divide the deck into three parts: the top $$33$$ cards, middle $$33$$ cards, and the bottom $$33$$ cards. Call these $${ P }_{ 1 }$$, $${ P }_{ 2 }$$, and $${ P }_{ 3 }$$ respectively.

To finish the perfect shuffle, you choose a card from the top of $${ P }_{ 3 }$$ and make it the first card in a new pile. Then, take a card from the top of $${ P }_{ 2 }$$ and place it on top of the new pile, and so on. (This goes in a cycle, so once you get to $${ P }_{ 1 }$$ you go back to $${ P }_{ 3 }$$)

How many perfect shuffles does it take to get back to the starting arrangement of cards?

×


text:
# D/dx of ln(|x|)

I know d/dx of ln(x) is 1/x , x>0.
A website says d/dx of ln(|x|) is also 1/x for x not = 0 .
is that true , i am unable to prove it!

arildno
Homework Helper
Gold Member
Dearly Missed
Use the chain rule of differentiation.

Hi vikcool812 :
Note that ln(|x|)=ln(x) when x>0 and
=ln(-x) when x<0
So d/dx (ln(|x|))=d/dx(ln(x)) when x>0 and
d/dx (ln(|x|))=d/dx(ln(-x)) when x<0 therefore
d/dx(ln(x)) =1/x when x>0 by definition of ln(x) and
d/dx(ln(-x))=-1/-x = 1/x when x<0 by chain rule so in both cases we have
d/dx (ln(|x|))=1/x for not x=0
Best Regards

BEWARE... The formula
$$\frac{d}{dx}\ln(|x|) = \frac{1}{x}$$
is wrong for complex $x$

Remember that when dealing with absolute values, with either derivatives or limits, it is best to directly use the definition of the absolute value. I.e.,
$$|x| = \begin{cases} x &, x\geq 0 \\ -x &, x\leq 0 \end{cases}$$
This is of course what rzaidan used in his solution.

Thank You ! Everyone for your valuable suggestions .

Hi g_edgar
THankyou for your hint , and my work was in the real numbers.
Best Regards


text:
# A triangle has sides A, B, and C. The angle between sides A and B is (pi)/3 and the angle between sides B and C is pi/6. If side B has a length of 13, what is the area of the triangle?

Dec 26, 2016

${A}_{\triangle} = \frac{169 \sqrt{3}}{8} \approx 36.59$.

#### Explanation:

Our goal will be to use ${A}_{\triangle} = \frac{1}{2} a b \sin C$. We know $b = 13$ and $\angle C = \frac{\pi}{3}$, so we need to find $a$.

Step 1: Find the value of $\angle B$.

Using the fact that the sum of all 3 angles in a triangle is $\pi$, we get

$\angle A + \angle B + \angle C = \pi$
$\frac{\pi}{6} \text{ "+ angle B + pi / 3" } = \pi$
$\text{ "angle B " } = \frac{\pi}{2}$

So $\angle B = \frac{\pi}{2}$.

Step 2: Find the length of $a$.

We now use the sine law for triangles to get

$\frac{a}{\sin} A = \frac{b}{\sin} B$

$\frac{a}{\sin} \left(\frac{\pi}{6}\right) = \frac{13}{\sin} \left(\frac{\pi}{2}\right)$

$\text{ "a" } = \frac{13 \sin \left(\frac{\pi}{6}\right)}{\sin} \left(\frac{\pi}{2}\right)$

$\text{ "a" } = \frac{13 \left(\frac{1}{2}\right)}{1} = \frac{13}{2}$

So $a = \frac{13}{2}$.

Step 3: Find the area of the triangle.

We can now use the following formula for a triangle's area:

${A}_{\triangle} = \frac{1}{2} a b \sin C$

${A}_{\triangle} = \frac{1}{2} \cdot \frac{13}{2} \cdot 13 \cdot \sin \left(\frac{\pi}{3}\right)$

${A}_{\triangle} = \frac{169}{4} \cdot \frac{\sqrt{3}}{2}$

${A}_{\triangle} = \frac{169 \sqrt{3}}{8} \text{ } \approx 36.59$.


text:
# Taylor Series Extpansion of $\tanh x$

I know how to find the Taylor expansion of both $\sinh x$ and $\cosh x$, but how would you find the Taylor expansion of $\tanh x$. It seems you can't just divide both the Taylor series of $\sinh x$ and $\cosh x$ so how would you do it?

Any suggestions? I saw it contains the Bernoulli series, what is that exactly?

Kind Regards

• You could do using long division. Otherwise, as usual. – Claude Leibovici Dec 5 '14 at 11:46

You may too use the method I used here for the expansion of $\tan$ :

Integrate repetitively $\ \tanh'(x)=1-\tanh(x)^2\$ starting with $\,\tanh(x)\approx x$ :

\begin{align} \tanh(x)&\small{=}\ x+O\bigl(x^2\bigr)\\ &\small{=\int 1-\left(x+O\bigl(x^2\bigr)\right)^2\,dx}=x-\frac {x^3}3+O\bigl(x^4\bigr)\\ &\small{=\int 1-\left(x-\frac {x^3}3+O\bigl(x^4\bigr)\right)^2dx=\int 1-x^2+\frac {2x^4}3\,dx-O\bigl(x^6\bigr)}=x-\frac {x^3}3+\frac {2x^5}{15}-O\bigl(x^6\bigr)\\ &= \cdots\\ \end{align}

Every integration gives another coefficient of $\ \displaystyle\tanh(x)=\sum_{n\ge 0} a_n\ (-1)^n\,x^{2n+1}\$ and we get simply : $$a_0=1,\; a_{n+1}=\frac 1{2n+3} \sum_{k=0}^n a_k\ a_{n-k},\ \text{for}\;n>0$$ i.e. the sequence (with alternating signs for $\tanh$) : $$(a_n)_{n\in\mathbb{N}}=\left(\frac 11,\frac 13, \frac 2{15}, \frac {17}{315}, \frac {62}{2835}, \frac{1382}{155925},\cdots\right)$$

We may probably deduce the recurrence relation of Bernoulli numbers in function of this one (or vice et versa) but I didn't try that yet.

• What does $O$ stand for? – TheLast Cipher Oct 24 '18 at 9:12
• @TheLastCipher: See "Big O notation". For example $\;f(x)=O\left(x^2\right)\;$ means that there exist $M$ and $x_0$ in $\mathbb{R}$ such that $\;|f(x)| \le \; M x^2\;$ for $x\ge x_0$ (it is not really important here and this answer would probably be clearer without it!). – Raymond Manzoni Oct 24 '18 at 21:37

An easy way to compute the coefficients of the Taylor series of $\tanh$ is to consider that: $$\cosh(z)=\prod_{n=0}^{+\infty}\left(1+\frac{4z^2}{(2n+1)^2 \pi^2}\right)$$ hence: $$\log\cosh z = \sum_{n=0}^{+\infty}\log\left(1+\frac{4z^2}{(2n+1)^2 \pi^2}\right)$$ and by differentiating: $$\tanh z = 2z\sum_{n=0}^{+\infty}\frac{\frac{4}{(2n+1)^2 \pi^2}}{1+\frac{4z^2}{(2n+1)^2 \pi^2}}$$ so: $$[z^{2k+1}]\tanh z = 2\frac{(-1)^k}{\pi^{2k+2}}\sum_{n=0}^{+\infty}\frac{1}{(n+1/2)^{2k+2}}=2\frac{(-2)^k}{\pi^{2k+2}}\sum_{n=0}^{+\infty}\frac{1}{(2n+1)^{2k+2}}$$ giving:

$$[z^{2k+1}]\tanh z = 2\frac{(-1)^k}{\pi^{2k+2}}\left(1-\frac{1}{4^{k+1}}\right)\zeta(2k+2).$$

• (+1) Nice solution but I cannot follow each step as it seems some parts are summarized. Where the first identity come from? Also, what does the bracket $[]$ mean here (4th equation)? and also how the function $\zeta$ appeared? – H. R. Jun 26 '17 at 9:38
• @H.R.: the first identity is Weierstrass product, $[z^k]\,f(z)$ stands for the coefficient of $z^k$ in the Laurent series of $f(z)$ around the origin and $\zeta$ comes from $\sum_{n\geq 0}\frac{1}{(2n+1)^{2k+2}}$. – Jack D'Aurizio Jun 26 '17 at 10:08
• I think that would be nice to mention these in the answer. :) Would you please take look at this post which indeed lead me here. – H. R. Jun 26 '17 at 10:28
• You are an excellent mathematician, but by reworking the calculations here, I saw that you omitted many passages. – Mathsource Aug 5 '18 at 20:08

\begin{eqnarray} \tanh x &=& x - \frac {x^3} {3} + \frac {2x^5} {15} - \frac {17x^7} {315} + \cdots = \sum_{n=1}^\infty \frac{2^{2n}(2^{2n}-1)B_{2n} x^{2n-1}}{(2n)!}, \left |x \right | < \frac {\pi} {2} \\ \end{eqnarray} Where $B_{m}$ is the $m$-th Bernoulli number defined as $$B_m(n) = \sum_{k=0}^m\sum_{v=0}^k(-1)^v\binom kv\frac{\left( n+v\right) ^m}{k+1}$$

• Yes but where does the Bernoulli number come from, why is it here? – user2250537 Dec 5 '14 at 11:58
• See next comment – Autolatry Dec 5 '14 at 12:01
• (+1) Can you explain the derivation of the formula? :) – H. R. Jun 26 '17 at 9:41

I don't know of a universal theory of all places where Bernoulli numbers arise, but Euler-Maclaurin summation explains many of their more down-to-earth occurrences.

The heuristic explanation (due to Lagrange) is as follows. The first difference operator defined by $\Delta f(n) = f(n+1)-f(n)$ and summation are inverses, in the same sense in which differentiation and integration are inverses. This just amounts to a telescoping series: $\sum_{a \le i < b} \Delta f(i) = f(b) - f(a)$.

Now by Taylor's theorem, $f(n+1) = \sum_{k \ge 0} f^{(k)}(n)/k!$ (under suitable hypotheses, of course). If we let $D$ denote the differentation operator defined by $Df = f'$, and $S$ denote the shift operator defined by $Sf(n) = f(n+1)$, then Taylor's theorem tells us that $S = e^D$. Thus, because $\Delta = S-1$, we have $\Delta = e^D - 1$.

Now summing amounts to inverting $\Delta$, or equivalently applying $(e^D-1)^{-1}$. If we expand this in terms of powers of $D$, the coefficients are Bernoulli numbers (divided by factorials). Because of the singularity at "$D=0$", the initial term involves antidifferentiation $D^{-1}$, i.e., integration. Thus, we have expanded a sum as an integral plus correction terms involving higher derivatives, with Bernoulli number coefficients.

Specifically, $$\sum_{a \le i < b} f(i) = \int_a^b f(x) \, dx + \sum_{k \ge 1} \frac{B_k}{k!} (f^{(k-1)}(b) - f^{(k-1)}(a)).$$ (Subtracting the values at $b$ and $a$ just amounts to the analogue of turning an indefinite integral into a definite integral.)

• Hi I am a high school student in 12th grade, I probably should have mentioned this, is there anyway you could simplify your explanation, for example I am unsure what a difference operator is, do you mind explaining? – user2250537 Dec 5 '14 at 12:08


text:
I’m just putting this here so I can copy paste it the next time that I need it. It’s a little ditty that better organizes our Processed output folders. Navigate to the top directory of all the individual subject folders and run from there!

for file in *
do
cd $file mkdir -p Scripts for output in *.out *.m do mv$output --target-directory=Scripts
done
cd ..
done

Suggested Citation:
Sochat, Vanessa. "Creating Script Directory and Moving Files...." @vsoch (blog), 19 Jul 2010, https://vsoch.github.io/2010/creating-script-directory-and-moving-files/ (accessed 20 Mar 23).


text:
# Is the word "Marines" no longer a proper noun?

###### Question:

Is the word "Marines" no longer a proper noun?

#### Similar Solved Questions

##### Question 4. Take the curve y cosh r in the r-y plane, and revolve it around the z axis. The resul...
Question 4. Take the curve y cosh r in the r-y plane, and revolve it around the z axis. The resulting surface of revolution S is called a catenoid. Show that it is a smooth surface in two different ways, as follows. (1) Give an atlas of regular surface patches for S. Describe S as the level set of a...
##### Is the diagonal matrix must be square which means no.of rows=no.of column.
is the diagonal matrix must be square which means no.of rows=no.of column....
##### In which ways do the basic principles of architecture, such as those applied when building a...
In which ways do the basic principles of architecture, such as those applied when building a house, apply to HIS architectures and planning?...
##### The velocity of Block C is Vc = 5m/s constant with the direction shown in the figure Q1, determine the angular velocity...
The velocity of Block C is Vc = 5m/s constant with the direction shown in the figure Q1, determine the angular velocity and angular acceleration of the link AB and link BC of the instant shown vc 6 m/s 300 450 800 cm 60이 500 cm Figure Q1 the velocity of block C is vc 5 m/s constant with the d...
##### QUESTION 8 If only a few countries abate their carbon emissions, what will that mean for...
QUESTION 8 If only a few countries abate their carbon emissions, what will that mean for abatement costs The Marginal Abatement Cost should be lower O The Marginal Abatement Cost should be steeper The damage function will increase The damage function will decrease...
Project 1: CVP Income Statement (10 points) Instructions: Prepare your solutions in Excel, and upload your Excel file to Moodle by the deadline specified by your instructor. Do NOT email your file! The following information pertains to Fun in the Sun, Inc., a jet ski manufacturer: $Budgeted product... 1 answer ##### Using gordon growth model explain how covid 19 impact stock market negatively using gordon growth model explain how covid 19 impact stock market negatively... 1 answer ##### Question 8 of 18 ) or the reaction KCIO, KCI + 20 assign oxidation numbers to... Question 8 of 18 ) or the reaction KCIO, KCI + 20 assign oxidation numbers to each element on each side of the equation. K in KCIO K in KCI: Clin KCIO Cl in KCI: O in KCIO, O in 0, on I r ole 1oHkt N Assignment Score: 5.6% Resources Hint Check Answer Question 8 of 18 > Cl in KCIO, Cl in KCI: Oin ... 1 answer ##### Exercise 2.8: Constants A bird is flying due east lts distance from a tall building is... Exercise 2.8: Constants A bird is flying due east lts distance from a tall building is given by z(t) -30.0m + (12.0m/s)t (0.0390m/s) Part A What is the instantaneous velocity of the bird when t -8.00 s? Express your answer with the appropriate units. v Value... 1 answer ##### The mass of a particular eagle is twice that of a hunted pigeon. Suppose the pigeon... The mass of a particular eagle is twice that of a hunted pigeon. Suppose the pigeon is flying north at 0.2 = 18.1 m/s when the eagle swoops down, grabs the pigeon, and flies off. At the instant right before the attack, the eagle is flying toward the pigeon at an angle 0 = 62.7° below the horizon... 1 answer ##### Which of the following is supported by XML but not JSON? (a) Schema (b) Native binary... Which of the following is supported by XML but not JSON? (a) Schema (b) Native binary formats (c) Arrays (d) Numbers... 1 answer ##### Part A A 12 cm -diameter cylinder contains argon gas at 10 atm pressure and a... Part A A 12 cm -diameter cylinder contains argon gas at 10 atm pressure and a temperature of 50°C. A piston can slide in and out of the cylinder. The cylinder's initial length is 21 cm. 2700 J of heat are transferred to the gas, causing the gas to expand at constant pressure. What is the fin... 1 answer ##### QUESTION 7 Shares of a closed-end fund are trading at a 6% premium to its$10...
QUESTION 7 Shares of a closed-end fund are trading at a 6% premium to its $10 net asset value. The current market price of the fund's shares are closest to: a.$9.40. b. $10.06. c.$10.60. d. \$16.00. QUESTION 8 Pacific Fund invests exclusively in Treasury bills ...


text:
Blog Entries: 5

## Brain Teaser #78

Arrange the numbers 1 through 10 in the shape of a pyramid (1 number at the peak, 2 numbers in the next row down, 3 in the next row, and 4 in the bottom row). The numbers must be arranged such that each number is equal to the difference of the two numbers directly below it. For example, if 5 and 1 are next to each other in the same row, then 4 must be placed on top of them.
 PhysOrg.com science news on PhysOrg.com >> King Richard III found in 'untidy lozenge-shaped grave'>> Google Drive sports new view and scan enhancements>> Researcher admits mistakes in stem cell study
 Blog Entries: 4 3 7 4 2 9 5 8 10 1 6 It represents a pyramid, though I'm unable to give to it a pyramidal shape
 Recognitions: Homework Help Science Advisor It looks good, but if you're reall picky you can use the code tag for fixed spacing Code:  3 7 4 2 9 5 8 A 1 6 I wonder if the solution is unique. Apparently not: Code:  3 2 5 7 9 4 8 1 A 6

Recognitions:
Gold Member
Staff Emeritus

## Brain Teaser #78

There are eight solutions:

{3, 2, 5, 7, 9, 4, 8, 1, 10, 6},
{3, 4, 7, 5, 9, 2, 6, 1, 10, 8},
{3, 5, 2, 4, 9, 7, 6, 10, 1, 8},
{3, 7, 4, 2, 9, 5, 8, 10, 1, 6},
{4, 1, 5, 6, 7, 2, 9, 3, 10, 8},
{4, 2, 6, 5, 7, 1, 8, 3, 10, 9},
{4, 5, 1, 2, 7, 6, 8, 10, 3, 9},
{4, 6, 2, 1, 7, 5, 9, 10, 3, 8}

- Warren
 For 1 level, there are 4 solutions: 2 / 1 3 2 / 3 1 1 / 2 3 1 / 3 2 3 always appears on the bottom. For 2 levels, there are 6 solutions: 2 / 3 5 / 4 1 6 2 / 5 3 / 6 1 4 1 / 3 4 / 5 2 6 1 / 4 3 / 6 2 5 3 / 4 1 / 2 6 5 3 / 1 4 / 5 6 2 6 always appears on the bottom. 5 and 4 appear on the bottom two levels, with only one of these at the highest. I trust there are no more than 8 solutions for 3 levels: 3 / 4 7 / 5 9 2 / 6 1 A 8 3 / 7 4 / 2 9 5 / 8 A 1 6 3 / 2 5 / 7 9 4 / 8 1 A 6 3 / 5 2 / 4 9 7 / 6 A 1 8 4 / 2 6 / 5 7 1 / 8 3 A 9 4 / 6 2 / 1 7 5 / 9 A 3 8 4 / 1 5 / 6 7 2 / 9 3 A 8 4 / 5 1 / 2 7 6 / 8 A 3 9 10 always appears on the bottom. 8 and 9 appear on the bottom two levels. (In fact 8 is always on the bottom.) 5, 6, and 7 appear on the bottom three levels, with only one of these at the highest. What a great way to waste time...
 Admin Blog Entries: 5 meteor with the point, good work chroot and davilla!


text:
# When is a Markov chain a Markov chain?

I’ve been taking tutorials on the third quarter of the second-year probability course, in which the student have met discrete-time Markov chains for the first time. The hardest aspect of this introduction (apart from the rapid pace – they cover only slightly less material than I did in Cambridge, but in half the time) is, in my opinion, choosing which definition of the Markov property is most appropriate to use in a given setting.

We have the wordy “conditional on the present, the future is independent of the past”, which is probably too vague for any precise application. Then you can ask more formally that the transition probabilities are the same under two types of conditioning, that is conditioning on the whole history, and conditioning on just the current value

$\mathbb{P}(X_{n+1}=i_{n+1} \,\big|\, X_n=i_n,\ldots,X_0=i_0) = \mathbb{P}(X_{n+1}=i_{n+1} \,\big |\, X_n=i_n),$ (*)

and furthermore this must hold for all sets of values $(i_{n+1},\ldots,i_0)$ and if we want time-homogeneity (as is usually assumed at least implicitly when we use the word ‘chain’), then these expressions should be functions of $(i_n,i_{n+1})$ but not n.

Alternatively, one can define everything in terms of the probability of seeing a given path:

$\mathbb{P}(X_0=i_0,\ldots,X_n=i_n)= \lambda_{i_0}p_{i_0,i_1}\ldots p_{i_{n-1}i_n},$

where $\lambda$ is the initial distribution, and the $p_{i,j}$s are the entries of the transition matrix P.

Fortunately, these latter two definitions are equivalent, but it can be hard to know how to proceed when you’re asked to show that a given process is a Markov chain. I think this is partly because this is one of the rare examples of a concept that students meet, then immediately find it hard to think of any examples of similar processes which are not Markov chains. The only similar concept I can think of are vector spaces, which share this property mainly because almost everything in first-year mathematics is linear in some regard.

Non-examples of Markov chains

Anyway, during the tutorials I was asking for some suggestions of discrete-time processes on a countable or finite state space which are not Markov chains. Here are some things we came up with:

• Consider a bag with a finite collection of marbles of various colours. Record the colours of marbles sampled repeatedly without replacement. Then the colour of the next marble depends on the set you’ve already seen, not on the current colour. And of course, the process terminates.
• Non-backtracking random walk. Suppose you are on a graph where every vertex has degree at least 2, and in a step you move to an adjacent vertex, chosen uniformly among the neighbours, apart from the one from which you arrived.
• In a more applied setting, it’s reasonable to assume that if we wanted to know the chance it will rain tomorrow, this will be informed by the weather over the past week (say) rather than just today.

Showing a process is a Markov chain

We often find Markov chains embedded in other processes, for example a sequence of IID random variables $X_1,X_2,\ldots$. Let’s consider the random walk $S_n=\sum_{i=1}^n X_i$, where each $X_i =\pm 1$ with probability p and (1-p). Define the running maximum $M_n=\max_{m\le n}S_m$, and then we are interested in $Y_n:=M_n-S_n$, which we claim is a Markov chain, and we will use this as an example for our recipe to show this in general.

We want to show (*) for the process $Y_n$. We start with the LHS of (*)

$\mathbb{P}(Y_{n+1}=i_{n+1} \,\big|\, Y_n=i_n,\ldots,Y_0=i_0),$

and then we rewrite $Y_{n+1}$ as much as possible in terms of previous and current values of Y, and quantities which might be independent of previous values of Y. At this point it’s helpful to split into the cases $i_n=0$ and $i_n\ne 0$. We’ll treat the latter for now. Then

$Y_{n+1}=Y_n+X_{n+1},$

so we rewrite as

$=\mathbb{P}(X_{n+1}=i_{n+1}-i_n \, \big |\, Y_n=i_n,\ldots, Y_0=i_0),$

noting that we substitute $i_n$ for $Y_n$ since that’s in the conditioning. But this is now ideal, since $X_{n+1}$ is actually independent of everything in the conditioning. So we could get rid of all the conditioning. But we don’t really want to do that, because we want to have conditioning on $Y_n$ left. So let’s get rid of everything except that:

$=\mathbb{P}(X_{n+1}=i_{n+1}-i_n\, \big |\, Y_n=i_n).$

Now we can exactly reverse all of the other steps to get back to

$= \mathbb{P}(Y_{n+1}=i_{n+1} \,\big|\, Y_n=i_n),$

which is exactly what we required.

The key idea is that we stuck to the definition in terms of Y, and held all the conditioning in terms of Y, since that what actually determines the Markov property for Y, rearranging the event until it’s in terms of one of the underlying Xs, at which point it’s easy to use independence.

Showing a process is not a Markov chain

Let’s show that $M_n$ is not a Markov chain. The classic mistake to make here is to talk about possible paths the random walk S could take, which is obviously relevant, but won’t give us a clear reason why M is not Markov. What we should instead do is suggest two paths taken by M, which have the same ‘current’ value, but induce transition probabilities, because they place different restrictions on the possible paths taken by S.

In both diagrams, the red line indicates a possible path taken by $(M_0,M_1,\ldots,M_4)$, and the blue lines show possible paths of S which could induce these.

In the left diagram, clearly there’s only one such path that S could take, and so we know immediately what happens next. Either $X_5=+1$ (with probability p) in which case $M_5=S_5=3$, otherwise it’s -1, in which case $M_5=2$.

In the right diagram, there are two possibilities. In the case that $S_4=0$, clearly there’s no chance of the maximum increasing. So in the absence of other information, for $M_5=3$, we must have $X_4=X_5=+1$, and so the chance of this is $p^2$.

So although the same transitions are possible, they have different probabilities with different information about the history, and so the Markov property does not hold here.