text:
# 5.2.5. Polarimeter¶

## 5.2.5.1. Introduction¶

A polarimeter is a device to determine de polarization state of a sample. The main components of a polarimeter are: * Light Source * Polarization states generator * Sample to measure * Polarization states analyzer * Detection system

The States generator is formed by a linear polarizer and a $$\lambda$$/2 waveplate in order to generate any desired state.

The States analyzer is also formed by a linear polarizer and a $$\lambda$$/2 waveplate, but in reverse order.

The polarimetric properties of the sample, polarizers of the generator and analyzer moves in order to determine the polarimetric propierties of the sample, given by its 4x4 Mueller matrix. Also, the 2x2 Jones matrix can be determine, although not complete information is obtained.

In is example, we will simulate the intensity distribution at the output of an ideal polarimeter given a certain sample.

## 5.2.5.3. Definition of elements¶

Here we have to create the different elements that define our experiment: the light source, the polarimeter optical elements, and the sample which is going to be measured.

[2]:

# Define the light source
source = Stokes('s0')
source.circular_light('r')

[3]:

# Define sample
sample = Mueller('sample')
sample.diattenuator_charac_angles_from_vector(
p1=.9, p2=.1, alpha=45*degrees, delay=45*degrees)

[3]:

matrix([[4.10000000e-01, 2.44929360e-17, 2.82842712e-01, 2.82842712e-01],
[2.44929360e-17, 9.00000000e-02, 1.38552969e-17, 1.38552969e-17],
[2.82842712e-01, 1.38552969e-17, 2.50000000e-01, 1.60000000e-01],
[2.82842712e-01, 1.38552969e-17, 1.60000000e-01, 2.50000000e-01]])

[14]:

# Define polarimeter optical elements
pol_0=Mueller('p0')
pol_0.diattenuator_perfect(angle=0)

pol_1=Mueller('p1')
pol_1.quarter_waveplate(angle=0 * degrees)

pol_2=Mueller('p2')
pol_2.quarter_waveplate(angle=0 * degrees)

pol_3=Mueller('p3')
pol_3.diattenuator_perfect(angle=0)

elements = [pol_0, pol_1, pol_2, pol_3]

## 5.2.5.4. Definition of polarimeter¶

Here qe are going to create a function that mimics the behavior of the polarimeter experiment. We give it the illumination, the sample, the optical elements of the polarimeter, and a set of rotation angles for those elements. The output of the function will be the intensity corresponding to each set of angles.

[15]:

def polarimeter(J0, sample, elements, angles_list):

intensities = np.zeros(len(angles_list),float)
#J1s=[]
#systems=[]

for i, angles in enumerate(angles_list):

angle0, angle1, angle2, angle3 = angles

# Elements matrices
pol_0 = elements[0].rotate(angle0, keep=False)
pol_1 = elements[1].rotate(angle1, keep=False)
pol_2 = elements[2].rotate(angle2, keep=False)
pol_3 = elements[3].rotate(angle3, keep=False)

#System matrix
system = pol_3*pol_2*sample*pol_1*pol_0
system.name = 'System'

J1 = system*J0

intensities[i] = J1.parameters.intensity()
#J1s.append(J1)
#systems.append(system)

return intensities# , J1s, systems

## 5.2.5.5. Example¶

We are going to test the polarimeter function to see how they work.

### 5.2.5.5.1. Just 1 position¶

Here we insert the function just a set of angles, corresponding to 1 measurement.

[6]:

angles = [0, pi / 4, pi / 4, 0],
intensities = polarimeter(source, sample, elements, angles)
print(intensities)

[0.125]

### 5.2.5.5.2. Several positions¶

Now we will make several measurements.

[7]:

# Define a set of angles
angles_list = [
[0, pi / 4, pi / 4, 0],
[0, pi / 4, pi / 4, pi / 4],
[0, pi / 4, pi / 4, pi / 2],
[0, pi / 4, pi / 4, pi / 2],
[pi / 2, pi / 4, pi / 4, pi / 4],
[pi / 4, pi / 4, pi / 4, pi / 4],
]

[8]:

# Perform the experiment
intensities = polarimeter(source, sample, elements, angles_list)
print(intensities)

[0.125      0.17321068 0.08       0.08       0.17321068 0.30642136]

### 5.2.5.5.3. Rotate waveplate of generator¶

We can investigate how the measured intensity changes as we rotate just one element, for example, a retarder.

[9]:

# Define a set of angles
angle_0 = 45*degrees
angle_1 = np.linspace(0,360*degrees, 91)
angle_2 = 45*degrees
angle_3 = 0*degrees

angles_list = np.zeros((len(angle_1),4),dtype=float)
angles_list[:,0]=angle_0
angles_list[:,1]=angle_1
angles_list[:,2]=angle_2
angles_list[:,3]=angle_3

angles_list.tolist();

[10]:

# Perform the experiment
intensities = polarimeter(source, sample, elements, angles_list)

[11]:

# Plot the result
plt.figure()
plt.plot(angle_1/degrees, intensities,'k', lw=2)
plt.xlabel('$\phi_2\,\ (^0)$')
plt.ylabel('intensity');

## 5.2.5.6. Measure the Mueller matrix¶

Now, we will see how we can measure the Mueller matrix of the sample. Our case is very simple, as we have a polarimeter with ideal elements and a detector without errors. So, in our case, we only need 16 different measurements in order to determine the Mueller matrix of the sample.

The procedure to calculate the Mueller matrix of the sample is described in detail in “Handbook of Optics”, M. Bass et al., Vol II, Chapter 22 section 18. Now we will implement it.

[31]:

def calculate_Mueller(illum, elements, angles, intensities):

# Prealocate memory
system = np.matrix(np.zeros([16,16]))

# Loop along measurements
for ind in range(16):

angle0, angle1, angle2, angle3 = angles[ind,:]

# Elements matrices
pol_0 = elements[0].rotate(angle0, keep=False)
pol_1 = elements[1].rotate(angle1, keep=False)
pol_2 = elements[2].rotate(angle2, keep=False)
pol_3 = elements[3].rotate(angle3, keep=False)

# Polarimeter matrices
generator = pol_1 * pol_0 * illum
generator.name = 'Generator'
analyzer = pol_3 * pol_2
analyzer.name = 'Analyzer'

# System matrix
a_vector = analyzer.M[0,:]
g_vector = generator.M
s_vector = np.kron(a_vector, g_vector.T)
system[ind,:] = s_vector

# Calculate Mueller matrix
m_vector = system.I * intensities
Msample = m_vector.reshape([4,4])
return Msample

[32]:

# Create a set of angles for measurements
angles = np.random.rand(16,4)*pi
# Calculate intensities measured by the polarimeter
intensities = polarimeter(source, sample, elements, angles)
intensities = np.matrix(intensities).T
# Calculate the Mueller matrix
Mcalculated = calculate_Mueller(source, elements, angles, intensities)
sampleC = Mueller('Calculated')
sampleC.from_matrix(Mcalculated)
# Print results
print("The Mueller matrix of the sample is:")
print(sample)
print("The calculated Mueller matrix is:")
print(sampleC)

The Mueller matrix of the sample is:
sample =
[+0.410, +0.000, +0.283, +0.283]
[+0.000, +0.090, +0.000, +0.000]
[+0.283, +0.000, +0.250, +0.160]
[+0.283, +0.000, +0.160, +0.250]

The calculated Mueller matrix is:
Calculated =
[+0.410, +0.000, +0.283, +0.283]
[+0.000, +0.090, -0.000, +0.000]
[+0.283, -0.000, +0.250, +0.160]
[+0.283, -0.000, +0.160, +0.250]

format: plain


text:
All Questions

2k views

Is there any strong enough pen-and-paper or mind cipher?

Some ciphers are talked about at “Is there a secure cryptosystem that can be performed mentally?”, but (at the time of writing) I don't see an answer. Are they strong enough, or are non-computer ...
349 views

What's the difference between AES and earlier block ciphers?

Is there any difference except speed and key and block size from user's point of view? Or does AES have something that ideal block cipher doesn't have?
249 views

Indistinguishability attack example

I want solve the next exercise. The author defined the experiment for the cryptosystem $\Pi$, the adversary $A$ and the security parameter $n$ as follows $\mathsf{PRIV_{EAV}}(\Pi,A,n)$ The ...
536 views

How to derive two keys from one password

What is the best way to generate two independent symmetric keys from one user-entered password or passphrase? Would using both scrypt and pbkdf2 achieve this?
2k views

Is AES really used for Top Secret stuff?

I've read almost everywhere that AES-256 can be used for Top Secret material (in the US). Is it really used or is it some kind of decoy to hide the more advanced algorithm they might use ?
215 views

Elliptic Curve is DH function or PKI?

can we reuse same ECC key on TLS for long terms or it must be used just once? (i mean can we use ECC like RSA?) is there patent free ECC implementation ?
256 views

What length should the padding be when encrypting or signing with RSA?

I am wondering what length the padding should be when encrypting or signing with RSA. Does it matter what length the padding is, and if so — what length should it be? Another point: Should it be ...
928 views

CBC-MAC , fixed length, all blocks returned

CBC-MAC, with fixed length message. Is it safe to return all ciphered blocks instead of the last? My intuition says it is less secure, since is gives an attacker more information. But how could one ...
525 views

encrypt message with one digest 0-9 instead of 01-26

How much will the security of one-time pad decrease if I use one digit from 0-9 instead of 1-26? for example plaintext = "blue" and ...
1k views

Encrypt a single file, chunk-by-chunk, each chunk using different key (AES)

Encrypt a single file, chunk-by-chunk, each chunk using different key. I am a security newbie (only took 2 security courses before) But currently I am using this encryption method for my Android ...
808 views

Have I understood pedersen commitment correctly?

I want to do a one-sided integer commitment scheme. I.e. the whole process must be non-interactive where I at one point first publicly reveal some data and then at a later time reveal the committed ...
79 views

Book Didactic Security Notions [closed]

I want study more about cryptography reading papers, but I have a problems to understand few concepts: security notions, random oracle model, IND-CCA, ... etc. I began study this concepts by internet: ...
423 views

Knowing a valid salted hash for an unknown secret, is it possible to compute another valid hash?

$H(s,r)=d$ is a function that hashes the secret string $s$ with a salt $r$, and returns a digest $d$. $r$ may be arbitrarily chosen and each $r$ returns a different $d$. For any $d$, $r$ is known from ...
470 views

Is it worth applying a MAC on data in a HSM?

I'm building a basic HSM out of an Arduino, and am using the following scheme to store data: Master symmetric key $k_m$ stored in firmware (secure bit set to prevent trivial extraction). Secondary ...
170 views

How to compare two datasets „anonymously”?

Ok, I hope this question makes some sense because I am not so sure how to word it any differently… Imagine the following situation: There are 10 defined colors (blue, orange, yellow etc.) There are ...
654 views

Padding of Original Message in MD5

what should I do if my original message is greater than 64 bits? what is the process of padding in MD5? As described in Internet Security: Cryptographic Principles, Algorithms and Protocols, page ...
297 views

chaining rsa with ecies

In an answer to a previous question it was suggested that one way to protect your asymmetrically encrypted AES-256 keys, from say a solution to prime factorization, would be to chain asymmetric ...
626 views

Proof that padded RSA is CPA-secure

I'm referring to page 383 of J. Katz and Y. Lindell's Introduction to Modern Cryptography. The book presents a padded RSA: ${\bf Key Generation:}$ same as Textbook RSA (given security parameter ...
94 views

I am read this paragraph and I have a doubt. "An adversary to PKC $\Pi$ is given by two probabilistic polynomial time algorithms, $A = (A1; A2)$. In the first stage, the "find" stage, the ...
501 views

Why does key generation take an input $1^k$, and how do I represent it in practice?

In my lecture, the lecturer said: Let $K$ be the key generation algorithm. Given a security parameter represented in unary, $1^k$, $K(1^k)$ will output a keypair $(pk; sk)$, known as the public ...
98 views

Sematically Secure McEliece

I am read the Lemma 2 (pp13) in the paper "Kazukuni Kobara and Hideki Imai: Semantically Secure McEliece Public-Key Cryptosystems –Conversions for McEliece PKC– (PKC 2001)". Related to the question ...
628 views

Toy hash algorithm that can be broken

I'm looking for a toy hash function, where the idea is to have high school students break (i.e. find a collision) a hash function by hand, in order to teach them how one way functions and hashing ...
1k views

Custom crypto library in C

I will be making (in the near future) an app that will contain some pretty heavy crypto. As it is possible that my app will be ported to different devices (initially it will be iOs only, but Mac, ...


text:
# How many sun-like stars are there in the universe?

After yesterday's announcement of the Kepler telescope finding a huge amount of newly observed exoplanets, i saw a headline claiming that as much as 22% of sun like stars in the universe have planets in their habitable zone. There are loads of stars in the universe, so the number of planets in the habitable zone has to be enourmous. But how many of the stars in the universe are about the same size as our sun?

-

There are perhaps 100 billion stars in a galaxy and 100 billion galaxies in the universe, giving something on the order of $4\times 10^{20}$ (400 billion billion) stars that are about ($\pm 30\%$) one solar mass.


text:
# Plotting eigenvalues as a function of a variable

I am attempting to plot the the eigenvalues for the matrix:

H=matrix([[1+x, 0, x],[0, 2, 2*x],[x, 2*x, 1+x]])

which were calculated using the following method:

a=H.eigenvalues()

in the following way:

h=fast_callable(real_part(a[2]),vars=[x],domain=CC)

plot(h,(0,0.5))

but unfortunately this does not work for a[0] and a[1],

f=fast_callable(real_part(a[0]),vars=[x],domain=CC)
g=fast_callable(real_part(a[1]),vars=[x],domain=CC)

plot(f,(0,0.5))+plot(g,(0,0.5))

Any suggestions would be greatly appreciated.

edit retag close merge delete

Sort by » oldest newest most voted

In this approach you can check that the eigenvalues are real:

reset()
f=lambda x:matrix([[1+x, 0, x],[0, 2, 2*x],[x, 2*x, 1+x]]).eigenvalues()
#the first ***real*** eigenvalue versus x
l0=[[x,f(x)[0]] for x in srange(0,0.5,0.01)]
p0=list_plot(l0,plotjoined=true)
#the second eigenvalue
l1=[[x,f(x)[1]] for x in srange(0,0.5,0.01)]
p1=list_plot(l1,plotjoined=true)
#the third eigenvalue
l2=[[x,f(x)[2]] for x in srange(0,0.5,0.01)]
p2=list_plot(l2,plotjoined=true)
# all
show(p0+p1+p2)

more

Very elegant thanks.

( 2013-01-02 05:50:36 -0500 )edit

Something odd is definitely happening here, and I am not the one to help on this situation. But, here is some code that will get the plot you want. It's a bit brute force and not as elegant as your approach, but it does work.

H=matrix([[1+x, 0, x],[0, 2, 2*x],[x, 2*x, 1+x]])
pts0=[]
pts1=[]
pts2=[]
xlist=srange(0,0.5,0.01)
ans=[map(lambda x: n(real_part(x)),H.subs(x=x0).eigenvalues()) for x0 in xlist]
ans=[sorted(a) for a in ans]
for i in range(0,len(xlist)):
pts0.append([xlist[i],ans[i][0]])
pts1.append([xlist[i],ans[i][1]])
pts2.append([xlist[i],ans[i][2]])
list_plot(pts0,plotjoined=true,color='red')+list_plot(pts1,plotjoined=true,color='blue')+list_plot(pts2,plotjoined=true,color='green')

Using the characteristic polynomial and the implicit_plot command also gives a really nice plot.

var('y')
H=matrix([[1+x, 0, x],[0, 2, 2*x],[x, 2*x, 1+x]])
p(x,y)=H.charpoly('y')
implicit_plot(p(x,y),(x,-3,5),(y,0,5))

You can also use contour_plot to color the regions in the plane by sign.

contour_plot(p(x,y),(x,-3,5),(y,0,5),contours=0,cmap=['red','blue'])

more

Thank you very much, at least now I have a working method. The real problem here is my knowledge of programming is somewhat limited so I don't understand what the eigenvalues() method is doing under the hood. One thing that struck me as odd is that both a[0] and a[1] take on complex values for different values of x when H is a hermitian matrix. Granted this could be a computational thing because the complex parts are of order 10^-15 and -19 for the values of x I tried, i.e. effectively 0.

( 2013-01-02 00:23:02 -0500 )edit

If you are getting such small complex parts, then you are correct that this is a computational issue. @achrzesz gives some very nice code in his answer.

( 2013-01-02 02:38:35 -0500 )edit


text:
### In a pickup game of dorm shuffleboard, students c…

02:11
AH
Carnegie Mellon University
Problem 1

The floor of a railroad flatcar is loaded with loose crates having a coefficient of static friction of 0.25 with the floor. If the train
is initially moving at a speed of 48 $\mathrm{km} / \mathrm{h}$ , in how short a distance
can the train be stopped at constant acceleration without causing
the crates to slide over the floor?

36$m$

## Discussion

You must be signed in to discuss.

## Video Transcript

so here the greatest deceleration is provided by the maximum frictional force in this case, the normal forces equaling MG. And this is simply from the from the figure and the Newton. Using Newton's second law, we can say that the acceleration would be equaling the maximum static frictional force divided by and the Mass. And this would be equaling to the mat to the er coefficient of static friction multiplied by the normal force or, in this case, MG divided by EMS, the EMS cancel out. And this is giving us this coefficient of static friction multiplied by the acceleration due to gravity. And we can say that the shortest distance to stop would be that magnitude of this of the displacement in the ex direction. This would be equaling the velocity squared, divided by two times the acceleration. And in this case, it's me. The velocity squared, divided by two times the coefficient of static friction times G. And in this case we have a velocity in kilometers per hour. So we'll say 48 kilometers per hour, multiplied by 1000 meters for every one kilometer multiplied by one hour for every 3600 seconds. We're going to square this term. This will be divided by two multiplied by the coefficient of static friction of 20.25 multiplied by 9.8 meters per second squared. And we find that the magnitude of the displacement in the ex direction is going to be equaling two, approximately 36 meters. That is the end of the solution. Thank you for watching.


text:
# On the [combinatorics] and [counting] tags.

currently has 13 questions bearing this tag. Should and be merged, or one be made a synonym of the other?

• Except for the question about nomenclature of counting numbers, all the other (counting) questions seem to belong in (combinatorics). – Arturo Magidin Dec 11 '10 at 2:52
• then should we just retag the questions? – Sean Tilson Dec 11 '10 at 3:33
• Not sure. [counting] + [combinatorics] lets you know the kind of question to expect, while just [combinatorics] might not. Of course, once the question is read, but... – Aryabhata Dec 11 '10 at 5:07
• @J.M.: If two tags are merged, can they be unmerged? Since users with more than rep $N$ for some $N$ (i don't remember) can create tags, what happens to merged tags that get "recreated". Or perhaps I am misunderstanding what merging means. – Timothy Wagner Dec 11 '10 at 15:34
• As I understand it, mere retagging won't preclude the tag being used again by future questions. Turning, say [counting], into a [combinatorics] synonym would ensure that when future questions are tagged [counting], the system automagically retags them as [combinatorics]. I was about to retag one question, but since I do not think myself possessing combinatorics expertise, I am now asking here in meta. – J. M. is a poor mathematician Dec 11 '10 at 15:40
• @Arturo: The fact that all [counting] questions belong in [combinatorics] just tells you that counting (i.e. enumerative combinatorics) is a subset of all combinatorics. In that respect, having both tags around seems no different than having both an [algebraic-topology] tag and a [topology] tag. Moreover, it's also worth having the tag around since a questioner might very well have a counting question without knowing what the word combinatorics means!! – Dan Petersen Dec 11 '10 at 21:08
• @Dan Petersen: The question is whether there is sufficient demand for specific counting questions (or for more general combinatorics one) to justify having them separate; we don't have distinct tags for (finite-group-theory) and (group-theory), for instance. As for people with counting questions not knowing what combinatorics means, wouldn't making [counting] a synonym fix that? Someone who doesn't know the word would type "counting", and the system would automatically change it to [combinatorics]. – Arturo Magidin Dec 11 '10 at 21:10
• Clarification re merging versus synonyms: merging is about existing questions; synonyms are about future questions. Merging [counting] into [combinatorics] would be a mass retagging of every [counting] question as [combinatorics] without bumping the questions to the top and with no effect on future questions. Setting [counting] as a synonym for [combinatorics] will cause any future use of [counting] to automatically be changed to [combinatorics] with no effect on existing questions. – Isaac Dec 11 '10 at 21:35
• @Isaac: Thanks for that clarification. I would support making synonyms; I'm indifferent towards merging, but perhaps it would be a good idea if we go for synonymity. – Arturo Magidin Dec 12 '10 at 4:21


text:
# KP integrability of triple Hodge integrals. II. Generalized Kontsevich matrix model

@article{Alexandrov2020KPIO,
title={KP integrability of triple Hodge integrals. II. Generalized Kontsevich matrix model},
author={A. Alexandrov},
journal={Analysis and Mathematical Physics},
year={2020},
volume={11},
pages={1-82}
}
• A. Alexandrov
• Published 2020
• Physics, Mathematics
• Analysis and Mathematical Physics
In this paper we introduce a new family of the KP tau-functions. This family can be described by a deformation of the generalized Kontsevich matrix model. We prove that the simplest representative of this family describes a generating function of the cubic Hodge integrals satisfying the Calabi–Yau condition, and claim that the whole family describes its generalization for the higher spin cases. To investigate this family we construct a new description of the Sato Grassmannian in terms of a… Expand
3 Citations
KP hierarchy for Hurwitz-type cohomological field theories
We generalise a result of Kazarian regarding Kadomtsev-Petviashvili integrability for single Hodge integrals to general cohomological field theories related to Hurwitz-type counting problems orExpand
KP integrability of triple Hodge integrals. III. Cut-and-join description, KdV reduction, and topological recursions
In this paper, we continue our investigation of the triple Hodge integrals satisfying the Calabi–Yau condition. For the tau-functions, which generate these integrals, we derive the complete familiesExpand
KP integrability of triple Hodge integrals, I. From Givental group to hierarchy symmetries
In this paper we investigate a relation between the Givental group of rank one and Heisenberg-Virasoro symmetry group of the KP hierarchy. We prove, that only a two-parameter family of the GiventalExpand

#### References

SHOWING 1-10 OF 90 REFERENCES
KP hierarchy for Hodge integrals
Abstract Starting from the ELSV formula, we derive a number of new equations on the generating functions for Hodge integrals over the moduli space of complex curves. This gives a new simple andExpand
From Hurwitz Numbers to Kontsevich–Witten Tau-Function: A Connection by Virasoro Operators
In this letter, we present our conjecture on the connection between the Kontsevich–Witten and the Hurwitz tau-functions. The conjectural formula connects these two tau-functions by means of the GL(∞)Expand
Open intersection numbers, matrix models and MKP hierarchy
A bstractIn this paper we conjecture that the generating function of the intersection numbers on the moduli spaces of Riemann surfaces with boundary, constructed recently by R. Pandharipande, J.Expand
Enumerative Geometry, Tau-Functions and Heisenberg–Virasoro Algebra
In this paper we establish relations between three enumerative geometry tau-functions, namely the Kontsevich–Witten, Hurwitz and Hodge tau-functions. The relations allow us to describe theExpand
Open intersection numbers and free fields
Abstract A complete set of the Virasoro and W-constraints for the Kontsevich–Penner model, which conjecturally describes intersections on moduli spaces of open curves, was derived in our previousExpand
Hodge integrals and Gromov-Witten theory
• Mathematics, Physics
• 1998
Integrals of the Chern classes of the Hodge bundle in Gromov-Witten theory are studied. We find a universal system of differential equations which determines the generating function of theseExpand
The spectral curve and the Schrödinger equation of double Hurwitz numbers and higher spin structures
• Mathematics, Physics
• 2013
We derive the spectral curves for q-part double Hurwitz numbers, r-spin simple Hurwitz numbers, and arbitrary combinations of these cases, from the analysis of the unstable (0, 1)-geometry. WeExpand
Towards unified theory of $2d$ gravity
• Physics
• 1992
We introduce a new 1-matrix model with arbitrary potential and the matrix-valued background field. Its partition function is a $\tau$-function of KP-hierarchy, subjected to a kind of \${\calExpand
Cut-and-join description of generalized Brezin-Gross-Witten model
We investigate the Brezin-Gross-Witten model, a tau-function of the KdV hierarchy, and its natural one-parameter deformation, the generalized Brezin-Gross-Witten tau-function. In particular, weExpand
Generalized Kontsevich model versus Toda hierarchy and discrete matrix models
• Physics
• 1993
Abstract We present the partition function of the Generalized Kontsevich Model (GKM) in the form of a Toda lattice τ-function and discuss various implications of non-vanishing “negative-time” andExpand


text:
# Why stall on 2D faster than 3D?

1. why cl on 2D is better than 3D. and why cl 2D stall faster than 3D?

2. what happens when CP continues to move forward on the wing. and what happens when CP continues to move forward on the elevator.

• – Peter Kämpf Oct 4 '17 at 19:20
• Ade, please be aware that asking multiple questions in the same posts is generally frowned upon. In this case they are quite close to each other, so an answer should be able to cover all your questions, but please try to avoid repeating it. – Federico Oct 5 '17 at 20:40

Stall happens because the flow cannot follow the airfoil. If you have a 3d wing, the pressure difference between the pressure side (below the wing) and the suction side (above the wing) can be reduced due to wing tip vortices —> less lift —> smaller $c_L$. They are generated because of the pressure difference. This will reduce the adverse pressure gradient above the airfoil and hence reduce flow separation. These vortices additionally inject energy into the boundary layer (pushing the air toward the airfoil) such that the flow can better follow the air foil despite the adverse pressure gradient. Hence, stall is later for 3d wings.


text:
# Meaning of the Corollary 31.29 of the Chinese Remainder Theorem

If $n_1, n_2, ..., n_k$ are pairwise relatively prime and $n = n_1n_2...n_k$ then for all integers $x$ and $a$,

$$x \equiv a \pmod {n_i}$$

for $i=1,2,...,k$ if and only if

$$x \equiv a \pmod n$$

There seems to be some words missing in the theorem/corollary. Should it read:

For all integers $x$ and $a$ that satisfy the equation:

$$x \equiv a \pmod {n_i}$$

we have that it implies that:

$$x \equiv a \pmod n$$

is also true. Furthermore, the converse is true too.

In other words, if: $x \equiv a \pmod {n_i}$ for some integer $a$ and $x$, then it implies that $x \equiv a \pmod n$ and visa versa. i.e. If $x \equiv a \pmod n$ is true then $x \equiv a \pmod {n_i}$.

Is that correct?

• Yes, the meaning is exactly that you mentioned. "If and only if" means that the implication is true in both directions. – Peter Dec 15 '15 at 9:48

It means something like $x \equiv 2 \pmod 5$ and $x \equiv 2 \pmod 7$ if and only if $x \equiv 2 \pmod{35}$


text:
## What is the difference between MLE and MAP?

Maximum likelihood is a special case of Maximum A Posterior estimation. To be specific, MLE is what you get when you do MAP estimation using a uniform prior. Both methods come about when we want to answer a question of the form: “What is the probability of scenario $Y$ given some data, $X$ i.e. $P(Y|X)$.

A question of this form is commonly answered using Bayes’ Law.

MLE
If we’re doing Maximum Likelihood Estimation, we do not consider prior information (this is another way of saying “we have a uniform prior”) [K. Murphy 5.3]. In this case, the above equation reduces to

In this scenario, we can fit a statistical model to correctly predict the posterior, $P(Y|X)$, by maximizing the likelihood, $P(X|Y)$. Hence “Maximum Likelihood Estimation.”

MAP
If we know something about the probability of $Y$, we can incorporate it into the equation in the form of the prior, $P(Y)$. In This case, Bayes’ laws has it’s original form.

We then find the posterior by taking into account the likelihood and our prior belief about $Y$. Hence “Maximum A Posterior”.

## Using MLE or MAP estimation to answer a question

Let’s say you have a barrel of apples that are all different sizes. You pick an apple at random, and you want to know its weight. Unfortunately, all you have is a broken scale.

For the sake of this example, lets say you know the scale returns the weight of the object with an error of +/- a standard deviation of 10g (later, we’ll talk about what happens when you don’t know the error). We can describe this mathematically as:

Let’s also say we can weigh the apple as many times as we want, so we’ll weigh it 100 times.

We can look at our measurements by plotting them with a histogram

Now, with this many data points we could just take the average and be done with it

The weight of the apple is (69.62 +/- 1.03) g

If the $\sqrt{N}$ doesnt look familiar, this is the “standard error”

No surprises, nothing fancy.

If you find yourself asking “Why are we doing this extra work when we could just take the average”, remember that this only applies for this special case. It’s important to remember, MLE and MAP will give us the most probable value. For a normal distribution, this happens to be the mean. So, we will use this to check our work, but they are not equivalent.

• MLE = ‘mode’ (or ‘most probable value’) of the posterior PDF [E. Jaynes 6.11.1]
• mean = expected value from samples

### Maximum Likelihood Estimation using a grid approximation

Just to reiterate: Our end goal is to find the weight of the apple, given the data we have. To formulate it in a Bayesian way: We’ll ask what is the probability of the apple having weight, $w$, given the measurements we took, $X$. And, because were formulating this in a Bayesian way, we use Bayes’ Law to find the answer:

If we make no assumptions about the initial weight of our apple, then we can drop $P(w)$ [K. Murphy 5.3]. We’ll say all sizes of apples are equally likely (we’ll revisit this assumption in the MAP approximation).

Furthermore, we’ll drop $P(X)$ - the probability of seeing our data. This is a normalization constant and will be important if we do want to know the probabilities of apple weights. But, for right now, our end goal is to only to find the most probable weight. P(X) is independent of $w$, so we can drop it if we’re doing relative comparisons [K. Murphy 5.3.2].

This leaves us with $P(X|w)$, our likelihood, as in, what is the likelihood that we would see the data, $X$, given an apple of weight $w$. If we maximize this, we maximize the probability that we will guess the right weight.

#### Enter the grid approximation:

The grid approximation is probably the dumbest (simplest) way to do this. Basically, we’ll systematically step through different weight guesses, and compare what it would look like if this hypothetical weight were to generate data. We’ll compare this hypothetical data to our real data and pick the one the matches the best.

To put this illustratively:

To formulate this mathematically:

For each of these guesses, we’re asking “what is the probability that the data we have, came from the distribution that our weight guess would generate”. Because each measurement is independent from another, we can break the above equation down into finding the probability on a per measurement basis

So, if we multiply the probability that we would see each individual data point - given our weight guess - then we can find one number comparing our weight guess to all of our data. We can then plot this:

There you have it, we see a peak in the likelihood right around the weight of the apple.

But, you’ll notice that the units on the y-axis are in the range of 1e-164. This is because we took the product of a whole bunch of numbers less that 1. If we were to collect even more data, we would end up fighting numerical instabilities because we just cannot represent numbers that small on the computer. To make life computationally easier, we’ll use the logarithm trick [Murphy 3.5.3].

This is the log likelihood. We can do this because the likelihood is a monotonically increasing function

These numbers are much more reasonable, and our peak is guaranteed in the same place.

The weight of the apple is (69.39 +/- 1.03) g

In this case our standard error is the same, because $\sigma$ is known.

To implement this in code

Implementing this in code is very simple. The python snipped below accomplishes what we want to do.

from scipy.stats import norm
import numpy as np

weight_grid = np.linspace(0, 100)

likelihoods = [
np.sum(norm(weight_guess, 10).logpdf(DATA))
for weight_guess in weight_grid
]
weight = weight_grid[np.argmax(likelihoods)]

### MLE grid approximation for multiple parameters

Now lets say we don’t know the error of the scale. We know that its additive random normal, but we don’t know what the standard deviation is

We can use the exact same mechanics, but now we need to consider a new degree of freedom.

In other words, we want to find the mostly likely weight of the apple and the most likely error of the scale

Comparing log likelihoods like we did above, we come out with a 2D heat map

The maximum point will then give us both our value for the apple’s weight and the error in the scale.

The weight of the apple is (69.39 +/- .97) g

### Maximum A Posterior with a grid approximation

In the above examples we made the assumption that all apple weights were equally likely. This simplified Bayes’ law so that we only needed to maximize the likelihood

However, not knowing anything about apples isn’t really true. We know an apple probably isn’t as small as 10g, and probably not as big as 500g. In fact, a quick internet search will tell us that the average apple is between 70-100g. So, we can use this information to our advantage, and we encode it into our problem in the form of the prior.

By recognizing that weight is independent of scale error, we can simplify things a bit. So we split our prior up [R. McElreath 4.3.2]

Like we just saw, an apple is around 70-100g so maybe we’d pick the prior

Likewise, we can pick a prior for our scale error. We’re going to assume that broken scale is more likely to be a little wrong as opposed to very wrong

With these two together, we build up a grid of our prior using the same grid discretization steps as our likelihood. We then weight our likelihood with this prior via element-wise multiplication.

From this, we obtain our Posterior.

The weight of the apple is (69.39 +/- .97) g

In this example, the answer we get from the MAP method is almost equivalent to our answer from MLE. This is because we have so many data points that it dominates any prior information [Murphy 3.2.3]. But I encourage you to play with the example code at the bottom of this post to explore when each method is the most appropriate.

## Example code

Play around with the code and try to answer the following questions

1. How sensitive is the MAP measurement to the choice of prior?
2. How sensitive is the MLE and MAP answer to the grid size?

## A final note

I used standard error for reporting our prediction confidence; however, this is not a particular Bayesian thing to do. I do it to draw the comparison with taking the average and to check our work. In practice, you would not seek a point-estimate of your Posterior (i.e. the maximum). Instead, you would keep denominator in Bayes’ Law so that the values in the Posterior are appropriately normalized and can be interpreted as a probability. But, how to do this will have to wait until a future blog post.


text:
Prove that $I(A;B|C)=0$ given $I(A;B)=0$

Let $$A$$, $$B$$ and $$C$$ be 3 discrete random variables. If $$A$$ and $$B$$ are independent ($$I(A;B) = 0$$, where $$I$$ represents the mutual information), how can we prove that $$I(A;B|C)=0$$? When I draw a Venn diagram this seems trivially true, but I just cannot find a way to prove it.

• Have you checked the relevant definitions? Have you tried constructing counterexamples? By the way, can you edit the question to include the definition of the notation $I$? – John L. Mar 13 '19 at 14:14
• @Apass.Jack I know the basic definitions of the information measures, but I am not familiar with the field and the only way I can use to tackle problems in information theory is to draw the Venn diagrams. If the statement is not true in general, could you give me some hints on how to construct the counter-example? – hklel Mar 13 '19 at 19:23

$$I(A;B\mid C)$$ indicates "the reduction in the uncertainty of $$A$$ due to knowledge of $$B$$ when $$C$$ is given".
To find an example where $$I(A;B\mid C)\not= 0$$, we can see if the combination of $$B$$ and $$C$$ can help determine $$A$$ even though knowing $$B$$ alone does not help at all.
So let us try to create $$A$$ from the combination of $$B$$ and $$C$$. Let $$B$$ and $$C$$ be two simplest non-trivial independent random variables, $$P(B=0, C=0)=P(B=0, C=1)=P(B=1, C=0)=P(B=1, C=1)=1/4.$$ Let $$A$$ be 0 if $$B$$ and $$C$$ turns out the same and 1 otherwise.
We can check that $$A$$, $$B$$ and $$C$$ are pairwise independent. However, given the values of any two of them, the third one is determined. (In modulo arithmetic, $$B+C=A(\bmod 2)$$). When $$C$$ is given, we will not know anything more about $$A$$; if $$B$$ is known additionally, we will know $$A$$ completely. The above shows how we can find and understand an example. Beginners are encouraged to verify various "obvious" (or "obscure") claims above by using the corresponding definitions.
Exercise. Verify that $$I(A;B)=0$$ and $$I(A;B\mid C)=1$$ in the example above.
Your claim is false. Let $$A,B,C$$ range uniformly over the set $$\{(x,y,z) \in \{0,1\}^3 : x \oplus y \oplus z = 0 \}.$$ On the one hand, $$I(A;B) = 0$$. On the other hand, $$I(A;B|C) = 1$$.


text:
## Thomas' Calculus 13th Edition

Formula to calculate the sum of a geometric series is: $S=\dfrac{a}{1-r}$; Consider the series $\lim\limits_{n \to \infty} s_n=\lim\limits_{n \to \infty} \dfrac{n!}{n^n}$ . As we can see that the terms for numerator will be increasing much than the terms on denominator. Also, $\lim\limits_{n \to \infty} s_n=\lim\limits_{n \to \infty} \dfrac{n!}{n^n}=\infty \ne 0$ Hence, the given diverges.


text: 1792792615F5E5B7667E1D742F8BCB36FA1C4DEEB8DA483F7733C2A431CC61D9E8C29A3C1881057E4905B29A2D84961AD00AFB3C60E3B91DF3EA4972FF07DEB23D279D13D5C6E0002E24DAC7E99662A45553 A7 06 02 00 00 08 10 06 BF E3 9A 1F FF FB EB BF FB3C60E3B91DF3EA4972FF07DEB23D27A9A2CED6C100C11E94BD283E936499F5


text:
## Filters

Q

Electronic Configuration All the alkali metals have one valence electron, $ns^{1}$  outside the noble gas core. The loosely held s electron in the outermost valence shell of these elements makes them the most electropositive metals. They readily lose an electron to give monovalent M+ ions. Hence they are never found in the free or native state in nature.


text:
# [NTG-context] counter values as label names

Daniel Schopper daniel.schopper at aon.at
Mon Jan 3 19:09:18 CET 2011

First of all thanks for the advice and sorry for my naïve posting!
Here's a test file for what I try to do. The problem is that the page-
and linenumbers printed by \placefootnotes all take the values of the
last reference.

\setupfootnotes[
location=text,
numberconversion=empty,
paragraph=,
]
\newcount\entrycounter
\entrycounter=0
\def\appentry#1#2{%
\startline[line:\the\entrycounter]%
\pagereference[page:\the\entrycounter]%
#1%
\stopline[line:\the\entrycounter]%
\footnote{{\bf \at[page:\the\entrycounter]}
\inline[line:\the\entrycounter] #1] #2}}%
\starttext\startlinenumbering
This is a sample \appentry{paragraph}{om. h1}.\\
An this is another \appentry{one}{sentence}.
\stoplinenumbering
\bigskip
Endnotes
\placefootnotes
\stoptext

> Finally: is the format of your apparatus (endnotes) a requirement?
Yes, unfortunately it is.

Thanks again,
Daniel


text:
# If the matrix X has a dimension of 4 times 6, matrix A has a dimension of 5 times 5, matrix

If the matrix X has a dimension of $4×6$, matrix A has a dimension of $5×5$, matrix B has a dimension of $3×5$ and matrix D has a dimension of $4×6$,The dimension of D' is $6×4$. True or false

You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

Jozlyn
Step 1
According to the given information,
Consider the given dimension of the matrices.
$dim\left(X\right)=4×6$
$dim\left(A\right)=5×5$
$dim\left(B\right)=3×5$
$dim\left(D\right)=4×6$
Step 2
It is required to tell whether the dimension of D’ is $6×4$. D’ is the transpose of matrix and yes the dimension of D’ is $6×4$. So, the given statement is true.
example:
let $D={\left[\begin{array}{cccccc}1& 2& 3& 4& 5& 6\\ 1& 2& 3& 4& 5& 6\\ 1& 2& 3& 4& 5& 6\\ 1& 2& 4& 5& 6& 7\end{array}\right]}_{4×6}$
$D‘={\left[\begin{array}{cccc}1& 1& 1& 1\\ 2& 2& 2& 2\\ 3& 3& 3& 4\\ 4& 4& 4& 5\\ 5& 5& 5& 6\\ 6& 6& 6& 7\end{array}\right]}_{6×4}$


text:
## Fixed points of multivalued nonexpansive maps.(English)Zbl 0667.47028

The authors prove two theorems on the existence of fixed points for non- expansive correspondences. Here ‘non-expansive’ is not the usual notion related to the Hausdorff metric but to other definitions more “single- valued” in nature. The theorems are closely allied to theorems for non- expansive mappings in that they require the ambient space to satisfy Opial’s condition [Z. Opial, Bull. Am. Math. Soc. 73, 591-597 (1967; Zbl 0179.199)].
Reviewer: A.C.Thompson

### MSC:

 47H10 Fixed-point theorems 54C60 Set-valued maps in general topology 47H09 Contraction-type mappings, nonexpansive mappings, $$A$$-proper mappings, etc.

Zbl 0179.199


text:
# Efficient algorithm for numerical estimation of 3D rotation matrix

I am writing a computer vision related program and stuck on a problem. I have a system of quadratic equations

where M is a constant 3x3 matrix, is the 3x3 identity matrix, and we are solving for the 3x3 matrix R.

The first set of equations contains 6 independent equations which leaves us with 3 degrees of freedom of SO(3) group. The second set of 3 equations just states that the matrix is symmetric.

Since this program will repeatedly solve these equations, I am searching for an efficient algorithm which I can run on Raspberry Pi, i.e. not monsters like Matlab, Mathematica or root.

• This problem is equivalent to: given a constant 3x3 matrix $P$, find a symmetric 3x3 matrix $S$ such that $SPS = \mathbb{I}$ (take $P=(M^{-1})^T M^{-1}$ and $R = S (M^{-1})^T$). That gives you 9 quadratic equations in 6 unknowns. I don't know if that helps. – D.W. Mar 22 '19 at 19:40
• P is a symmetric matrix, so it is still 6 equations. – Vahagn Mar 23 '19 at 8:25
• Can I ask some more about the underlying problem? Are you trying to match point correspondences? Because if so, that's a fairly well-understood problem. – Pseudonym Mar 25 '19 at 22:15


text:
Competitions

# Degree of symmetry

For a natural number let's define the degree of symmetry as an amount of pairs of its decimal digits, whose digits are equal and stand symmetrically with respect to the center of the number's decimal notation. If some digit stands in the center of the decimal notation, then it must be accepted too, as in pair with itself. Find the degree of symmetry of a given number n.

#### Input

The natural number n (n < 2 ·109).

#### Output

Print the degree of symmetry of n.

Time limit 1 second
Memory limit 64 MiB
Input example #1
123322

Output example #1
2


text:
# How do you solve 2x^3+4+2i=0?

Dec 23, 2016

The roots are:

${x}_{1} = \sqrt[3]{2 + i}$

${x}_{2} = \omega \sqrt[3]{2 + i}$

${x}_{3} = {\omega}^{2} \sqrt[3]{2 + i}$

#### Explanation:

Given:

$2 {x}^{3} + 4 + 2 i = 0$

Divide through by $2$ to get:

${x}^{3} + 2 + i = 0$

Subtract $2 + i$ from both sides to get:

${x}^{3} = 2 + i$

This has roots:

${x}_{1} = \sqrt[3]{2 + i}$

${x}_{2} = \omega \sqrt[3]{2 + i}$

${x}_{3} = {\omega}^{2} \sqrt[3]{2 + i}$

where $\omega = - \frac{1}{2} + \frac{\sqrt{3}}{2} i$ is the primitive Complex cube root of $1$.

If you prefer these roots in $a + b i$ form, then it can be done with trigonometric functions:

First note that:

$\left\mid 2 + i \right\mid = \sqrt{{2}^{2} + {1}^{2}} = \sqrt{5}$

$A r g \left(2 + i\right) = {\tan}^{- 1} \left(\frac{1}{2}\right)$

Hence, using de Moivre's formula:

${x}_{1} = \sqrt[6]{5} \cos \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right)\right) + i \sqrt[6]{5} \sin \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right)\right)$

${x}_{2} = \sqrt[6]{5} \cos \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right) + \frac{2 \pi}{3}\right) + i \sqrt[6]{5} \sin \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right) + \frac{2 \pi}{3}\right)$

${x}_{3} = \sqrt[6]{5} \cos \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right) + \frac{4 \pi}{3}\right) + i \sqrt[6]{5} \sin \left(\frac{1}{3} {\tan}^{- 1} \left(\frac{1}{2}\right) + \frac{4 \pi}{3}\right)$


text:
# Sequenced steps to install Perl Strawberry, MySQL, and DBD::mysql on Windows XP

I'm looking for a good guide with sequenced and detailed steps for installing Perl Strawberry, MySQL, and DBD::mysql on Windows XP.

The main goal I want to accomplish here is to have the ability to create databases and perform regular actions against them via Perl Strawberry using DBD::mysql

I've found this so far, but it's a little out-dated and I don't want to go through all that just to find out that it doesn't work.

The furthest I've gotten on my own (on another computer) is getting Perl Strawberry installed and to work properly, getting MySQL installed, and ATTEMPT to use cpan DBD::mysql to install the module (which failed because it couldn't find MySQL - I also tried the --with-mysql=C:\path\to\mysql option it suggests, but that does't work for me)

-
i ended up using DBI instead – CheeseConQueso Nov 24 '10 at 23:57
You say "i ended up using DBI instead". That is an odd statement as DBI uses the appropriate DBD modules to communicate with a database. So, DBI would need DBD::mysql to be able to interface with a MySQL database. – Sinan Ünür Dec 6 '10 at 19:18
@Sinan - thats a key piece of info that i was lacking. i have use DBI; and DBI->connect('DBI:mysql:db','','',\%dbattr) so i thought the dbd was a different module altogether. thanks for clearing that up – CheeseConQueso Dec 7 '10 at 3:01
.... wait, it looks like it is a different module. i still dont get it. but i do see a DBD folder inside of the DBI one. – CheeseConQueso Dec 7 '10 at 3:04

AFAIK, recent versions of Strawberry come bundled with DBD::mysql.

In addition, Strawberry Perl provides ppm to install precompiled binary packages.

-
Yes, StrawberryPerl comes bundled with drivers for MySQL, PostgreSQL and ODBC. Simply installing StrawberryPerl is enough. – MichielB Dec 6 '10 at 11:47
Actually it's not really recommended to use 'ppm' on Strawberry to install precompiled binaries, simply compile them yourself using cpan or cpanm and the bundled build tools. – MichielB Dec 6 '10 at 11:48

I wanted to install bugzilla on my local windows 7 machine and had a similar issue with mysql.

Although the automatic update mechanism of strawberry perl worked great and installed all missing packages, it seems that, as of a certain strawberry perl version (I used 5.16.1.1), the mysql driver has a problem.

I would get an error saying:

install_driver(mysql) failed: Can't load 'C:/Perl/site/lib/auto/DBD/mysql/mysql.dll' for module DBD::mysql: load_file:The specified module could not be found at C:/Perl/lib/DynaLoader.pm line 230. at (eval 34) line 3 Compilation failed in require at (eval 34) line 3.

But the required file was there, so after a lot of searching on the web, I found a solution in the comments section of an article (http://lpsolit.wordpress.com/2010/05/15/installing-dbdmysql-what-a-pain/):

"For the record, and thanks to glob, the way to fix the problem with Strawberry Perl is to copy C:\strawberry\c\bin\libmysql_.dll to C:\strawberry\perl\vendor\lib\auto\DBD\mysql\libmysql_.dll. Yay!"

It works !

I hope this helps other people who have the same issue.

-
thanks that helped! I had checked the directory and seen a DLL in there but had no idea that the 2nd DLL needed to copied there too. As soon as I'd done it Bugzilla worked! – paul May 6 at 12:03

If you're looking for a "just works" solution you could try ActivePerl, where you can install DBD::mysql as a precompiled binary via ppm.

-

There's also DWIM Perl which contains many popular additional modules such as Moose, Dancer, Perl Critic, Perl Tidy, and even the Perl IDE - Padre.

It seems that using one of these installations is the easiest method - as you still get the benefits of having a working cpan and compiling most of your modules yourself for your perl. Last time I used activestate's perl + cpan I remember after installing some modules via cpan a bunch of stuff stopped working so I gave up on it. Installing all packages via ppm, or using their terrible ppm GUI manager, did not mesh well with me as regardless of the system I'm on I instinctively use cpanm and would like to have all my modules compiled/installed the Perl way.

-


text:
Using world coordinates instead of pixels

I've been told that having a set pixels-per-world unit number is bad practice because it will not look the same at different resolutions. Because of this, I am trying to learn about using abstract world-space coordinates instead, however I am having some trouble understanding.

I've setup a quick test project for learning this: http://pastebin.com/GiUiR2NS As I understand it, CAM_WIDTH and CAM_HEIGHT should be the dimensions of the world in world units. However, I must be missing something because the end result seems to have made the world 50 pixels by 30 pixels. (My "wall" texture drawn at (0,0) in the bottom left is 16x16 pixels)

I am trying to achieve a view with which I can see 50 walls on the x-axis and 30 on the y-axis. I was able to do this when using direct pixel coordinates and multiplying by 16 (the pixels-per-world-unit number), however as stated before, I don't think I want to use this method anymore because of negative affects at different resolutions.

• I dont understand what is your question? – Vahe Muradyan Jun 27 '15 at 6:15

You need to specify the width and height when you draw the texture.

batch.draw(texture, x, y, width, height);

In your case you want to set the width and height to one since one wall tile is one world unit big. Because you don't specify a width and height the batch uses the width and height of the texture. That is why it covers 16 world units instead of one.


text:
## Chemistry: Principles and Practice (3rd Edition)

Published by Cengage Learning

# Chapter 2 - Atoms, Molecules, and Ions - Questions and Exercises - Exercises - Page 83: 2.37

#### Answer

(a) $^{16}_{8}$O$^{2-}$ (b) $^{79}_{34}$Se$^{2-}$ (c) $^{59}_{28}$Ni$^{2+}$

#### Work Step by Step

(a) The element with 8 protons in the nucleus, which means the atomic number is 8, is oxygen, chemical symbol O. The superscript to the left of the chemical symbol would be the mass number, which is the total number of protons and neutrons in the nucleus of that atom. We add the number of protons, 8, to the number of neutrons, 8, to get a mass number of 16. The left subscript is the atomic number, which is 8. The superscript to the right of the chemical symbol is the charge of the ion. We figure this out by adding up the negative and positive charges to get a net charge. There are 8 protons, each with a single positive charge for a total charge of +8. The number of electrons is 10, each with a single negative charge for a total charge of -10. We add +8 to -10 to get a net charge of -2. The symbol for this ion would be $^{16}_{8}$O$^{2-}$. (b) The element with 34 protons in the nucleus, which means the atomic number is 34, is selenium, chemical symbol Se. The superscript to the left of the chemical symbol would be the mass number, which is the total number of protons and neutrons in the nucleus of that atom. We add the number of protons, 34, to the number of neutrons, 45, to get a mass number of 79. The left subscript is the atomic number, which is 34. The superscript to the right of the chemical symbol is the charge of the ion. We figure this out by adding up the negative and positive charges to get a net charge. There are 34 protons, each with a single positive charge for a total charge of +34. The number of electrons is 36, each with a single negative charge for a total charge of -36. We add +34 to -36 to get a net charge of -2. The symbol for this ion would be $^{79}_{34}$Se$^{2-}$. (c) The element with 28 protons in the nucleus, which means the atomic number is 28, is nickel, chemical symbol Ni. The superscript to the left of the chemical symbol would be the mass number, which is the total number of protons and neutrons in the nucleus of that atom. We add the number of protons, 28, to the number of neutrons, 31, to get a mass number of 59. The left subscript is the atomic number, which is 28. The superscript to the right of the chemical symbol is the charge of the ion. We figure this out by adding up the negative and positive charges to get a net charge. There are 28 protons, each with a single positive charge for a total charge of +28. The number of electrons is 26, each with a single negative charge for a total charge of -26. We add +28 to -26 to get a net charge of +2. The symbol for this ion would be $^{59}_{28}$Ni$^{2+}$.

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:
## Variance of an estimate for the second moment

Suppose there are $u$ urns, numbered from $1$ up to $u$ containing in total $b$ balls, numbered from $1$ up to $b$. Let $p_i$ be the proportion of balls in $i$. Let $s$ be the probability that if we pick two numbers in $\{1,\ldots,b\}$ uniformly at random, then the balls with these numbers lie in the same urn. Clearly $s = \sum_{i=1}^u p_i^2$.

The honest way to estimate $s$ follows the definition by repeatedly picking pairs $(b,b')$ of balls, and counting the number of ‘hits’ where $b$ and $b'$ are in the same urn. For example, suppose that each urn contains equally many balls, so $p_i = 1/u$ for each $i$. Then our estimate for $s = 1/u$ after $N$ samples is $H/N$, where the number of hits $H$ has distribution $\mathrm{Bin}(N,1/u)$. As expected, $\mathbb{E}[H/N] = 1/u = s$.

An alternative is to choose $N$ ball numbers uniformly at random, and for each ball, note down its urn number. For each $i \in \{1,\ldots, u\}$, let $B_i$ be the random variable counting the number of balls lying in urn $i$. We then estimate $s$ by the statistic

$S = \sum_{i=1}^u \bigl( \frac{B_i}{N} \bigr)^2$.

By the well known formula

$\mathrm{Var} X = \mathbb{E}[(X -\mathbb{E}X)^2] = \mathbb{E}[X^2] - \mathbb{E}[X]^2,$

we get

\begin{aligned} \mathbb{E}[S] &= \frac{1}{N^2} \mathbb{E}\bigl[ \sum_{i=1}^u (B_i-\mathbb{E}[B_i])^2\bigr] + \sum_{i=1}^u \mathbb{E}[B_i]^2) \\ &= \frac{1}{N^2} \sum_{i=1}^u \mathbb{E}[(B_i - \mathbb{E}[B_i])^2] + s\\ &= \frac{1}{N^2} \sum_{i=1}^u \mathrm{Var} B_i + s. \end{aligned}

Thus $S$ is a biased estimator for $s$. Since $B_i$ has distribution $\mathrm{Bin}(N, p_i)$, we have $\mathrm{Var}(B_i) = Np_i(1-p_i)$ and so

$\mathbb{E}[S] = p + \frac{1}{N^2} \sum_{i=1}^U Np_i(1-p_i) = s + \frac{1}{N} - \frac{s}{N}.$

Since $s$ is small compared to $1$, a good correction for the systematic error can be made by subtracting $1/N$. All the same, it might well seem sampling by pairs is the simplest and best approach. But this ignores the variability in our estimates.

Again consider the case where $p_i = 1/u$ for each $i$. Then, as already seen, $H$ has distribution $\mathrm{Bin}(N,1/u)$ and so $\mathrm{Var}[H/N] = \mathrm{Var}[H]/N^2 = N(1/u)(1-1/u)/N^2 \approx 1/Nu$. The standard deviation in $H/N$ is therefore $1/\sqrt{Nu}$. In particular, to improve the accuracy of our estimate by a factor $f$, we must increase the number of samples by $f^2$.

For $S$, we extend the ‘orthogonality trick’ used earlier to express $\mathbb{E}[S]$ in terms of the variances of the $B_i$, to get

\begin{aligned} S &= \sum_{i=1}^u \frac{B_i^2}{N^2} \\ &= \sum_{i=1}^u \Bigl( \bigl( \frac{B_i}{N} - \frac{1}{u} \bigr)^2 + \frac{2B_i}{Nu} - \frac{1}{u^2} \Bigr) \\ &= \sum_{i=1}^u \bigl( \frac{B_i}{N} - \frac{1}{u} \bigr)^2 + \frac{2}{u} - \frac{1}{u} \\ &= \sum_{i=1}^u \bigl( \frac{B_i}{N} - \frac{1}{u} \bigr)^2 - \frac{1}{u} \end{aligned}
where the penultimate line uses $\sum_{i=1}^u B_i = N$.

By the Central Limit Theorem, $\sqrt{uN}\bigl( \frac{B_i}{N} - \frac{1}{u} \bigr)$ is approximately normally distributed with mean $0$ and variance $uN \mathrm{Var}[B_i/N] \approx 1$. While the $B_i$ are not independent, it still seems reasonable to approximate

$\hat{S} = uN \sum_{i=1}^u \bigl( \frac{B_i}{N} - \frac{1}{u} \bigr)^2$

as the sum of the squares of $u$ standard normal variables, i.e. as the $\chi^2$ distribution with $u$ degrees of freedom. This distribution has variance $2u$, so we have $\mathrm{Var}[\hat{S}] \approx 2u$. Undoing the scaling we get

$\mathrm{Var}[S] \approx \frac{2u}{u^2N^2} = \frac{2}{uN^2}$.

The standard deviation in $S$ is then $\frac{1}{N} \sqrt{\frac{2}{u}}$. Therefore increasing number of samples by a factor of $f$ reduces the standard deviation by the same factor. Moreover, we use fewer samples: $N$ rather than $2N$.

### Simulations

Data from simulation suggest these approximations work well in practice. For instance, with $u = 100$ urns and $N = 1000$ samples, the mean of $H/N$ over $1000$ repetitions of the sampling experiment was $0.01014$, with standard deviation $3.1354 \times 10^{-3}$; the mean of $S/N$ was $0.01099 \approx 1/u + 1/N$, with standard deviation $1.4101 \times 10^{-4}$. Increasing the number of samples to $10000$ reduced the standard deviations for $H/N$ and $S/N$ to $1.0114 \times 10^{-3}$ and $1.4176 \times 10^{-5}$, respectively, agreeing with the prediction above. For more skewed distributions of balls into urns the standard deviation of $S/N$ is still far less than for $H/N$, but the improvement on increasing the number of samples is less dramatic.


text:
## Problem sets

The qss.student package contains the questions and data sets from the problem sets in

K. Imai (2017) ‘Quantitative Social Science: An Introduction’, Princeton University Press

plus a few extra problem sets not in the book.

## Unpacking a problem set

Imagine you are assigned a problem set from the book called bias-in-turnout. To complete the problem set make sure you have the package loaded

library(qss.student)

and unpack the problem set into your current working directory

get_pset("bias-in-turnout")

The current working directory should now look like this:

- bias-in-turnout
↳ bias-in-turnout.pdf
↳ bias-in-turnout.Rmd
↳ bias-in-turnout.tex
↳ data
↳ turnout.csv

that is, a folder called bias-in-turnout and inside it

• bias-in-turnout.pdf: a short description of the problem and the data
• bias-in-turnout.Rmd: the source file for the problem set
• data another folder containing all the data needed to complete the problem set
• data/turnout.csv: the data set

As get_pset messages suggest, let’s make the problem set folder our working directory

setwd("bias-in-turnout")

and open up the Rmd file so we can start filling in the answers to each question

file.edit("bias-in-turnout.Rmd")

If you’re in RStudio the file should now be editor tab.

Each question has a header that looks like

## Question 1

To provide an answer to this question, move your cursor to just above the line that says ## Question 2 and start answering the question. When you need to compute something in R, start a ‘code block’. Here’s a bit of text you might write followed by a code block that loads the data set we need and counts the number of observations in it:

We load the data set and count the rows
{r}
nrow(turnout)

You can have as much text and as many code blocks as you like. (The variables you make in one code block are still there in the next one.)

You can either type the beginning and end lines of the code block or you can press the green Insert button in the Editor pane’s button menu, choose ‘R’, and have it done for you. Just don’t forget to put the code inside the backticks and don’t nest code blocks inside one another or everything will get confused.

## Compiling the problem set

Yo can see what your answers look like at any point by pressing the ‘Knit’ button. This will try to run all your code, read all your answers and knit the two together into a document. What kind of a document is controllable from that button. If you chose ‘Knit to HTML’ (the default) your document will be called ‘bias-in-turnout.html’. If you chose ‘Knit to PDF’ or ‘Knit to Word’ it will have a different suffix.

You can compile whenever you like. Somee people like to work in the Rmd file all the time and Knit intermittently to check their code works. Others, particularly when starting off, prefer to do their thinking and coding in a different document and then paste their working code and answers into the Rmd file at the last minute. Whatever works for you.

## Getting into (and out of) trouble

Sometimes you might feel it’s best to start again with a fresh copy of the problem set. However, if you

get_pset("bias-in-turnout")

then you’ll get a new problem set inside the one you’re abandoning. This makes things quite confusing. It’s better to go to top level of your files and grab a new copy, calling it something else. You can move your working directory up a level with

setwd("..")

In the language of file paths .. means go up into the parent folder i.e. up one level. (In case you’re curious, . indicates the current folder, and if you wanted to go up two levels then ../.. would be what you wanted)

Now you’re back to where you unpacked bias-in-turnout. To grab a fresh copy with another name:

get_pset("bias-in-turnout", newname = "bias-in-turnout-the-sequel")

(You may have a better idea for a name.) Now you can do it all again, only better.

## All the other problem sets

If you’re curious about the other problem sets you can get a list of their names with

list_psets()
#>  [1] "betting-markets"             "betting-markets-with-lm"
#>  [3] "bias-in-turnout"             "bias-newspapers"
#>  [5] "conditional-cash-transfers"  "constitutions"
#>  [7] "criminal-record"             "election-clinton-trump"
#>  [9] "election-US2016"             "empathy-in-courts"
#> [11] "ethnic-voting"               "exclusionary-attitudes"
#> [13] "fox-news-effect"             "gay-marriage"
#> [15] "gay-marriage-revisited"      "gov-corruption"
#> [17] "gov-transfer-brazil"         "health-savings"
#> [19] "ideology-of-justices"        "immigration-threat"
#> [25] "migration-mechanism"         "music-markets"
#> [27] "oil-democracy"               "partner-violence"
#> [29] "political-efficacy"          "population-dynamics"
#> [31] "poverty-decision"            "reducing-transphobia"
#> [33] "small-class-size"            "supreme-court-citations"
#> [35] "trade-networks"              "un-voting"

and you can take a peek at one of them (constitutions) without unpacking any files using

preview_pset("constitutions")


text:
0
Research Papers

# Dynamic Behavior of Flexible Multiple Links Captured Inside a Closed Space

[+] Author and Article Information
A. M. Shafei

Department of Mechanical Engineering,
Shahid Bahonar University of Kerman,
Kerman 76188-68366, Iran
e-mail: shafei@uk.ac.ir

H. R. Shafei

Department of Mechanical Engineering,
Shahid Bahonar University of Kerman,
Kerman 76188-68366, Iran

Contributed by the Design Engineering Division of ASME for publication in the JOURNAL OF COMPUTATIONAL AND NONLINEAR DYNAMICS. Manuscript received October 1, 2015; final manuscript received December 12, 2015; published online February 25, 2016. Assoc. Editor: Ahmet S. Yigit.

J. Comput. Nonlinear Dynam 11(5), 051016 (Feb 25, 2016) (13 pages) Paper No: CND-15-1320; doi: 10.1115/1.4032388 History: Received October 01, 2015; Revised December 12, 2015

## Abstract

This work presents a systematic method for the dynamic modeling of flexible multiple links that are confined within a closed environment. The behavior of such a system can be completely formulated by two different mathematical models. Highly coupled differential equations are employed to model the confined multilink system when it has no impact with the surrounding walls; and algebraic equations are exploited whenever this open kinematic chain system collides with the confining surfaces. Here, to avoid using the 4 × 4 transformation matrices, which suffers from high computational complexities for deriving the governing equations of flexible multiple links, 3 × 3 rotational matrices based on the recursive Gibbs-Appell formulation has been utilized. In fact, the main aspect of this paper is the automatic approach, which is used to switch from the differential equations to the algebraic equations when this multilink chain collides with the surrounding walls. In this study, the flexible links are modeled according to the Euler–Bernoulli beam theory (EBBT) and the assumed mode method. Moreover, in deriving the motion equations, the manipulators are not limited to have only planar motions. In fact, for systematic modeling of the motion of a multiflexible-link system in 3D space, two imaginary links are added to the $n$ real links of a manipulator in order to model the spatial rotations of the system. Finally, two case studies are simulated to demonstrate the correctness of the proposed approach.

<>

## Figures

Fig. 1

An open kinematic chain of flexible links floating through the space

Fig. 2

Two imaginary links connected with n real links to model spatial motions

Fig. 3

Inertia matrix of the whole system in the flight phase

Fig. 4

Right hand side vector of governing equations for the flight phase

Fig. 5

A multiflexible-link chin in impact phase

Fig. 6

A two-flexible-link planar robotic manipulator confined within a square

Fig. 7

Angular positions of the joints

Fig. 8

Angular velocities of the joints

Fig. 9

Modal generalized coordinates of the links

Fig. 10

Modal generalized velocities of the links

Fig. 11

Positions of the joints in the refX1 direction

Fig. 12

Absolute velocities of the joints in the refX1 direction

Fig. 13

Positions of the joints in the refX2 direction

Fig. 14

Absolute velocities of the joints in the refX2 direction

Fig. 15

(a)(b) Configurations of the system at different times

Fig. 16

A single flying link confined inside a closed cube

Fig. 17

Angular positions of joints

Fig. 18

Angular velocities of the joints

Fig. 19

(a)–(b) Modal generalized coordinate and its derivative with respect to time

Fig. 20

(a)(c) Positions of the joints in refX1, refX2, and refX3 directions

Fig. 21

(a)(c) Absolute velocities of the joints in refX1, refX2, and refX3 directions

Fig. 22

Configurations of the system at impact moments

## Discussions

Some tools below are only available to our subscribers or users with an online account.

### Related Content

Customize your page view by dragging and repositioning the boxes below.

Related Journal Articles
Related Proceedings Articles
Related eBook Content
Topic Collections


text:
### Statistical Zero-Knowledge Arguments for NP from Any One-Way Function

Minh-Huyen Nguyen, Shien Jin Ong, and Salil Vadhan

##### Abstract

We show that every language in NP has a *statistical* zero-knowledge argument system under the (minimal) complexity assumption that one-way functions exist. In such protocols, even a computationally unbounded verifier cannot learn anything other than the fact that the assertion being proven is true, whereas a polynomial-time prover cannot convince the verifier to accept a false assertion except with negligible probability. This resolves an open question posed by Naor, Ostrovsky, Venkatesan, and Yung (CRYPTO 92, J. Cryptology 98). Departing from previous works on this problem, we do not construct standard statistically hiding commitments from any one-way function. Instead, we construct a relaxed variant of commitment schemes called "1-out-of-2-binding commitments," recently introduced by Nguyen and Vadhan (STOC 06).

Available format(s)
Category
Foundations
Publication info
Published elsewhere. Unknown where it was published
Keywords
one-way functionszero knowledgebit commitmentcomplexity theory
Contact author(s)
salil @ eecs harvard edu
History
Short URL
https://ia.cr/2006/185

CC BY

BibTeX

@misc{cryptoeprint:2006/185,
author = {Minh-Huyen Nguyen and Shien Jin Ong and Salil Vadhan},
title = {Statistical Zero-Knowledge Arguments for NP from Any One-Way Function},
howpublished = {Cryptology ePrint Archive, Paper 2006/185},
year = {2006},
note = {\url{https://eprint.iacr.org/2006/185}},
url = {https://eprint.iacr.org/2006/185}
}
`
Note: In order to protect the privacy of readers, eprint.iacr.org does not use cookies or embedded third party content.


text:
expanded notation
Method of writing numbers as the sum of powers of ten or as the sum of its units, tens, hundreds, ...

We're sorry, we were unable to process your request at this time

Step-by-step work + explanations
•    Step-by-step work
•    Detailed explanations
•    Access anywhere
Access the steps on both the Mathway website and mobile apps
$--.--/month$--.--/year (--%)


text:
# Question ff115

$52. #### Explanation: There are $4$persons in the Group. To purchase a ticket, one has to pay$7.25.
$\therefore \text{ cost of 4 tickets } = 4 \left(7.25\right) \ldots . \left(1\right)$
To purchase a drink & popcorn, one has to pay $5.75. $\therefore \text{ cost of the refreshment for 4 friends} = 4 \left(5.75\right) \ldots . \left(2\right)$Clearly, to get the total cost for the group of 4 friends, we have to add (1) & (2), i.e., $\text{The total cost=} 4 \left(7.25\right) + 4 \left(5.75\right) \ldots \ldots \ldots \left(\star\right)$Now, here comes the Maths. to save your labour! A Well-known Property of Numbers, called "The Distributive Property" says that, $a \left(b + c\right) = a \cdot b + a \cdot c ,$or, taking the other way round, $a \cdot b + a \cdot c = a \left(b + c\right)$Observe that, to get the total cost from $\left(\star\right)$, we have to perform multiplication twice, but, by the Distributive Property as shown in the last eqn., we have to multiply only once. $\text{So, the total cost=} 4 \left(7.25\right) + 4 \left(5.75\right) = 4 \left(7.25 + 5.75\right) = 4 \left(13.00\right)$, "i.e.,"=$52#.