text:
# Counting some special derangements

A derangement of a list of $n$ distinct entries is a permutation of that list such that no corresponding entries match. It is well-known that the number of such derangements is the nearest integer to $n!/e$ where $e$ is the base of natural logarithms.

Let's say that a permutation of a list is a $\mu$-derangement if both it and its reverse ordering are derangements. Equivalently, iff the permutation is a derangement both of the original list and of the reverse of the original list.

How many $\mu$-derangements of the list $[1,2,..,n]$ are there? Is there an exact formula? A good approximation or bound?

There are no $\mu$-derangements for $n \lt 4$, except in the trivial case of an empty list. I got counts for $n \le 10$ below by enumerating possibilities with a bit of Prolog code:

 n | # of µ-derangements
---+----------------------
4 |           4
5 |          16
6 |          80
7 |         672
8 |        4752
9 |       48768
10 |      440192

The OEIS has this sequence as A003471, with a recurrence relation that suggests some separation into even and odd terms might simplify things.

-
I think you mean $n!/e$- is it really the nearest integer to that? I know that the probability that a permutation is a derangement is close to $1/e.$ –  Geoff Robinson Dec 27 '11 at 11:21
@GeoffRobinson: Just so, Geoff. Fixed! –  hardmath Dec 27 '11 at 11:26
Empirically, both sets of values seem to be asymptotic to $n!/e^2$. The dominant error term appears to be $1/n$ for even values of $n$ and $1/(2n^2)$ for odd values. Probably an asymptotic expansion is possible based on the recurrence relation? –  mjqxxxx Dec 27 '11 at 13:02
Note that the very rough approximation $(1- \frac{2}{n})^n$ gives the right answer asymptotically for the probability that a permutation is this kind of derangement, even though it (unjustifiably) treats the choices as independent. The heuristic argument is that for a given permutation $\sigma,$ there are two values of $\sigma(i)$ which are not permissible. –  Geoff Robinson Dec 27 '11 at 14:58
I proposed an edit to the OEIS sequence adding the integral formula. –  joriki Dec 27 '11 at 15:19

For $n=2k$, this is equivalent to What's the General Expression For Probability of a Failed Gift Exchange Draw, with a slot and its reverse partner forming a couple – the answer for this case is

$$\int_0^\infty\left(x^2-4x+2\right)^k\mathrm e^{-x}\mathrm dx\;,$$

and I derived in the answer to the other question that this goes as $n!/\mathrm e^2$ for large $n$.

For $n=2k+1$, there's a single slot without a partner which leads to a factor $-L_1(x)=x-1$, so the answer for this case is

$$\int_0^\infty\left(x^2-4x+2\right)^k(x-1)\mathrm e^{-x}\mathrm dx\;.$$

The asymptotic analysis remains essentially unchanged, so this also goes as $n!/\mathrm e^2$ for large $n$.

-
Danke shön, joriki! The application that motivated me here was for an $n = 2k$ even term case, trying to optimize the search strategy there. Your answer nicely sheds light on why the even and odd term cases differ by a little. Since $\int_0^\infty x^k e^{-x} dx = k!$, one can in principle expand your integral formula into a summation involving factorials. –  hardmath Dec 27 '11 at 19:26
@hardmath: It does seem so; expand the polynomial power with the multinomial formula, and then replace the integrals with factorials... if there was a recurrence relation for these, I wouldn't be surprised. –  Guess who it is. Dec 28 '11 at 2:45


text:
ConTeXt - Unwanted empty page with doublesided document

When I use `alternative=doublesided` in `\setuppagenumbering` I get an extra white page if my document has an odd number of pages. How can I get rid of it?

Following I post a minimal example to get the extra page:

``````\setuppagenumbering[alternative=doublesided]

\starttext

test

\stoptext
``````

Add `page=no`.

``````\setuppagenumbering[alternative=doublesided,page=no]
\starttext
test
\stoptext
``````

How did you find that out?

It's not documented (at least not in any obvious place) so what I did was search the code

``````grep -r --include=*.mkiv setuppagenumbering "\$(kpsexpand '\$TEXMFCONTEXT')/tex/context"
``````

The result `strc-pag.mkiv` looked most promising, so I opened the file. There the macro `\strc_pagenumbers_flush_final_page` looks very much like flushing an empty page if the parameter `page` is set to `no`. So I tried adding the parameter `page=no` and it worked.

• There's also `\installpagebreakhandler{last}{}` – user31316 Jul 16 '18 at 19:09

format: plain


text:
# Reflection of different metals

by sophieyeomans
Tags: metals, reflection
 P: 1 1. The problem statement, all variables and given/known data Having done an experiment measuring the intensity of light reflected from copper, lead, zinc and iron, i found that copper reflected the most light, then iron, then zinc, then lead. Now i have to explain it and I dont really know how to ! 3. The attempt at a solution I was thinking perhaps something to do with the fact that each of the metal atoms has different structures, and so different allowed quantum energies with which to absorb and emit light, so thats why they are all different? But then I'm measuring light intensity, and doesn't intensity relate to the number of photons emitted, not the energy of each photon?? I'm really confused! And what about the fact that they are not single atoms, but a lattice, with freely moving electrons? Please help me !
 P: 215 Look at the different metals. Is the light being scattered from their surfaces different colors? What does this say about the frequencies of scattering? Quantum states? Now look at the standard dispersion equation which is: $$n = 1+\frac {q_e^2}{2m \epsilon }\sum_k \frac {N_k} {\omega_k^2 - \omega^2 + i\gama_k \omega}$$ Now the what happens when the $$\omega_k$$ of the metal approaches the $$\omega$$ of the source light? Under what conditions does the absorption peaks? how about scattering peaks? What affect does the $$i\gama_k \omega}$$ electron damping factor have on the above questions? Why do you think that when the surface oxidizes (which sends the $$\omega_k$$ all over the place) do we get a dull surface? Also think about interference. How does that affect the scattering? Why do we get a lot of scattering at certain angles and not at others?

 Related Discussions Biology 17 Chemistry 3 Materials & Chemical Engineering 5 General Physics 1 Introductory Physics Homework 2


text:
# Photons from stars--how do they fill in such large angular distances?

It would seem that far-away stars are at such a distance that I should be able to take a step to the side and not have the star's photons hit my eye. How do stars release so many photons to fill in such great angular distances?

-
I think there are two questions here: 1) Why are stars visible even though they are so far away? and 2) Why do stars appears to subtend such a large solid angle even though they are so far away? – NowIGetToLearnWhatAHeadIs Nov 26 '13 at 16:45
By this logic, you wouldn't need to step to the side. You could just stand there and they'd blink because so few photons would be reaching your eye. – Brandon Enright Nov 26 '13 at 17:04
By this logic, you wouldn't need to step to the side. The Earth is already moving relative to the star much faster than you are moving relative to the Earth. – Michael Kjörling Nov 26 '13 at 20:34
possible duplicate of Are there "gaps" in light, or will it hit everywhere? – Matsemann Nov 26 '13 at 23:29
A corollary question to this is: Are the photons we receive from stars localized to classical trajectories, or are they spread out? If so, how much? Does the photon's wavefunction look more like the tip of a ray, or more like an expanding half-sphere? – jdm Nov 27 '13 at 15:54

The answer is simple: Yes, stars really do produce that many photons. This calculation is a solid (though very rough) approximation that a star the size of the sun might emit about $10^{45}$ visible photons per second (1 followed by 45 zeros, a billion billion billion billion billion photons).

You can do the calculation: If you're 10 light-years away from that star, you are nevertheless getting bombarded by 1 million photons per square-centimeter per second.

$$\frac{10^{45}\mathrm{photons/sec}}{4\pi (10 \, \mathrm{lightyears})^2} \approx 10^6 \mathrm{photons/cm}^2\mathrm{/sec}$$

-
Marginally related: physics.stackexchange.com/q/83866 – John Rennie Nov 26 '13 at 18:51
Good answer. I think you could make it better by showing how you arrived at that 1 million photons / sq. cm figure though. – quant Nov 26 '13 at 22:34
@ArmanSchwarz - OK, I put the equation – Steve B Nov 27 '13 at 4:05
This and many of the other answers have helped a lot. Thank you all for answering! – Shookster Nov 27 '13 at 4:55
@Shookster if this or another response have answered your question please consider marking them as the answer. – quant Nov 27 '13 at 7:26

Although I agree with all three of the above answers let me present a slightly different perspective on the problem.

It's tempting to think of the light from the star as a flood of photons that behave like little bullets. However this is oversimplified because a photon is a localised object i.e. we observe a photon when something interacts with the light and localises it.

The light from the star is not a hail of photons but instead the star is transferring energy to the photon quantum field and this energy spreads out radially and evenly. If you were to describe the light as photons you'd have to say the photons were completely delocalised i.e. they are spread over the whole spherical wavefront and you could not say in which direction the photon was travelling.

As the energy reaches you it can interact with the rhodopsin molecules in your eye and transfer one photon's worth of energy. It's at this point, and only at this point, that the energy is localised into a photon. Even if the star were so dim that it only emitted a few photons worth of energy per second there would still be a finite probability that your eye could interact with it and detect a photon, though that probability would obviously be ludicrously small.

So stepping aside would make little difference because as long as your eye intersected the spherical wavefront somewhere there would still be a finite probability of detecting a photon and therefore seeing the star.

Have a look at my answer to Some doubts about photons for some related arguments.

-
Hi John, is this essentially the path integral view of things? That a photon is spread out and takes all possible paths? If so, isn't the radial spread of one photon worth of energy not uniform but instead highly likely to be found in a small area? – Brandon Enright Nov 26 '13 at 18:55
@BrandonEnright: the spread of any single photon is spherically symmetric, but if emitted at the surface of a star the $2\pi$ steradians occupied by the star will probably spoil the original symmetry a bit :-) – John Rennie Nov 26 '13 at 18:57
@BrandonEnright: you don't need to use the path integral formulation of QFT to come to that conclusion. This is just wave-particle duality. VERY loosely (I hesitate to say this, because it has wrong bits and right bits), things propogate like waves, and they interact like particles. – Jerry Schirmer Nov 26 '13 at 18:58
@JohnRennie perhaps this needs to be asked as a question then but if a "single photon" is emitted with spherical symmetry how is momentum conserved? I thought each quanta of energy emitted as "a photon" needed to conserve momentum so the probability of it being found in a particular location was based on the uncertainty of the original momentum. Essentially meaning that you're highly likely to find that photon's quanta of energy pretty much in a straight line from wherever the momentum vector was pointing when it was created? – Brandon Enright Nov 26 '13 at 19:01
@SteveB: yes, both calculations will give the same result for the probability that a photon will enter the eye in a given time. – John Rennie Nov 27 '13 at 7:55

The only stars you can reliably see are ones that are spewing enough photons at your eyeballs to appear stable.

Any star which is so dim that photons entering your eye can literally be counted one by one, simply will not register in your vision, because your eye's retina is not sensitive enough.

So your question is basically embroiled in observer bias; it assumes that the stars you see are all the stars there are, and it assumes that you could see a single photon if it hit your eye.

-

Allow me to channel something akin to the anthropic principle here. You can only see the stars that have a lot of photons reaching your eye. If a star were so far away that photons were reaching your eyes only occasionally then the star would be too dim for you to see in in the first place. Even if you could see the photons, the star would appear to blink.

So because you can see the star and it's relatively bright, that means there is enough of a continuous stream of photons reaching the Earth that stepping side to side doesn't change anything. Also, angular resolution isn't quantized so there is never a situation where stepping side to side (while maintaining the same radius from the star) ever changes the probability of receiving a photon.

-

A star radiates in all directions. You would still see the star regardless of the number of steps you take to any side, just not the same photons.

A laser radiates in only one direction (or in a very small cone). If you took a large enough step to the side (larger than the angular size of the emitted beam) so as to exit this cone, then you would no longer see the source.

-
I think the OP is envisioning some sort of gap between "photon streams" which increases as the distance traveled increases in the same way that a slight l/r angle difference at launch time in the firing of two arrows results in an ever-widening gap between them when measure at the target. I feel this is a flaw in his/her conception, but this answer may not address that (?) – horatio Nov 26 '13 at 17:23
Seems to answer the part about being able to step to the side and no longer see the star. – Roman Hunde Nov 26 '13 at 17:47
A quick safety note: please do not stare into laser beams. – Thomas Nov 28 '13 at 3:54
"A laser radiates in only one direction..." is that really true? My understanding is that laser light is unusual only in being coherent - of a single wavelength. The quality of being collimated into a beam (a very small cone) derives from focusing lenses, which can be used with any light source. – Jon of All Trades Nov 28 '13 at 7:57
@JonofAllTrades I don't think gregsan was talking about that property of the laser, but just referring to any ordinary object that emits light into a cone rather than radiating outwards in every direction (a laser pointer comes to mind..) but the explanation would be valid even for a flashlight (barring atmospheric scattering effects, of course) – Thomas Nov 28 '13 at 8:09


text:
## Introduction to GDAL

This tutorial will introduce you to the GDAL command line tools.

### 2. Retrieving information from GIS data

#### 2.2. Retrieve information from vector data

For retrieving info from vector data we use the ogrinfo command.

1. Execute the following command:
ogrinfo -al roads.shp | more <ENTER>
ogrinfo -al gem_2011_gn1.shp | more <ENTER>

2. Answer these questions:

• What are the projections of these two shapefile?
• What are the EPSG codes?
As you can see there are several EPSG codes reported. That is because different elements of the projection have their own EPSG code. The rule of thumb is that you can take the last EPSG code. So the projection of roads.shp is EPSG: 4326, which means that it is in Geographic Coordinate System (GCS) with coordinates in Latitude/Longitude.
For gem_2011_gn1.shp the projection is EPSG: 28992, which is the Dutch projection (Amersfoort RD/New).

More info about the ogrinfo command can be found here:

More info about EPSG codes in this video


text:
# Tag Info

7

There is actually no such object as $Y|X$ --- whenever this notation appears, it is an abuse of notation which operates as shorthand for specifying the conditional distribution of a random variable conditional on another random variable.$^\dagger$ Thus, the statement $Y|X = m(X) + \epsilon$ actually doesn't make any sense; the conditionality notation $|X$ ...

4

Let the distinct values be $$X = \{x_1, x_2, \ldots, x_n\}.$$ Let the sample size be $m\, (=3).$ The ordered samples of distinct values are the subset $$\Omega = \{(y_1, y_2, \ldots, y_m) \in X^m\mid y_1\lt y_2\lt \ldots \lt y_m\}.$$ The question seeks a probability distribution on $\Omega$ with probabilities $$p(i_1,i_2,\ldots, i_m) = \Pr((y_1,\ldots, ... 3 The problem with both characterizations is that they ignore the underlying probabilities. Recall that a random variable X is a function that assigns real numbers to elements of the sample space. If a considerable part of the domain of X has no probability, then the range of X may have virtually any property whatsoever but that won't tell you a thing ... 3 Well, even if the range (or support set) of the random variable X is uncountable, X do not necessarily have a density. The answer by @Sebastian mentions measure, and specifically counting measure. But counting measure on an uncountable set isn't very useful, for instance, it is not \sigma-finite. So not very useful in probability. There is an ... 2 Consider the example where your sample space \Omega = \mathbb{R}. This is uncountably infinite. However whether the RV is continuous depends on the used measure. If you would use \mu = \# (i.e. the counting-measure) you could still easily defined a density with respect to \mu that would induce a discrete distribution. In general whether a ... 2 In my opinion, the use of the equality makes dependence on X explicit. The only place I have seen notation like y \vert X is when the distribution of y is being discussed. You see this frequently in Bayesian models like$$ y\vert \mu , \sigma \sim \mathcal{N}(\mu, \sigma)  This notation tells me that there is a prior for $\sigma$ and that the ...

2

Let's clarify some of the issues. Convexity Consider a real-valued function function $f$ defined on an interval $I$ of real numbers. (Everything that follows extends naturally and obviously to functions defined on sets $I\subset \mathbb{R}^d$ provided $I$ is a convex set, but I won't belabor that point. The key property enjoyed by $I$ is that "mixtures" ...

2

Although these statements capture the idea pretty well, we should take some care concerning their logical status: some provide definitions; others are characterizations not unique to discrete random variables; and a couple of them are meaningless (depending on how broadly they are interpreted). It can be useful to bear in mind some examples of discrete ...

1

The $n$th central moment is defined as $E[(X-E(X))^n]$, so for $n=1$, we have $E[(X-E(X))]$. By linearity of expectation, this equals $E(X)-E[E(X)]$. Since $E(X)$ already is a constant, so that $E[E(X)]=E(X)$.

1

Hi: Just set the seed to some value initially say 123.( outside any loops, before any calculations start ). Then you still have reproducibility and the problem that you describe goes away.

1

There may be a good reason for the complications, because the equivalence is not generally true. For it to hold, you have to assume $X$ has nonzero variance and that both $X$ and $Y$ have finite variances, and even then by assuming the correlation of $X$ and $Y$ is $\pm 1$ you can only conclude there exist numbers $a$ and $b$ for which there is a 100% ...

1

You can find more detail on this issue in a related question here. Absolute continuity of the CDF is a stronger condition than continuity, and essentially just means that the distribution has a valid density function. For example, if the CDF $F$ of a real scalar random variable is absolutely continuous then there exists a real function $f$ (the density) ...

1

On the one hand, it's hard to read the mind of an author of a paper that is 35 years old. On the other hand, the reason may simply be that there are far more tests for a normal than for a uniform distribution. This in turn may be due either to more interest in the normal than in the uniform distribution (the various probabilistic laws imply that we will ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
## Combinatorial Sums and Finite Differences

### Abstract

We present a new approach to evaluating combinatorial sums by using finite differences. Let {ak} ∞ k=0 and {bk} ∞ k=0 be sequences with the property that ∆bk = ak for k ≥ 0. Let gn = �n � � n k=0 k ak, and let hn = �n � � n k=0 k bk. We derive expressions for gn in terms of hn and for hn in terms of gn. We then extend our approach to handle binomial sums of the form �n � � n k=0 k (−1) kak, � � � n � � � k 2k ak, and n k 2k+1 ak, as well as sums involving unsigned and signed Stirling numbers of the first kind, �n � � n k=0 k ak and �n k=0 s(n, k)ak. For each type of sum we illustrate our methods by deriving an expression for the power sum, with ak = k m, and the harmonic number sum, with ak = Hk = 1 + 1/2 + · · · + 1/k. Then we generalize our approach to a class of numbers satisfying a particular type of recurrence relation. This class includes the binomial coefficients and the unsigned Stirling numbers of the first kind

Topics: Binomial coefficient, binomial sum, combinatorial sum, finite difference, Stirling number 2
Year: 2009
OAI identifier: oai:CiteSeerX.psu:10.1.1.134.8665
Provided by: CiteSeerX