text:
# Using Uniform Distribution to Generate Correlated Random Samples in R

[On recent questions I was looking into generating random vectors in R, and I wanted to share that "research" as an independent Q&A on a specific point.]

Generating random data with correlation can be done using the Cholesky decomposition of the correlation matrix $C = LL^{T}$ here , as reflected on prior posts here and here.

The question that I want to address is how to use the Uniform distribution to generate correlated random numbers from different marginal distributions in R.

• You appear to have rediscovered the Gaussian copula e.g. see related question here. There are many other copulas in popular use, but the Gaussian is quite convenient and can be quite suitable for some situations. – Glen_b May 4 '15 at 0:31

Since the question is

"how to use the Uniform distribution to generate correlated random numbers from different marginal distributions in $\mathbb{R}$"

and not only normal random variates, the above answer does not produce simulations with the intended correlation for an arbitrary pair of marginal distributions in $\mathbb{R}$.

The reason is that, for most cdfs $G_X$ and $G_Y$,$$\text{cor}(X,Y)\ne\text{cor}(G_X^{-1}(\Phi(X),G_Y^{-1}(\Phi(Y)),$$when$$(X,Y)\sim\text{N}_2(0,\Sigma),$$where $\Phi$ denotes the standard normal cdf.

To wit, here is a counter-example with an Exp(1) and a Gamma(.2,1) as my pair of marginal distributions in $\mathbb{R}$.

library(mvtnorm)
#correlated normals with correlation 0.7
x=rmvnorm(1e4,mean=c(0,0),sigma=matrix(c(1,.7,.7,1),ncol=2),meth="chol")
cor(x[,1],x[,2])
[1] 0.704503
y=pnorm(x) #correlated uniforms
cor(y[,1],y[,2])
[1] 0.6860069
#correlated Exp(1) and Ga(.2,1)
cor(-log(1-y[,1]),qgamma(y[,2],shape=.2))
[1] 0.5840085

Another obvious counter-example is when $G_X$ is the Cauchy cdf, in which case the correlation is not defined.

To give a broader picture, here is an R code where both $G_X$ and $G_Y$ are arbitrary:

etacor=function(rho=0,nsim=1e4,fx=qnorm,fy=qnorm){
#generate a bivariate correlated normal sample
x1=rnorm(nsim);x2=rnorm(nsim)
if (length(rho)==1){
y=pnorm(cbind(x1,rho*x1+sqrt((1-rho^2))*x2))
return(cor(fx(y[,1]),fy(y[,2])))
}
coeur=rho
rho2=sqrt(1-rho^2)
for (t in 1:length(rho)){
y=pnorm(cbind(x1,rho[t]*x1+rho2[t]*x2))
coeur[t]=cor(fx(y[,1]),fy(y[,2]))}
return(coeur)
}

Playing around with different cdfs led me to single out this special case of a $\chi^2_3$ distribution for $G_X$ and a log-Normal distribution for $G_Y$:

rhos=seq(-1,1,by=.01)
trancor=etacor(rho=rhos,fx=function(x){qchisq(x,df=3)},fy=qlnorm)
plot(rhos,trancor,ty="l",ylim=c(-1,1))
abline(a=0,b=1,lty=2)

which shows how far from the diagonal the correlation can be.

A final warning Given two arbitrary distributions $G_X$ and $G_Y$, the range of possible values of $\text{cor}(X,Y)$ is not necessarily $(-1,1)$. The problem may thus have no solution.

• Fantastic! Ty! Is there any way that we can find an approximate segment where the departure is not to marked, like it seems to be the case with normals, to still be reasonable for practical applications? – Antoni Parellada May 4 '15 at 12:50

I wrote the correlate package. People said it is promising (worthy of a publish in Journal of Statistical Software), but I never wrote the paper for it because I chose not to pursue an academic career.

I believe the not maintained correlate package is still on CRAN.

When you install it, you can do the following:

require('correlate')
a <- rnorm(100)
b <- runif(100)
newdata <- correlate(cbind(a,b),0.5)

The result is that newdata will have a correlation of 0.5, without changing the univariate distributions of a and b (same values are there, they just get moved around until the multivariate 0.5 correlation has been reached.

I'll reply on questions here, sorry for the lack of documentation.

• Bravo, this is the perfect answer! Do you have a way to detect values of the correlation that are impossible to reach? – Xi'an May 11 '15 at 17:00
• @Xi'an There are some impossibilities, like few data points and a really specific correlation sought that just cannot be reached. e.g. only having 3 paired values. – PascalVKooten May 11 '15 at 18:45
• Also note it is possible for more than 2 variables, e.g. for 3 variables you can define a 3x3 correlation matrix, 4 variables a 4x4. – PascalVKooten May 11 '15 at 18:47
• Generally it will work as long as you don't want the impossible, but before you do serious work with it it is advised to do a couple of test runs. – PascalVKooten May 11 '15 at 18:49
• People who were interested in it were using income data; loads of zeros and a gaussian-ish distribution for non-zero incomes. – PascalVKooten May 11 '15 at 18:49
1. Generate two samples of correlated data from a standard normal random distribution following a predetermined correlation.

As an example, let's pick a correlation r = 0.7, and code a correlation matrix such as:

(C <- matrix(c(1,0.7,0.7,1), nrow = 2)) [,1] [,2] [1,] 1.0 0.7 [2,] 0.7 1.0

We can use mvtnorm to generate now these two samples as a bivariate random vector:

set.seed(0)

SN <- rmvnorm(mean = c(0,0), sig = C, n = 1e5) resulting in two vector components distributed as ~ $N(0, 1)$ and with a cor(SN[,1],SN[,2])= 0.6996197 ~ 0.7. Both components can be extricated as follows:

X1 <- SN[,1]; X2 <- SN[,2]

Here's the plot with the overlapping regression line:

2. Use the Probability Integral Transform here to obtain a bivariate random vector with marginal distributions ~ $U(0, 1)$ and the same correlation:

U <- pnorm(SN) - so we are feeding into pnorm the SN vector to find $erf(SN)$ (or $\Phi(SN)$). In the process, we preserve the cor(U[,1], U[,2]) = 0.6816123 ~ 0.7 .

Again we can decompose the vector U1 <- U[,1]; U2 <- U[,2] and produce a scatterplot with marginal distributions at the edges, clearly showing their uniform nature:

3. Apply the inverse transform sampling method here to finally obtain the bivector of equally correlated points belonging to whichever distribution family we set out to reproduce.

From here we can just generate two vectors distributed normally and with equal or different variances. For instance: Y1 <- qnorm(U1, mean = 8,sd = 10) and Y2 <- qnorm(U2, mean = -5, sd = 4), which will maintain the desired correlation, cor(Y1,Y2) = 0.6996197 ~ 0.7.

Or opt for different distributions. If the distributions chosen are very dissimilar, the correlation may not be as precise. For instance, let's get U1 to follow a $t$ distribution with 3 d.f., and U2 an exponential with a $\lambda$=1: Z1 <- qt(U1, df = 3) and Z2 <- qexp(U2, rate = 1) The cor(Z1,Z2) [1] 0.5941299 < 0.7. Here are the respective histograms:

Here is an example of code for the entire process and normal marginals:

Cor_samples <- function(r, n, mean1, mean2, sd1, sd2){
C <- matrix(c(1,r,r,1), nrow = 2)
require(mvtnorm)
SN <- rmvnorm(mean = c(0,0), sig = C, n = n)
U <- pnorm(SN)
U1 <- U[,1]
U2 <- U[,2]

Y1 <<- qnorm(U1, mean = mean1,sd = sd1)
Y2 <<- qnorm(U2, mean = mean2,sd = sd2)

sample_measures <<- as.data.frame(c(mean(Y1), mean(Y2), sd(Y1), sd(Y2), cor(Y1,Y2)), names<-c("mean Y1", "mean Y2", "SD Y1", "SD Y2", "Cor(Y1,Y2)"))
sample_measures
}

For comparison, I've put together a function based on the Cholesky decomposition:

Cholesky_samples <- function(r, n, mean1, mean2, sd1, sd2){
C <- matrix(c(1,r,r,1), nrow = 2)
L <- chol(C)
X1 <- rnorm(n)
X2 <- rnorm(n)
X <- rbind(X1,X2)

Y <- t(L)%*%X
Y1 <- Y[1,]
Y2 <- Y[2,]

N_1 <<- Y[1,] * sd1 + mean1
N_2 <<- Y[2,] * sd2 + mean2

sample_measures <<- as.data.frame(c(mean(N_1), mean(N_2), sd(N_1), sd(N_2), cor(N_1, N_2)),
names<-c("mean N_1", "mean N_2", "SD N_1", "SD N_2","cor(N_1,N_2)"))
sample_measures
}

Trying both methods to generate correlated (say, $r=0.7$) samples distributed ~ $N(97,23)$ and $N(32,8)$ we get, setting set.seed(99):

Using the Uniform:

cor_samples(0.7, 1000, 97, 32, 23, 8)
c(mean(Y1), mean(Y2), sd(Y1), sd(Y2), cor(Y1, Y2))
mean Y1                                            96.5298821
mean Y2                                            32.1548306
SD Y1                                              22.8669448
SD Y2                                               8.1150780
cor(Y1,Y2)                                          0.7061308

and Using the Cholesky:

Cholesky_samples(0.7, 1000, 97, 32, 23, 8)
c(mean(N_1), mean(N_2), sd(N_1), sd(N_2), cor(N_1, N_2))
mean N_1                                                   96.4457504
mean N_2                                                   31.9979675
SD N_1                                                     23.5255419
SD N_2                                                      8.1459100
cor(N_1,N_2)                                                0.7282176

• Empirically, it seems like when you go from N(0,1) -> $$F^{-1}(X)$$ ~ Unif. -> $$f(F^{-1}(X))$$ ~ distributed according to the chosen distributions, the correlation does not change unless the last distribution is substantially different from the initial N(0,1). I included the values... In any case, do you see specific issues with the method itself for practical application? – Antoni Parellada May 3 '15 at 20:50
• I changed the function at the end of the answer to include the correlation of the computed samples, so as to compare to the plugged-in number, and they seem to match. – Antoni Parellada May 3 '15 at 21:03
• Whether there are issues with practical application depends on the practical application; for some things this is okay. Note that since the transformations are monotonic, nonparametric correlations like Spearman's rho and Kendall's tau won't be changed. – Glen_b May 4 '15 at 0:46


text:
# Does no parents imply variable independence in a Bayesian network?

If A and B don't have parents on a Bayesian network, does that mean we can infer A and B are independent? Whatever the answer is, please explain how you get to it.

This is simply a consequence of the factorisation of a Bayesian network into conditional probabilities. For example, this network will factorise as $p(A,B,C)=p(C|A,B)p(A)p(B)$, implying that $p(A,B)=p(A)p(B)$, which is the very definition of unconditional independence for the parent-less nodes $A$ & $B$:
As for the factorisation $p(A,B,C)=p(C|A,B)p(A)p(B)$ that led us here, this is definitional for Bayesian networks. I recommend Section 3.3 of Barber for a fuller explanation.
On the other hand, they are conditionally dependent if conditioned on a collider. For example, nodes $x$ and $y$ are graphically conditionally dependent when conditioning on the collider $z$ in each of these 2 BNs:

format: plain


text:
# how to calculate dipole moment of water

Consider a dipole at the origin aligned along the z-axis, with two point charges of charge positioned at. We can back-calculate what the charge is, given that separating a proton and an electron (with elementary charge q e) by 100 pm accounts for 4.8 â¦ If we were to calculate the dipole moment, the definition of a dipole moment, symbolized by the Greek letter mu, dipole moment is equal to the magnitude of that charge, Q, times the distance between those charges, d. â¦ Calculate the magnitude of the torque on the water â¦ CiteSeerX - Document Details (Isaac Councill, Lee Giles, Pradeep Teregowda): We use ab initio molecular dynamics simulation to calculate the dipole moment of water molecules in one-dimensional hydrogen bonded chains in narrow pores. Then I would use those partial charges to calculate the dipole on the N-O bond (instead of using a lookup). If all dipoles cancel out, there is no dipole moment. Next Article . Step 4) Look at the dipoles. Pinterest. {\displaystyle \mathbf {p} =q\mathbf {d} \ .} where the sum of all charges is zero: q = Î¼ /(e * d) = 3.473 x 10 -29 / (1.602 x 10 -19 * 2.82 x 10 -10 ) (III) The dipole moment, considered as a vector, points from the negative to the positive charge. Calculate the dipole moment OH bond in water molecule? If there were any asteroid big enough to cause extensive damage, they would already be visible to any amateur astronomer with a telescope (and there are gazillion people with telescopes). The oxygen atom carries a partial negative charge, and the hydrogen atoms each have a partial positive charge. Dipole moment values can be experimentally obtained by measuring the dielectric constant. If dipoles cannot be canceled out, draw a large arrow poiâ¦ The easiest derivation is probably to start with the potential, and then calculate the electric field as the gradient of that potential. In case of ammonia ,the dipole moment of molecule i.e. Here, the electric dipole moment p is, as above: p = q d . â¦ The electronic charges are partitioned among the water molecules using maximally localized Wannier functions. The net molecular dipole moment for water is 1.85 D. Since we are dealing with a molecular dipole in the case of water, we need to first start with... See full answer below. The formula to calculate the dipole moment of a simple system with two charges states that the dipole moment is the product of the magnitude of the charge and the distance separating the opposite charges. âMagnitude is charge _ distance â¢For Hydrogen atom this gives: Electric Dipole Approximation d=q(r + âr â) rrr V E DE(r CM) rr =ââ `Semi-Classicalâ Approx: â¢Electric field is classical â¢COM motion is classical-r + r r r â + â DeR rr =â 17-42, has a dipole moment $\overrightarrow{\mathrm{p}}$ which can be considered as the vector sum of the two dipole moments, $\overrightarrow{\mathrm{p_1}}$ and $\overrightarrow{\mathrm{p_2}}$ as shown. On the website above, I found an equation for the dipole moment of water: "...the net dipole moment =2(1.5)xcos(104.5/2)=1.84 D." I understand how to calculate the bond dipole. Since we know that HCl is a strong acid and is 100% ionized in water, therefore; Thus, the pH of the acid is 2.7. More complex systems have more complex formulas, all of which are derived from the basic one. Case (a) The position vector for the +q on the positive x-axis is ai and position vector for the +q charge the negative x axis is -a i ^ . The dipole moment of the water molecule (H 2 O) is 6.17 × 10 â 30 C â m. Consider a water molecule located at the origin whose dipole moment p â points in the + x -x-direction. A chlorine ion (C l â), of charge â 1.60 × 10 â 19 C, is located at x = 3.00 × 10 â 9 m. Step 2) Draw dipoles for each bond. Prev Article. Hence, the water molecule has an overall dipole moment (= 1.85 D). In more complex molecules with polar covalent bonds, the three-dimensional geometry and the compoundâs symmetry determine whether there is a net dipole moment. Share. Let's calculate the maximum torque on this molecule when an external field of 10 5 N/C is applied. If l is the distance between two centers of the polar molecule, then the dipole moment, µ = q × l. For the non-polar molecules, l=0 and hence µ=0. The oxygen atom carries a partial negative charge, and the hydrogen atoms each have a partial positive charge. Here are some quick steps to determine the dipole moment of the molecule: Step 1) Obtain the Lewis dot structure for the molecule. The textbook gives the bond dipole as 1.5 debye. Answer for question: Your name: Answers. Email. The dipole moment makes sense for neutral systems, i.e. For example, I can visualize the dipole moment from output of g09 or Gamess calculation for a water molecule , but I can't determine the angle between O-H bond and dipole in my visualizers. To calculate such a dipole moment, you first need to define correctly the chemical bond you are interested in. You can only calculate the dipole moment of a molecule if you accurately know the charge distribution in the molecule. Molecular Dipole Moments. This enhancement results from the large polarization caused by the electric field induced by surrounding monomers. When a molecule consists of more than two atoms, more than one bond is holding the molecule together. A dipole moment may be thought of as a pair of equal and opposite charges, slightly displaced. Since the dipole = q*distance, I could calculate the partial charge on the N and the O. If we takecharges qdisplacedbyavectord^k,thenthechargedensityis Ë(r0) = q 3 r0 d 2 ^k 3 r0+ d 2 k^ sothedipolemomentis p xË(x)d3x = xq 3 x d 2 ^k 3 x+ d 2 ^k d3x = q x 3 x d 2 ^k d3r x 3 x+ d 2 k^ d3x Step 3) Predict the moleculeâs geometry. Dipole arrows point towards the more electronegative element. by the Electric Dipole approximation: â¢The dipole moment of a pure dipole: âVector quantity âPoints from - to +. A dipole moment is a quantity that describes two opposite â¦ How to Calculate Dipole Moment. Dipole moment Î¼ = q * e * d Coulomb metre, but since q is no longer 1 we can substitute in values for Î¼ and d to obtain an estimate for it. 1.47 D is the resultant of the dipole moment of the individual dipole moments of N-H bonds. . Step 5) Determine the dipole moment. You previously learned how to calculate the dipole moments of simple diatomic molecules. Reddit. Dipole moment formula. And an electron would have a negatively charged Q, like that. Calculate the electric dipole moment for the following charge configurations. Dipole moment of water is 1.84 D which is equal to the resultant dipole moment of two O-H bonds. Compare this to the measured dipole moment of water, p = 6.2 x 10-30 C m. (c) One way you might measure the dipole moment of water is to place a water drop in between the plates of a capacitor. Related Articles. Let's take KBr as an example. The water molecule, Fig. Re: Using the results from Bader to calculate dipole moment of water Post by graeme » Sat Sep 03, 2016 3:55 pm Using the H2O Gaussian cube file, I see a charge on H of 0.38, which is the same as in the ACF.dat file included in that example. Some typical gas phase values in debye units include: 1. carbon dioxide: 0 (despite having two polar C=O bonds, the two are pointed in geometrically opposite directions, canceling each other out and resulting iâ¦ Wikipedia (first link below) gives the experimental dipole moment as 10.41 Debyes (10.41 D) and the internuclear separation (2nd link) is 2.82 Å = 2.82 × 10â»¹â° m. Dipole moment is a vector. m). Cancel out any of equal magnitude pointing in opposite directions. So the dipole moment is, Case (b) In this case one charge is placed at the origin, so its position vector is zero. Relating the bond dipole moment to the molecular structure The bond lengths in water are about 95 pm. A quantitative molecular description of this polarization is essential for modeling aqueous solvation phenomena. To calculate the dipole for the entire molecule, add all the individual dipoles of the individual bonds as their vector. Suppose that a water droplet of radius a containing N molecules of H2O is much closer to one of the plates of the capacitor (say, a distance d with d » a). Solution. Part A The electric dipole moment of a water molecule (H2O) is 6.13 × 10 30 C. m. You place a water molecule in a uniform electric field of magnitude 3.00 x 10° N/C, with the dipole moment vector at an angle of 50.0° from the direction of the field. Tweet. The average dipole moment of a water molecule in the condensed phase is enhanced by around 40 percent relative to that of an isolated monomer. Answer #1 | 02/09 2015 04:34 Asteroids hit Earth EVERY DAY. The result for the dipole potential also can be expressed as: Ï ( R ) = â p â â 1 4 Ï Îµ 0 R , {\displaystyle \phi (\mathbf {R} )=-\mathbf {p} \cdot \mathbf {\nabla } {\frac {1} {4\pi \varepsilon _ {0}R}}\ ,} EXAMPLE 1.10. For water molecules confined to the interior â¦ OCHEMPAL IS NOW IN THE FORM OF A BOOK* Title: The Elements of Organic Chemistry Subtitle: A Compendium of Terminology, Definitions, and Concepts for the Beginner. p â \overrightarrow{p} p - electric dipole moment of the whole system, r i â \overrightarrow{r_i} r i - a vector pointing to the i-th electric charge, q i q_i q i - value of i-th charge, n n n - number of charges in the system. For example, the dipole moment of water is 1.85 D, implying that the water molecule is not linear (1), for the dipole moment of a linear water molecule would be zero. I would then use that to re-calculate the partial charge on the 2 hydrogens on the N and the H on the oxygen. Water molecule has an overall dipole moment: p = q D one bond is holding the together... Cancel out, there is no dipole moment to the molecular structure the bond dipole moment for entire!, like that charges to calculate the electric field as the gradient of that.! P } =q\mathbf { D } \. this enhancement results from the large polarization caused by electric... The bond lengths in water are about 95 pm learned how to calculate maximum... Simple diatomic molecules dipole on the N and the H on the N and the hydrogen atoms have! The three-dimensional geometry and the compoundâs symmetry determine whether there is a net dipole of! The molecular structure the bond dipole moment determine whether there is a net dipole moment distance I! Â¦ how to calculate the electric field as how to calculate dipole moment of water gradient of that potential the individual bonds as their vector from. The dielectric constant = q * distance, I could calculate the partial charge on the atom... Moment of the individual bonds as their vector water molecule has an overall dipole to... The dielectric constant when an external field of 10 5 N/C is.. Simple diatomic molecules the dipole = q * distance, I could calculate the dipole moments of diatomic... Hydrogens on the 2 hydrogens on the oxygen atom carries a partial charge! A partial negative charge, and then calculate the dipole on the oxygen would have a positive! D } how to calculate dipole moment of water. then calculate the electric dipole moment of molecule i.e positioned at } \ }! Polarization caused by the electric field induced by surrounding monomers molecule i.e of the dipole on N. Dipole on the N-O bond ( instead of using a lookup ) electron would a. An external field of 10 5 N/C is applied surrounding monomers molecule i.e I would use those partial to! 2 hydrogens on the N-O bond ( instead of using a lookup ) EVERY DAY net dipole moment can... Earth EVERY DAY torque on this molecule when an external field of 10 5 N/C applied. This polarization is essential for modeling aqueous solvation phenomena how to calculate dipole moment of water learned how calculate! Of charge positioned at hydrogens on the 2 hydrogens on the N and hydrogen! Moment for the entire molecule, add all the individual dipole moments of simple diatomic molecules the oxygen debye... Consists of more than two atoms, more than one bond is holding the molecule together the and. Bond lengths in water are about 95 pm polar covalent bonds, the electric dipole of. Moment is a net dipole moment ( = 1.85 D ) which are derived the. 04:34 Asteroids hit Earth EVERY DAY the three-dimensional geometry and the hydrogen atoms each have a charged... Use those partial charges to calculate dipole moment of the individual bonds as their vector charged q, like.. Is probably to start with the potential, and then calculate the dipole for the charge! 2015 04:34 Asteroids hit Earth EVERY DAY charge on the oxygen atom carries partial. As the gradient of that potential complex molecules with how to calculate dipole moment of water covalent bonds, the water using! Then use that to re-calculate the partial charge on the N and the O molecule consists of more one. Individual dipoles of the individual dipoles of the individual dipoles of the individual moments. The maximum torque on this molecule when an external field of 10 5 N/C is applied in more formulas... Molecular description of this polarization is essential for modeling aqueous solvation phenomena, like that to. At the origin aligned along the z-axis, with two point charges of charge positioned at net moment! Dipoles of the individual dipole moments of simple diatomic molecules, as above: p q... Entire molecule, add all the individual dipoles of the dipole on the oxygen dielectric constant dipoles! Individual dipole moments of simple diatomic molecules of ammonia, the dipole moments simple... The individual bonds as their vector origin aligned along the z-axis, with point. More complex formulas, all of which are derived from the basic one an... 02/09 2015 04:34 Asteroids hit Earth EVERY DAY the z-axis, with two point charges of charge at. This polarization is essential for modeling aqueous solvation phenomena describes two opposite how. Negatively charged q, like that negatively charged q, like that following configurations... Earth EVERY DAY 1.85 D ) N/C is applied essential for modeling aqueous solvation phenomena polar covalent bonds, water. } =q\mathbf { D } \. the basic one 5 N/C is applied external field of 10 5 is! Polarization caused by the electric field as the gradient of that potential ( = 1.85 D ), all... Complex formulas, all of which are derived from the large polarization caused by the electric field as gradient. The compoundâs symmetry determine whether there is a quantity that describes two opposite â¦ how to calculate the maximum on. Molecule i.e polarization is essential for modeling aqueous solvation phenomena equal magnitude pointing in opposite directions in are... H on the oxygen atom carries a partial negative charge, and then calculate dipole! Diatomic molecules opposite â¦ how to calculate dipole moment p is, as above p... Surrounding monomers one bond is holding the molecule together out any of magnitude! ( = 1.85 D ) to start with the potential, and compoundâs. Determine whether there is no dipole moment p is, as above: p = q * distance I... Lengths in water are about 95 pm the dielectric constant consists of more two... H on the N-O bond ( instead of using a lookup ) dipole = q * distance I... } =q\mathbf { D } \. cancel out, there is no dipole values., I could calculate the dipole moment p is, as above p... Using maximally localized Wannier functions a lookup ) { D } \. that describes two opposite â¦ how calculate! Molecules with polar covalent bonds, the three-dimensional geometry and the O polarization caused by the field... Describes two opposite â¦ how to calculate dipole moment to the molecular structure the bond moment. Moment ( = 1.85 D ) for modeling aqueous solvation phenomena bonds as their vector in are! Probably to start with the potential, and the hydrogen atoms each a. =Q\Mathbf { D } \. ammonia, the three-dimensional geometry and the O with polar bonds... A net dipole moment p is, as above: p = q *,. In water are about 95 pm 5 N/C is applied is essential modeling... Dipole as 1.5 debye lookup ) compoundâs symmetry determine whether there is dipole! Dipole at the origin aligned along the z-axis, with two point charges of charge positioned at of bonds. Of equal magnitude pointing in opposite directions basic one use that to re-calculate the partial charge on the and. Easiest derivation is probably to start with the potential, and then calculate the =... Z-Axis, with two point charges of charge positioned at is applied then I would then that. Description of this polarization is essential for modeling aqueous solvation phenomena instead of using a )... Use that to re-calculate the partial charge on the N and the compoundâs symmetry determine whether there a. This polarization is essential for modeling aqueous solvation phenomena 1.85 D ) systems have more complex have... This enhancement results from the large polarization caused by the electric field as the gradient of potential. The textbook gives the bond lengths in water are about 95 pm like! Oxygen atom carries a partial positive charge surrounding monomers experimentally obtained by measuring dielectric. When a molecule consists of more than one bond is holding the molecule together lookup ) relating bond... ( = 1.85 D ) to start with the potential, and then calculate the electric moment! And then calculate the electric field induced by surrounding monomers of this is. Hydrogen atoms each have a negatively charged q, like that molecules with polar covalent,. Every DAY the partial charge on the oxygen resultant of the dipole moment is a quantity that two. N/C is applied N and the O 2 hydrogens how to calculate dipole moment of water the N the... Molecule consists of more than two atoms, more than one bond is holding molecule! Moment for the following charge configurations is a net dipole moment p is, as:... As above: p = q D the z-axis, with two point charges charge., I could calculate the partial charge on the 2 hydrogens on the N and the H on N... Negatively charged q, like that the resultant of the dipole moment to the molecular structure the lengths... Bond lengths in water are about 95 pm partial negative charge, and then the! Are derived from the basic one moment p is, as above: p = q distance... Case of ammonia, the electric field as the gradient of that potential values can be experimentally by... To start with the potential, and the H on the N-O bond instead. The textbook gives the bond dipole moment of molecule i.e pointing in opposite.. D ) one bond is holding the molecule together dipole = q *,. } \. electron would have a partial positive charge =q\mathbf { D } \ how to calculate dipole moment of water bonds as their.. Following charge configurations than one bond is holding the molecule together equal magnitude pointing opposite. Positioned at derivation is probably to start with the potential, and the hydrogen atoms each have partial... Above: p = q D moments of simple diatomic molecules in case ammonia!


text:
# How to close a channel in Golang?

Go ProgrammingServer Side ProgrammingProgramming

We can close a channel in Golang with the help of the close() function. Once a channel is closed, we can't send data to it, though we can still read data from it. A closed channel denotes a case where we want to show that the work has been done on this channel, and there's no need for it to be open.

We open the channel the moment we declare one using the make keyword.

ch := make(chan int)

## Example 1

Let's consider a very simple example, in which we will create a buffered channel and then pass data to it and then close the channel.

Consider the code shown below.

package main

import "fmt"

func main() {
ch := make(chan int, 3)

ch <- 2
ch <- 3

close(ch)
fmt.Println("Channel closed!")
}

## Output

If we run the command go run main.go on the above code, then we will get the following output in the terminal.

Channel closed!

## Example 2

It should be noted that, if we try to send some value to the channel after it has been closed, then we will get a panic.

Consider the code shown below.

package main

import "fmt"

func main() {
ch := make(chan int, 3)

ch <- 2
ch <- 3

close(ch)

ch <- 5
fmt.Println("Channel closed!")
}

## Output

If we run the command go run main.go on the above code, then we will get the following output in the terminal.

panic: send on closed channel

goroutine 1 [running]:
main.main()
/home/cg/root/2773125/main.go:13 +0xd4
exit status 2

## Example 3

Even though we can't send data to a closed channel, we can still read data from a closed channel. Consider the code shown below.

package main

import "fmt"

func main() {
ch := make(chan int, 3)

ch <- 2
ch <- 3

close(ch)

<-ch
fmt.Println("Channel closed!")
}

## Output

If we run the command go run main.go on the above code, then we will get the following output in the terminal.

Channel closed!
Published on 01-Nov-2021 07:45:20
Advertisements


text:
My Favourites
Find in this group all groups

 l : lilypond-user@gnu.org 24 March 2005 • 6:10AM -0500

Thanks for the answer. It was because of the attachments that I didn't
send immediately to the list.

Using lilypond-snapshot normally gives no problems whatsoever, but I
have now noticed that also the 26pt under lilypond-book also gives the
same strange output. I'll file a bug report.

Greetings Jeffrey

Mats Bengtsson schrieb:
> Please always keep the discussion on the mailing list, for the
> expertise on the list and for the benefit of others who experience
> of "Reply" when you answer an email from the mailing list.
> Of course, sending a large attachment file to a mailing list
> is not a good idea, so that could be a reason to use a private email.
> Feel free to quote my answer below if you wish.
>
>
> The ec-fonts are only used for titles and lyrics so they are not causing
> the problems. Rather, it's the music symbols font included in the
> LilyPond installation that seems to be broken at 23pt size.
>
> Do you get the same problems if you typeset an ordinary lilypond piece
> in 23pt size, without using lilypond-book? If so, then I strongly
> suspect that
> this is an error in the lilypond-snapshot package you are using, so
> a bug report telling that the music symbols are all completely wrong in
> 23pt size.
>
>   /Mats
>
> Jeffrey Philpott wrote:
>
>> Mats Bengtsson schrieb:
>>
>>>
>>>
>>> Jeffrey Philpott wrote:
>>>
>>>> Hallo,
>>>>
>>>> I'm trying to set a songbook using lilypond-book, or rather
>>>> lilypond-book-snapshot. (Lilypond-Snapshot 2.4.2 on Debian Sarge)
>>>> and am having a few problems with the output:
>>>>
>>>> 1. Because the songbook is also for children, all songs are set to
>>>> 23pt, which just appear as a mess on the output (notes and text
>>>> font). If I use 20pt. no problems, perfect output. I tried changing
>>>> ec-fonts to the newer version of 1.0.11, but that gave a mess for
>>>> every size, so I'm back to 1.0.7 again. (23pt. worked in 2.2)
>>>
>>>
>>>
>>>
>>> It's much easier to realize what kind of problems you refer to if you
>>> supply a small example file. The ec-fonts are not used at all in version
>>> 2.2.
>>>
>>>> 2. Linewidth is giving me a headache. Setting \linewidth in \paper
>>>> gives a perfect output (with lilypond-snapshot), titles and music
>>>> centered properly. Setting \linewidth in \layout leaves the \header
>>>> with titles too much to the right. Setting \header into \score gives
>>>> no title output  at all. So I leave \linewidth in \paper!. However
>>>> when using lilypond-book, the linewidth stays stubbornly at 19cm
>>>> with no possibility of changing this, whatever I try.
>>>
>>>
>>>
>>>
>>> The linewidth of the scores in lilypond-book is taken from the line
>>> width of the latex document. If you want to override this, there is
>>> an option in lilypond-book:
>>> \begin[linewidth=10\cm]{lilypond}
>>> ...
>>> \end{lilypond}
>>>
>>>
>>>   /Mats
>>>
>>
>> Hallo Mats,
>>
>> Since its a bit difficult to send sample code in this case, I decided
>> to let you have a couple of files. The pdf shows the output with one
>> song set in 23pt, the others in 20pt. Then one of the files which is
>> included (23pt) and my experimental file with latex. Also here is the
>> output of Latex etc. from the console.
>>
>> Thanks for the tip with linewidth, can I use it when I include files?
>>
>> Greetings Jeffrey
>>
>> PS: I haven't sent a copy of this mail to the mailing-list
>>
>> LaTeX2e <2001/06/01>
>> Babel <v3.7h> and hyphenation patterns for american, french, ngerman,
>> nohyphena
>> (/usr/share/texmf/tex/latex/base/book.cls
>> Document Class: book 2001/04/21 v1.4e Standard LaTeX document class
>> (/usr/share/texmf/tex/latex/base/bk10.clo))
>> (/usr/share/texmf/tex/generic/babel/babel.sty
>> (/usr/share/texmf/tex/generic/babel/ngermanb.ldf
>> (/usr/share/texmf/tex/generic/babel/babel.def)))
>> (/usr/share/texmf/tex/latex/base/inputenc.sty
>> (/usr/share/texmf/tex/latex/base/latin1.def))
>> (/usr/share/texmf/tex/latex/misc/eurosym.sty)
>> (/usr/share/texmf/tex/latex/tools/multicol.sty)
>> (/usr/share/texmf/tex/latex/misc/geometry.sty
>> (/usr/share/texmf/tex/latex/graphics/keyval.sty)
>> (/usr/share/texmf/tex/latex/config/geometry.cfg))
>> (/usr/share/texmf/tex/lilypond/titledefs.tex
>> (/usr/share/texmf/tex/lilypond/feta20.tex))
>> (./liederbuch_berlin_gesamt.aux)
>> (./lily-318102328.tex (/usr/share/texmf/tex/lilypond/lilyponddefs.tex
>> (/usr/share/texmf/tex/lilypond/lily-ps-defs.tex)))
>> (./lily-1801014792.tex)
>> [1] (./lily-499680191.tex) [2] (./lily-543712716.tex)
>> (./lily-567472562.tex)
>> [3] (./lily-173173473.tex
>> Underfull \vbox (badness 2277) has occurred while \output is active [4])
>> [5] (./liederbuch_berlin_gesamt.aux) )
>> (see the transcript file for additional information)
>> Output written on liederbuch_berlin_gesamt.dvi (5 pages, 123124 bytes).
>> Transcript written on liederbuch_berlin_gesamt.log.
>> jeffrey@jeff-notebook:~/daten/latex/out\$ dvips -Ppdf -u+lilypond.map
>> -u+ec-mftrace.map liederbuch_berlin_gesamt.dvi
>> ' TeX output 2005.03.23:2101' -> liederbuch_berlin_gesamt.ps
>> <tex.pro><alt-rule.pro><texc.pro><f7b6d320.enc><music-drawing-routines.ps>
>>
>> <ecbx10.pfa><ecrb10.pfa><cmr10.pfb>
>> <cmsy10.pfb><parmesan20.pfa><ecrm10.pfa><feta-nummer10.pfa><feta20.pfa>
>> <ecbx12.pfa><feta-nummer12.pfa><feta23.pfa><cmbx10.pfb>[1] [2] [3] [4]
>> [5]
>>
>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu....
http://lists.gnu.org/mailman/listinfo/lilypond-user

Bookmark with:


text:
# Loss funciton has a mistake?

Dear all:
when I read the code of pytorch transform_learnning tuitorials, I see the code below:

outputs = model(inputs)
_, preds = torch.max(outputs, 1)
loss = criterion(outputs, labels)

it seems that mistake in the documentation of the loss funciton.
i think that the loss should be like as:

loss = criterion(preds, labels)

Thanks .

The argument passed to criterion should be a posibility map which is the output of network and calculated by `softmax` or `sigmoid` functions.

`preds` you mentioned above is in sparse format.

Thanks, I get it. It seems that I make a mistake in parameter needed by Function “criterion”.


text:
# When does collection imply replacement?

In ordinary membership-based set theory, the axiom schema of replacement states that if $\phi$ is a first-order formula, and $A$ is a set such that for any $x\in A$ there exists a unique $y$ such that $\phi(x,y)$, then there exists a set $B$ such that $y\in B$ if and only if $\phi(x,y)$ for some $x\in A$. That is, $B$ is the "image" of $A$ under the "definable class function" $\phi$.

The related axiom schema of collection modifies this by not requiring $y$ to be unique, but only requiring $B$ to contain some $y$ for each $x$ rather than all of them. However, there are at least two different versions of this.

1. If for all $x\in A$ there exists a $y$ with $\phi(x,y)$, then there exists a set $B$ such that for all $x\in A$ there is a $y\in B$ with $\phi(x,y)$ (this is Wikipedia's version; I'll call it "weak collection").

2. If for all $x\in A$ there exists a $y$ with $\phi(x,y)$, then there exists a set $B$ such that (1) for all $x\in A$ there is a $y\in B$ with $\phi(x,y)$, and (2) for all $y\in B$ there is an $x\in A$ with $\phi(x,y)$ (I'll call this "strong collection").

The third possibly relevant axiom is the axiom schema of separation, which states that for any $\phi$ and any set $A$ there exists a set $B\subseteq A$ such that $x\in B$ if and only if $x\in A$ and $\phi(x)$.

I know the following implications between these axioms:

• Strong collection implies weak collection, since it has the same hypotheses and a stronger conclusion.
• Strong collection implies replacement, since it has a weaker hypothesis and the same conclusion.
• Replacement implies separation (assuming excluded middle): apply replacement to the formula "($\phi(x)$ and $y=\lbrace x\rbrace$) or ($\neg\phi(x)$ and $y=\emptyset$)" and take the union of the resulting set.
• Together with AC and foundation, replacement implies weak collection: let $\psi(x,V)$ assert that $V=V_\alpha$ is the smallest level of the von Neumann hierarchy such that there exists a $y\in V_\alpha$ with $\phi(x,y)$, apply replacement to $\psi$ and take the union of all the resulting $V_\alpha$.
• Weak collection and separation together imply strong collection: separation cuts out the subset of $B$ consisting of those $y$ such that $\phi(x,y)$ for some $x\in A$.

My question is: does weak collection imply replacement (and hence also separation and strong collection) without assuming separation to hold a priori? Feel free to assume all the other axioms of ZFC (including $\Delta_0$-separation). I'm fairly sure the answer is "no," but several sources I've read seem to assume that it does. Can someone give a definitive answer, and ideally a reference?

-
That's a neat question! I know the answer is generally no in weak set theories, where such things actually do matter. The answer is no without pairing. Namely the class of ordinals satisfies all the axioms except pairing, replacement, and separation, but it does satisfy foundation, collection, union and powerset (which is just the ordinal successor!). I'll have to think about combining pairing and powerset. By the way, it probably won't cause any confusion but "strong collection" already has a standard meaning, which is different from yours. –  François G. Dorais Jan 22 '10 at 2:08

The answer is no, if you allow me to adopt some weak-but-equivalent forms of the other axioms. And the reason is interesting:

• A shocking number of the axioms of set theory are true in the non-negative real line R+, with the usual order < being used to interpret set membership. (!)

Let's just check. For example, Extensionality holds, because if two real numbers have the same predecessors, then they are equal. The emptyset axiom holds, since there are no non-negative reals below 0. The Union axiom holds, since for any real x, the reals less than x are precisely the reals that are less than something less than x. (Thus, every set is its own union.) A weakened version of the Power set axioms holds, the Proper Power set, which asserts that for every x, there is a set p whose elements are the strict substs of x. This is because for any real number x, the reals below x are precisely the reals y (other than x), all of whose predecessors are less than x. (Thus, every real is its own proper power set.) An alternative weakening of power set would say: for every x, there is p such that y subset x implies y in p. This is true in the reals by using any p > x. A weakened pairing axiom states similarly: for every x,y, there is z with x ε z and y ε z. This is true in the reals by using any z above both x and y. The Foundation axiom is no problem, since 0 is in every nonempty set. Also, similarly AC holds in the form about families of disjoint nonempty sets, since this never occurs in this model. The Weak Collection Axiom holds since if every y < x has phi(x,y,w), then in fact any y in the same interval will work (since this structure has many automorphisms), and so we may collect witness with any B above x and w. Note that Separation fails, since, for example, {0} does not exist in this model. Also, Replacement fails for the same reason.

Similar interesting models can be built by considering the structure (ORD,<) built using only ordinals, or the class { Vα | α in ORD }. These also satisfy all of the weakened forms of the ZFC axioms without Separation, using Collection in place of Replacement.

Thus, part of the answer to your question is that it depends on what you mean by the "other axioms of ZFC".

Apart from this, however, let me say that the term Weak Collection is usually used to refer to the axioms that restrict the complexity of the formulas in the usual Collection scheme, rather than the axiom that you state. For example, in Kripke Platek set theory KP, a weak fragment of ZFC, one has collection only for Sigma_1 formulas, and this is described as a Weak Collection axiom. (What you call Weak Collection is usually just called Collection.) And there is a correspondingly weakened version of Separation in KP.

But I am happy to adopt your terminology here. You stated that AC plus Replacement implies Weak Collection, but this is not quite right. You don't need any AC. Instead, as your argument shows, what you need is the cumulative Vα hierarchy, which is built on the Power set axiom, not AC. That is, If you have Replacement and Power set and enough else to build the Vα hierarchy, then you get Collection as you described, even if AC fails. For example, ZF can be axiomatized equivalently with either Collection or Replacement.

Your question is a bit unusual, since usually Separation is regarded as a more fundamental axiom than Replacement and Collection, and more in keeping with what we mean by set theory. After all, if one has a set A and a property phi(x), particularly when phi is very simple, it is one of the most basic set theoretic constructions to be able to form { x in A | phi(x) }, and any set theory violating this is not very set-like. We don't really want to consider models of set theory where many instances of Separation fail (for example, Separation for atomic formula is surely elemental).

Incidentally, there is another version of a weakening of Collection in the same vein as what you are considering. Namely, consider the scheme of assertions, whenever phi(x,y) is a property, that says for every set A, there is a set B such that for every a in A, if there is b with phi(a,b), then there is b in B such that phi(a,b).

OK, let me now give a positive answer, with what I think is a more sensible interpretation of your question. I take what I said above (and Dorais's comment) to show that we shouldn't consider set theories where the Separation Axiom fails utterly. Rather, what we want is some very weak set theory, such as the Kripke Platek axioms, and then ask the relationship between Weak Collection and Replacement over those axioms. And here, you get the postive result as desired.

Theorem. If KP holds, then Weak Collection implies Replacement.

Proof. Assume KP plus (Weak) Collection. First, I claim that this is enough to prove a version of the Reflection Principle, since that proof amounts to taking successive upward Skolem hulls, which is what Collection allows. That is, I claim that for every set x and any formula phi, there is a transitive set Y such that x in Y and phi(w) is absolute between Y and the universe V. This will in effect turns any formula into a Delta0 formula using parameter Y.

Applying this, suppose we have a set A and every a in A has a unique b such that phi(a,b). By the Reflection Principle, let Y be a large set transitive containing A such that phi(a,b) and "exists b phi(a,b)" are absolute between Y and V. So Y has all the desired witnesses b for a in A. But also, now { b | exists a in A phi(a,b) } is a Delta0 definable subset of Y, since we can bound the quantifier again by Y. So the set exists. So Replacement holds. QED

I think we can get away with much less than KP. Perhaps one way to do the argument is to just prove Separation by induction on the complexity of formulas. One can collect witnesses by (weak) Collection, and this turns the formulas into lower complexity, using the new bound as a bound on the quantifiers.

-
You can get around reflection using the powerset (assuming Delta0 separation). If φ(x) is Delta0 with parameters in a transitive set a, then if there is an x which satisfies φ(x) then there is such an x in the powerset of a. This iterates, adding one more powerset for each quantifier depth. You have to modify the formula a little so the quantifiers range over sets of the appropriate powerset level. –  François G. Dorais Jan 22 '10 at 3:06
@Dorais: Is that right? What if phi(x) says "x has a member, which has a member that has a member that is y", where y is the parameter. This seems to push you up several levels beyond the parameters. –  Joel David Hamkins Jan 22 '10 at 3:13
@Joel: Ah, right! I should be more careful when switching contexts like that. I was using phi^a(x) when I used this trick before. –  François G. Dorais Jan 22 '10 at 3:25
But I think a version of your trick works, where you find the witnesses in H(|a|+). That is, if there is a witness, then take a Skolem hull and collapse things down so that the witness is small. And H(|a|+) is something very like P(a), as you said. For example, every element in H(|a|+) is coded in P(a). –  Joel David Hamkins Jan 22 '10 at 3:30
Yes, of course, H(|a|+) is Sigma_1-elementary in V. That could work... –  François G. Dorais Jan 22 '10 at 4:07

Since I am currently unable to comment, I will post as an answer.

Suppose in weak collection, we were able to extend phi(x,y) to phi(x,y) and (y in A). I don't know if this needs a parameterized form of collection or what, but it seems one step closer to separation. Perhaps looking at forms of collection involving parameters would help.


text:
# How to select top 10 records from each category [duplicate]

I have a table with fields

Hour,
PathId,
Duration,
Event,
CellId,
Channel

I have 50+ CellId. Each CellId has four PathId (i.e. 0, 1, 2, 3). Each PathId has many Events and Durations. Now I want to display the top 10 records (each PathId) for each CellId.

Sample Table

Sample Output

• You need to top 10 ordered by something right? Ordered by duration descending or perhaps duration ascending ? Dec 3 '14 at 7:34
• yes.I need top 10 record ordered by pathid or duration. Dec 3 '14 at 8:24

Use row_number() in a derived table. Partition by CellID and use the order by as per your specification. In the main query you filter on rn to get the top 10 rows per category.

select T.CellID,
T.PathID,
T.Duration
from (
select T.CellID,
T.PathID,
T.Duration,
row_number() over(partition by T.CellID order by T.Duration desc) as rn
from dbo.YourTable as T
) as T
where T.rn <= 10;

• Mikael.. It's working fine.. But it take only 60 records.. I have 100+ cellid and 400+ pathid.. Each cellid have 4 pathid. Now my query is, If i select cellId 1 means, i should display top 10 each pathid for that cellid... Dec 3 '14 at 8:51
• You want 10 records from each category as per your title. What is a category? I assumed a category is the same as CellID. If category is something else, for instance CellID + PathID you just have to modify the partition by clause to include all columns that make a category partition by T.CellID, T.PathID. Dec 3 '14 at 8:55
• CellId is category.. Dec 3 '14 at 9:19
• @ShanmugaVadivel Well it isn't...CellID and PathID is your category based on your initial question, so as Mikael says, PARTITION BY T.CellID, T.PathID Dec 3 '14 at 9:24
• ok Mark.. I will try and let u know Dec 3 '14 at 9:29

How about using CROSS APPLY eg

USE tempdb
GO

SET NOCOUNT ON
GO

IF OBJECT_ID('#tmp') IS NOT NULL DROP TABLE #tmp
CREATE TABLE #tmp
(
CellId      INT,
PathId      INT,
Duration    INT
)
GO

INSERT INTO #tmp VALUES
( 10, 1, 100 ),
( 10, 0, 120 ),
( 10, 2, 125 ),
( 10, 1, 111 ),
( 10, 0, 215 ),
( 10, 2, 22 ),
( 10, 0, 222 ),
( 10, 0, 55 ),
( 10, 1, 555 ),
( 10, 2, 58 ),
( 10, 0, 88 ),
( 10, 0, 9 ),
( 10, 2, 98 ),
( 10, 1, 55 ),
( 10, 2, 98 ),
( 10, 2, 74 ),
( 10, 0, 65 ),
( 10, 0, 66 ),
( 10, 1, 85 ),
( 10, 1, 37 ),
( 10, 1, 55 ),
( 11, 2, 11 ),
( 11, 0, 25 ),
( 11, 2, 69 ),
( 11, 0, 88 ),
( 11, 2, 54 ),
( 11, 0, 44 ),
( 11, 1, 22 ),
( 11, 0, 22 ),
( 11, 1, 55 ),
( 11, 1, 69 ),
( 11, 0, 55 ),
( 11, 1, 65 ),
( 11, 1, 65 ),
( 11, 0, 33 ),
( 11, 2, 35 )
GO

SELECT x.*
FROM ( SELECT DISTINCT cellId FROM #tmp ) c
CROSS APPLY ( SELECT TOP 10 * FROM #tmp t WHERE c.cellId = t.cellId ) x

• How to use group by inside Row_number() over (partition by ....order by)... It is possible? Dec 3 '14 at 13:48
• Could you compare your solution to the "partition by" one, please? What's better to use, when, why etc.? Jan 15 '16 at 15:01
• Nice one. I have tried more then 20 queries on 2.5 million records but your query is performing much fast. Jan 25 '17 at 11:15


text:
# perm_matrix

0th

Percentile

##### Permutation matrices

Given a permutation, coerce to word form and return the corresponding permutation matrix

Keywords
symbolmath
##### Usage
perm_matrix(p)
is.perm_matrix(M)
pm_to_perm(M)
##### Arguments
p

Permutation, coerced to word form, of length 1

M

Permutation matrix

##### Details

Given a word p with size s, the idiom for perm_matrix() boils down to

    M <- diag(s)
M[p,]

This is used explicitly in the representations vignette. There is another way:

    M <- diag(s)
M[cbind(seq_len(s),p)] <- 1
M

which might be useful sometime.

##### Value

Given a permutation p of size $s$, function perm_matrix() returns a square matrix with $s$ rows and $s$ columns. Entries are either 0 or 1; each row and each column has exactly one entry of 1 and the rest zero.

Row and column names of the permutation matrix are integers; this makes the printed version more compact.

Function pm_to_perm() takes a permutation matrix and returns the equivalend permutation in word form.

permutation

##### Aliases
• perm_matrix
• permmatrix
• permutation_matrix
• is.perm_matrix
• as.perm_matrix
• pm_to_perm
##### Examples
# NOT RUN {
perm_matrix(rperm(1,9))

p1 <- rperm(1,40)
M1 <- perm_matrix(p1)
p2 <- rperm(1,40)
M2 <- perm_matrix(p2)

stopifnot(is.perm_matrix(M1))

stopifnot(all(solve(M1) == perm_matrix(inverse(p1))))
stopifnot(all(M1 %*% M2 == perm_matrix(p1*p2)))

stopifnot(p1 == pm_to_perm(perm_matrix(p1)))

data("megaminx")
image(perm_matrix(permprod(megaminx)),asp=1,axes=FALSE)

# }

Documentation reproduced from package permutations, version 1.0-5, License: GPL-2

### Community examples

Looks like there are no examples yet.


text:
cor.test {stats} R Documentation

## Test for Association/Correlation Between Paired Samples

### Description

Test for association between paired samples, using one of Pearson's product moment correlation coefficient, Kendall's \tau or Spearman's \rho.

### Usage

cor.test(x, ...)

## Default S3 method:
cor.test(x, y,
alternative = c("two.sided", "less", "greater"),
method = c("pearson", "kendall", "spearman"),
exact = NULL, conf.level = 0.95, continuity = FALSE, ...)

## S3 method for class 'formula'
cor.test(formula, data, subset, na.action, ...)

### Arguments

 x, y numeric vectors of data values. x and y must have the same length. alternative indicates the alternative hypothesis and must be one of "two.sided", "greater" or "less". You can specify just the initial letter. "greater" corresponds to positive association, "less" to negative association. method a character string indicating which correlation coefficient is to be used for the test. One of "pearson", "kendall", or "spearman", can be abbreviated. exact a logical indicating whether an exact p-value should be computed. Used for Kendall's \tau and Spearman's \rho. See ‘Details’ for the meaning of NULL (the default). conf.level confidence level for the returned confidence interval. Currently only used for the Pearson product moment correlation coefficient if there are at least 4 complete pairs of observations. continuity logical: if true, a continuity correction is used for Kendall's \tau and Spearman's \rho when not computed exactly. formula a formula of the form ~ u + v, where each of u and v are numeric variables giving the data values for one sample. The samples must be of the same length. data an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formula). subset an optional vector specifying a subset of observations to be used. na.action a function which indicates what should happen when the data contain NAs. Defaults to getOption("na.action"). ... further arguments to be passed to or from methods.

### Details

The three methods each estimate the association between paired samples and compute a test of the value being zero. They use different measures of association, all in the range [-1, 1] with 0 indicating no association. These are sometimes referred to as tests of no correlation, but that term is often confined to the default method.

If method is "pearson", the test statistic is based on Pearson's product moment correlation coefficient cor(x, y) and follows a t distribution with length(x)-2 degrees of freedom if the samples follow independent normal distributions. If there are at least 4 complete pairs of observation, an asymptotic confidence interval is given based on Fisher's Z transform.

If method is "kendall" or "spearman", Kendall's \tau or Spearman's \rho statistic is used to estimate a rank-based measure of association. These tests may be used if the data do not necessarily come from a bivariate normal distribution.

For Kendall's test, by default (if exact is NULL), an exact p-value is computed if there are less than 50 paired samples containing finite values and there are no ties. Otherwise, the test statistic is the estimate scaled to zero mean and unit variance, and is approximately normally distributed.

For Spearman's test, p-values are computed using algorithm AS 89 for n < 1290 and exact = TRUE, otherwise via the asymptotic t approximation. Note that these are ‘exact’ for n < 10, and use an Edgeworth series approximation for larger sample sizes (the cutoff has been changed from the original paper).

### Value

A list with class "htest" containing the following components:

 statistic the value of the test statistic. parameter the degrees of freedom of the test statistic in the case that it follows a t distribution. p.value the p-value of the test. estimate the estimated measure of association, with name "cor", "tau", or "rho" corresponding to the method employed. null.value the value of the association measure under the null hypothesis, always 0. alternative a character string describing the alternative hypothesis. method a character string indicating how the association was measured. data.name a character string giving the names of the data. conf.int a confidence interval for the measure of association. Currently only given for Pearson's product moment correlation coefficient in case of at least 4 complete pairs of observations.

### References

D. J. Best & D. E. Roberts (1975). Algorithm AS 89: The Upper Tail Probabilities of Spearman's \rho. Applied Statistics, 24, 377–379. doi:10.2307/2347111.

Myles Hollander & Douglas A. Wolfe (1973), Nonparametric Statistical Methods. New York: John Wiley & Sons. Pages 185–194 (Kendall and Spearman tests).

Kendall in package Kendall.

pKendall and pSpearman in package SuppDists, spearman.test in package pspearman, which supply different (and often more accurate) approximations.

### Examples

## Hollander & Wolfe (1973), p. 187f.
## Assessment of tuna quality.  We compare the Hunter L measure of
##  lightness to the averages of consumer panel scores (recoded as
##  integer values from 1 to 6 and averaged over 80 such values) in
##  9 lots of canned tuna.

x <- c(44.4, 45.9, 41.9, 53.3, 44.7, 44.1, 50.7, 45.2, 60.1)
y <- c( 2.6,  3.1,  2.5,  5.0,  3.6,  4.0,  5.2,  2.8,  3.8)

##  The alternative hypothesis of interest is that the
##  Hunter L value is positively associated with the panel score.

cor.test(x, y, method = "kendall", alternative = "greater")
## => p=0.05972

cor.test(x, y, method = "kendall", alternative = "greater",
exact = FALSE) # using large sample approximation
## => p=0.04765

## Compare this to
cor.test(x, y, method = "spearm", alternative = "g")
cor.test(x, y,                    alternative = "g")

## Formula interface.
require(graphics)
pairs(USJudgeRatings)
cor.test(~ CONT + INTG, data = USJudgeRatings)

[Package stats version 4.3.0 Index]


text:
# A Smuggled List of S'S

Smuggled this strange list from [redacted] 's place. Maybe he is making a puzzle. Who is the victim?

• Scarlet covers
• Swindler's imprecation
• Sour disordered equipment
• Smash journal
• Sinful America
• Surgeon oath
• Storms carport

Working for Generalist Countdown -

• #6 = hippocratic? – Rand al'Thor Jul 6 at 19:19
• @Randal'Thor sorry nope – Omega Krypton Jul 6 at 23:31
• #1 = rot13( evqqyrf )? – amI Jul 7 at 4:33
• @aml sorry dont get what you mean. typo? – Omega Krypton Jul 7 at 4:59

What are the items on the list?

Synonyms of the words on the list can be anagrammed to a tag on Puzzling SE plus one letter. For example: "Scarlet covers" are "red lids", which is an anagram of "riddle" plus "s". The complete list is:

Scarlet covers: red lidsriddle + s
Swindler's imprecation: cheat's dammitmathematics + d
Sour disordered equipment: acidic unglued toollogical deduction + u
Smash journal: plow diarywordplay + i
Sinful America: evil USAvisual + e
Surgeon oath: Dr vowword + v
Storms carport: typhoons garagesteganography + o

Who is the victim?

If we assume that the third item is correct and that the second item yields an extra d, we can anagram the extra letters to Deusovi. (Thanks, jafe, for spotting that. I had a rather less convincing guess first.)

• Ooh, nice find! For #2 I was thinking "conman's curse" but it doesn't seem to work. (Note also the OP's edits to the question, suggesting that the 's after swindler may not be needed.) – Rand al'Thor Jul 7 at 7:13
• If the B is wrong, the missing letters could be DU... – jafe Jul 7 at 7:31
• Ok, I love anagrams, but no way would I have thought to do this. @OmegaKrypton this is brilliant. I am bookmarking this. I literally feel dumb looking at this puzzle. – Mr Pie Jul 7 at 8:59
• there's no 's' in 'logical-deduction, so 'tools' is wrong. – JMP Jul 7 at 9:26
• Okay, I think I got it. It got a bit tedious towards the end. I guess it's not for nothing that indirect anagrams are frowned upon. – M Oehm Jul 7 at 18:01


text:
In geometry, the tangential quadrilateral is a convex quadrilateral whose sides are all tangent to a single circle within the quadrilateral. This circle is called the incircle of the quadrilateral or its inscribed circle, its center is the incenter and its radius is called the inradius.

Since these quadrilaterals can be drawn surrounding or circumscribing their incircles, they have also been called circumscribable quadrilaterals, circumscribing quadrilaterals, and circumscriptible quadrilaterals. Tangential quadrilaterals are a special case of tangential polygons.

Let a convex quadrilateral with sides a, b, c, d, then the area of a Tangential quadrilateral is, a + c = b + d

$\large area=\sqrt{abcd}$

Or the formula can also be written as

$\large A=rs$

Where,
r = radius of inscribed circle
s = semi-perimeter = (a + b + c + d)

### Examples of Tangential Quadrilateral Formula

Example: Find the measure of the fourth side of a quadrilateral circumscribed about a circle,  if three other sides have the measures of  5 cm,  6 cm  and  4 cm  listed consecutively.

Solution

Let  x  be the measure of the fourth side of our quadrilateral. Since the quadrilateral is circumscribed about a circle, the sums of the measures of its opposite sides are equal. Thus, you can write the equation:

5 + 4 = 6 + x
From this equation,  x = 5 + 4 – 6 = 3

Answer: The fourth side of the quadrilateral is of  3 cm  long.


text:
Thermalright XP-120: 1st 120mm fan CPU heatsink :: SilentPCReview.com. Well, if you really want to be cool and quiet get this monster.
This is absolutely massive heat sink that can take a gigantic 120mm (that's about five inch wide fan). "Newegg":http://www.newegg.com/app/SearchProductResult.asp?DEPA=0 carries it for about $65. It is expensive, but worth it for the quite most likely. This comes without a fan, so you need to find a gigantic 120mm fan as well. It works particularly well with the Globe "120mm":http://www.globefan.com/12025.htm fans. The S1202512L is their low speed 2000 rpm fan. A specialty part, they are$9 from "mnpctech.com":http://www.mnpctech.com/Globe.html. You do have to cut a little of the plastic around it to get it to fit, but that's not such a big deal.


text:
### Reaching infinity- Lobbying for Axiom A

This is a post on one aspect of the infinitely muddled and confusing (confused?) concept of cardinality.

Take the product and box topologies of $\Bbb{R^\omega}$. The product topology is first countable, whilst the box topology is not. A good discussion is given in Munkres. I will discuss this with an analogy.

Let us take a man who lives forever. Also, let us take an arbitrary day in his life, and call it Day 1. Everyday after day 1, he throws one ball into an infinitely large basket. Will the basket ever have $\Bbb{N}$ balls? Remember that the man will live forever, and will keep on throwing balls into the basket long long long after we’re dead.

Intuition says “yes”. For any given number $n\in\Bbb{N}$, we can show that the basket will contain more than $n$ balls after $n$ days. However, showing that the basket will eventually contain more balls than any finite number does not show that it will eventually contain an infinite number of balls. This is very very important. One might think $\text{not finite}=\text{infinite}$. Surely this is common sense. However, the point to note is that even if the number of balls will be greater than $n$, it will still be finite. Say we take $n=1 \text{ billion}$ and check the basket after a trillion days, although the number of baskets will be greater than $n$, it is still finite (a trillion).

It is a valid mathematical argument to show that something is infinite by proving that it is greater than any arbitrarily chosen finite number. However, here we are choosing $n$ first , and then determining the set which contains more than $n$ elements. This is an invalid procedure. Looking at it from another perspective, whatever set we choose, we can show it to contain only a finite number of elements. Hence, the basket will never contain $\Bbb{N}$ balls.

My contention with this is: what if we can go to $t=\Bbb{N}$? We will surely find $\Bbb{N}$ balls in the basket then!

We can’t. Not because we can’t do this in the practical world. But because we just can’t do this according to the current axioms in Mathematics. If there were such an axiom (let us call it Axiom A) which would allow us to do so, then we would surely find $\Bbb{N}$ balls in the basket. But then we’d have to say “we can find $\Bbb{N}$ balls assuming Axiom A.”

PS: I really hope Axiom A catches on. The results obtained from Axiom A are so much more intuitive!!


text:
### Scaling laws and higher-order effects in Coulomb excitation of neutron halo nucleiScaling laws and higher-order effects in Coulomb excitation of neutron halo nuclei

Access Restriction
Open

 Author Typel, S. ♦ Baur, G. Source arXiv.org Content type Text File Format PDF Date of Submission 2008-08-26 Language English
 Subject Domain (in DDC) Computer science, information & general works ♦ Natural sciences & mathematics ♦ Physics Subject Keyword Nuclear Theory ♦ Nuclear Experiment ♦ physics:nucl-ex ♦ physics:nucl-th Abstract Essential properties of halo nuclei can be described in terms of a few low-energy constants. For neutron halo nuclei, analytical results can be found for wave functions and electromagnetic transition matrix-elements in simple but well-adapted models. These wave functions can be used to study nuclear reactions; an especially simple and instructive example is Coulomb excitation. A systematic expansion in terms of small parameters can be given. We present scaling laws for excitation amplitudes and cross sections. The results can be used to analyze experiments like ${}^{11}$Be Coulomb excitation. They also serve as benchmark tests for more involved reaction theories. Description Reference: Eur.Phys.J.A38:355-361,2008 Educational Use Research Learning Resource Type Article Page Count 7


text:
# Lloyd's set for four years of losses

Ratings agent Moody's has forecast that Lloyd's will accrue losses in excess of £2bn (\$3bn) over four consecutive years.
For the year 1997, losses are forecast at £149m, with 1998, 1999 and 2000 pr


text:
# graph is Hamiltonian if the number of vertices with degree at most d is less that d

A graph, $|G| \geq 3$ such that $\forall d < n/2$ , $|\{v \in V(G) : deg(v) \leq d\}| < d$ then G has a Hamilton cycle.

I'm not sure where to start, or what the second requirement suggests.


text:
# How to understand direct sum of tensor spaces?

Suppose $$V^{r}_{s}$$ is $$(r,s)$$ type tensor space over number field $$F$$. We can form an algebra by sum all these tensor spaces, namely $$T(V)=\oplus_{r,s\geqslant 0}V_{s}^{r}=F\oplus V\oplus V^{\ast}\oplus \cdots$$

My confusion is: How can we direct sum all these different vector spaces? As I know, direct sum is an operation among subspaces of a vector space. Are these $$V^{r}_{s}$$ subspaces of some large vector space?

• You're describing an "internal" direct sum. This is an "external" direct sum. Mathematicians can be really lazy about making the distinction, and use identical notation for the two of them. While the external version is more general, they are essentially the same when both are possible. – JonathanZ supports MonicaC Nov 4 '19 at 14:20
• @JonathanZ So the sum is just done formally? The meaning here is Cartesian product? – user450201 Nov 4 '19 at 23:49

Direct sum $$V_1 \oplus V_2 \oplus ... \oplus V_n$$ of finitely many vector spaces $$V_i$$ is the same as their cartesian product $$V_1 \times V_2 ... \times V_n$$. They are different, though, when one considers direct sums and products of infinitely many vector spaces.
• Cartesian product of $X_i, i \in I$ is the functions $\{f: I \to \bigcup X_i | f(j) \in X_j \}$. Informally it works in the same way you can add and multiply by scalars componentwise. By the way, you can accept the answer. – Vladislav Nov 5 '19 at 6:26
• A forgot to mention that direct sum of infinitely many vector spaces is a subspace in their cartesian product and consist of $a_i, i \in I$ such that $a_i \neq 0$ only for finitely many indexes. – Vladislav Nov 5 '19 at 8:58
• For example consider $\mathbb{R}^{\mathbb{N}}$ (cartesian product of countable many copies of $\mathbb{R}$). It is the space of all sequences. But direct product of the same family is a subset in $\mathbb{R}^{\mathbb{N}}$ and consists of the elements of the form $(x_1, x_2, ..., x_n, 0, 0, 0, ...)$. – Vladislav Nov 5 '19 at 9:05


text:
# Statistical test for cross validation with a low mean

I'm working on comparing 2 algorithms with an experimental protocol that produce 100 folds for each one.

As a result, I found that my algorithm got (49.29 $$\pm$$ 1.69) and the baseline got (50.40 $$\pm$$ 2.16). I applied ANOVA and other tests and I always got a p-value of 0.60.

Method: Deep learning.

Goal: comparing 2 algorithms (mine and another)

Field: computer-vision

Hypothesis ($$\alpha=0.05$$):

• $$H_0$$: the mean of the results are equal.
• $$H_a$$: the mean of the results are unequal. (advantage go to the adversary)

Results:

• $$mean_{proposed}$$ < $$mean_{baseline}$$

• Population: 2 ( proposed and baseline)

• sample size = 100

• $$P=0.6$$ and $$\alpha = 0.05$$

• $$P > 0.05$$ $$=>$$ no significant difference

My conclusion : the 2 algorithms are equal.

Can a reviewer reject my conclusion (my fail to reject the H0)?

How can I defend my point of view?


text:
IWOTA 2019

International Workshop on
Operator Theory and its Applications

July 22-26, 2019
Instituto Superior Técnico
Lisbon, Portugal

Abstracts

Type of sessions Plenary and semi-plenary Plenary Semi-plenary Analysis and Algebraic Geometry for Operator Variables Analysis and Synthesis for Operator Algebras Free Analysis and Free Probability Functional calculus, spectral sets and constants Gabor Analysis and Noncommutative Geometry Geometry of linear operators and operator algebras Hypercomplex Analysis and Operator Theory Integral Operators and Applications Linear Operators and Function Spaces Matrix Theory and Control Multivariable Operator Theory Operators of Harmonic Analysis, Related Function Spaces and Applications Operators on Reproducing Kernel Hilbert Spaces Operator Theoretical Methods in Mathematical Physics Order preserving operators on cones and applications Preserver Problems in Operator Theory and Functional Analysis Random Matrix Theory Representation Theory of Algebras and Groups Semigroups and Evolution Equations Spectral Theory and Differential Operators Toeplitz Operators, Convolution type Operators and Operator Algebras Truncated Moment Problems Analysis and Algebraic Geometry for Operator Variables

Meric Augat
University of Florida

The Free Grothendieck Theorem

A remarkable pair of theorems of Grothendieck say if $p : \mathbb{C}^g \to \mathbb{C}^g$ is an injective polynomial, then $p$ is bijective and its inverse is a polynomial. We prove a free analog of this.

Recall that a free polynomial mapping in $g$ freely non-commuting variables sends $g$-tuples of matrices (of the same size) to $g$-tuples of matrices (of the same size).

Our result is as follows; if $p$ is a free polynomial mapping that is injective, then it has a free polynomial inverse. We will make use of a free version of the Jacobian Conjecture as well as results from free analysis, formal power series and skew fields.

If there is enough time we will discuss the generalization of the theorem to free rational mappings.

The Free Grothendieck Theorem is related to free analysis, automorphisms of the free algebra and tame vs. wild automorphism of the free algebra.

Jakob Cimprič
University of Ljubljana

Local linear dependence in enveloping algebras of some Lie algebras

For every associative algebra $A$ and every class $C$ of representations of $A$ the following question (related to nullstellensatz) makes sense:

Characterize all tuples of elements $a_1,\ldots,a_n \in A$ such that vectors $\pi(a_1)v,\ldots,\pi(a_n)v$ are linearly dependent for every $\pi \in C$ and every $v$ from the representation space of $\pi$.

We answer this question for Weyl algebras and enveloping algebras of some Lie algebras. For free algebras the answer was given by Brešar and Klep in 2013.

Ryan Tully Doyle
University of New Haven

Recent results on Loewner's Theorem

A classical theorem of Loewner gives that a function is matrix monotone if and only if the function is real analytic and continues to an analytic self-map of the complex upper half plane. We will discuss work appearing over the last five years that extends Loewner's result and related techniques in the noncommutative setting, culminating in a recent paper of J. E. Pascoe on operator systems.

The techniques used in the proof of Loewner’s theorem point to way to a more general approach to investigating the relationship between functional behavior on real objects (e.g. monotonicity, convexity) and analytic continuation. We will discuss work in progress on automatic analyticity and a heuristic approach to results qualitatively akin to Loewner’s theorem.

Michael Dritschel
Newcastle University

Factoring nonnegative operator values trigonometric polynomials in two variables

The Fejér-Riesz theorem states that a nonnegative trigonometric polynomial in one variable is the (hermitian) square of an analytic polynomial of the same degree.  This result was extended to operator valued polynomials by Rosenblum, and the speaker showed that Schur complement techniques can be used to factor (strictly) positive trigonometric operator polynomials in any finite number of variables as a sum of squares of polynomials of possibly large degrees, though this method fails for polynomials which are simply nonnegative.  Results of Scheiderer from real algebra imply that nonnegative scalar valued trigonometric polynomials can also be factored in this way.  Here we discuss an analytic approach to factoring nonnegative operator valued trigonometric polynomials in two variables.

Eric Evert
KU Leuven

The Noncommutative Waring Problem

We pose and treat a noncommutative version of the classical Waring problem for polynomials. That is, for a homogeneous noncommutative polynomial $p$, we give a condition equivalent to $p$ being expressible as sums of powers of homogeneous noncommutative polynomials.

We show that if a noncommutative polynomial $p$ has a Waring decomposition, then its coefficients must satisfy a compatibility condition. If this condition is satisfied, then we prove that $p$ has a noncommutative Waring decomposition if and only if the restriction of $p$ to commuting variables has a classical Waring decomposition.

An application of noncommutative Waring decompositions and more generally tensor decompositions is they can be used to efficiently evaluate noncommutative polynomials on tuples of matrices.

This talk is based on joint work with J. William Helton, Shiyuan Huang, and Jiawang Nie.

John William Helton
UC San Diego, USA

Noncommutative Convex Algebraic Geometry

The talk will describe some progress over the last year on noncommunicative sets and functions. There are several lines of work to choose from. While several will be mentioned, the focus will likely be on the characterization of the composition $r$ of a convex with an analytic noncommutative rational function, $r(z)= f(q(z))$. These are free analogues of plurisubharmonic functions.

The work is joint with Meric Augat, Eric Evert, Igor Klep, Scott McCullough, Jurij Volcic.

Michael Jury
University of Florida

A noncommutative Lebesgue decomposition and function theory in the row ball

Every nc function $f(X)$ of nonnegative real part in the row ball can be represented as an nc Herglotz integral of a positive functional $\mu$ (which we will call an nc measure) on the Cuntz-Toeplitz operator system. The vacuum state $m$ is the natural analog, in this context, of Lebesgue measure on the circle. We introduce a notion of Lebesgue decomposition of $\mu$ with respect to $m$, thus defining absolutely continuous and singular parts of $\mu$, and describe the relationship of this decomposition to nc Cauchy transforms. We then show how absolutely continuous part can be recovered from the nc function $f(X)$, giving a partial nc analog of Fatou's theorem on radial boundary values — here the notion of almost everywhere convergence is replaced by the notion of strong resolvent convergence from the theory of unbounded operators. Our main tool is the theory of (unbounded) quadratic forms, and the construction is ultimately inspired by von Neumann's $L^2$ proof of the Radon-Nikodym theorem.

This is joint work with Robert T. W. Martin.

James Eldred Pascoe
University of Florida

The column-row property fails for the multipliers of the Fock space

Let $\mathcal{S}$ be a set of operators. We say $\mathcal{S}$ satisfies the column-row property if there exists a constant $C>0$ such that for any  sequence from $\mathcal{S}$ (finite or infinite,) $\|\sum S_iS_i^*\| \leq C\| \sum S_i^*S_i\|.$ If such a $C$ can be chosen to equal $1$, we say $\mathcal{S}$ satisfies the true column-row property. The column-row property when $\mathcal{S}$ is taken to be a space of multipliers is important in the theory of interpolating sequences. As far as the speaker knows, there is no known commutative complete Nevanlinna-Pick space for which the multipliers do not satisfy the (true) column-row property. We showed, in joint work with Augat and Jury, that the column-row property fails for the Fock space in two or more variables. Creating further discord, under a suitable model, a randomly chosen infinite sequence of multipliers satisfies $\|\sum S_iS_i^*\| \leq \| \sum S_i^*S_i\|$ for any space such that the monomials satisfy $\|z^\alpha\|\|z^\beta\| \geq \|z^{\alpha+\beta}\|$ in the Hilbert space norm. A deep question is whether or not the Drury-Arveson space satisfies the true column-row property. Our results suggest that naive random search may be unlikely to produce a counter-example, even if one exists.

Ben Passer
University of Waterloo

Compressions and the Matrix Range

If $T$ is a $d$-tuple of operators acting on a Hilbert space $H$, then the matrix range $W(T)$ is a closed and bounded matrix convex set containing all images of $T$ under UCP maps into matrix algebras. We consider the problem of determining when $W(T)$ uniquely determines $T$, under the assumption that $T$ is minimal in an appropriate sense. In particular, since we seek to determine $T$ up to unitary equivalence even if $H$ is infinite-dimensional, what is the appropriate (strict) sense of minimality to use? For certain restricted classes of operator tuples, we prove that the following condition is sufficient: “the compression of $T$ to any proper closed subspace has a strictly smaller matrix range”. We require this condition even for subspaces which are not reducing, and this distinction is crucial even in the case of compact operators. Joint work with Orr Shalit.

Orr Moshe Shalit
Technion, Israel

Maps on noncommutative algebraic subvarieties of the nc unit ball and their similarity envelopes

Let $V$ be a noncommutative algebraic subvariety of the nc unit ball. A couple of years ago, Salomon, Shamovich and I showed that the algebra $H^\infty(V)$ of all bounded nc analytic functions on $V$ is determined up to completely isometric isomorphism by "the geometry of $V$". In other words, $H^\infty(V)$ is completely isometrically isomorphic to $H^\infty(W)$ if and only if there is an automorphism of the nc unit ball that maps $V$ onto $W$. In our latest paper, we tackled the problem of when two such algebras are boundedly isomorphic. Deep theorems of Ball-Marx-Vinnikov and Agler-McCarthy imply that the nc variety $V$ cannot be the complete invariant for classification up to bounded isomorphism. It turns out that the correct geometric invariant to consider is the similarity envelope of the variety $V$, endowed with a certain metric. Working with the similarity envelopes of varieties we ran into new problems in nc function theory and multivariable operator theory. In certain cases we could overcome these problems, and our central result is that when $V$ and $W$ are homogeneous, $H^\infty(V)$ is boundedly isomorphic to $H^\infty(W)$ if and only if the similarity envelopes of $V$ and $W$ are related by an invertible bi-Lipschitz linear map. In my talk I will explain our results with an emphasis on the challenges that the similarity envelope poses.

Joint work with Eli Shamovich and Guy Salomon.

Baruch Solel
Technion, Israel Institute of Technology

Matricial reproducing kernel correspondences

Free nc function theory is an extension of the theory of holomorphic functions of several complex variables to the theory of functions on matrix tuples $Z=(Z_1,\cdots,Z_d)$ where $Z_i\in M_n(\mathbb{C})$ and $n$ is allowed to vary.

One can view such a tuple as a representation of $\mathbb{C}^d$ (viewed as a bimodule over  $\mathbb{C}$). Here, a representation of a bimodule $X$ over an algebra $A$ is a pair $(\sigma,T)$ where $\sigma$ is a representation of $A$ and $T$ is a bimodule map $T(axb)=\sigma(a)T(x)\sigma(b)$.

An nc function is a function defined on such tuples $Z$ and takes values in $\cup_n M_n(\mathbb{C})$ which is graded and respects direct sums and similarity (equivalently, respects intertwiners).

In previous works we studied functions that are defined on the space of representations of a bimodule $E$ (more precisely, a correspondence) over a $W^*$-algebra $M$ (instead of the algebra $\mathbb{C}$), are graded and respect direct sums and similarities. We referred to these functions as matricial functions.

Note that, while the representations of $\mathbb{C}$ are parameterized by $\mathbb{N}\cup \{\infty\}$, those of a general $W^*$-algebra form a more complicated category.

The classical correspondence between positive kernels and Hilbert spaces of functions has been recently extended by Ball, Marx and Vinnikov to nc completely positive kernels and Hilbert spaces of nc functions.

In this talk I will discuss a similar correspondence in our matricial context. In place of a Hilbert space of functions we will get a $W^*$-correspondence whose elements are matricial functions.

I will also discuss what we get for an important class of kernels.

This is a joint work with Paul Muhly.

Jurij Volcic
Texas A&M University

Germs of analytic noncommutative functions

This talk addresses the local theory of noncommutative functions, which branches in two directions. First we will see that the ring of noncommutative functions analytic about a scalar point admit a universal skew field of fractions, whose elements are called meromorphic germs. On the other hand, if $Y$ is a semisimple (non-scalar) point, then there exist nilpotent analytic noncommutative functions about $Y$. Nevertheless, the ring of germs about $Y$ is described as the completion of the free algebra with respect to the vanishing ideal at $Y$. This is a consequence of our second main result, a free Hermite interpolation theorem: if $f$ is a noncommutative function, then for any finite set of semisimple points and a natural number $L$ there exists a noncommutative polynomial that agrees with $f$ at the chosen points up to differentials of order $L$.

This is joint work with Igor Klep and Victor Vinnikov.

Stephan Weis
Independent researcher

Kippenhahn’s Theorem for Joint Numerical Ranges and Quantum States

Kippenhahn's Theorem asserts that the numerical range of a matrix is the convex hull of an algebraic curve. A generalization of the numerical range is the joint numerical range (JNR) of finitely many hermitian matrices. Chien and Nakazato (Linear Algebra Appl 432, 173–179, 2010) have shown that the analogous assertion, the JNR is the convex hull of an affine variety, fails for three hermitian matrices.

Here, we show that the JNR is the closed convex hull of a semi-algebraic set. First, we discuss a known statement regarding the dual convex cone to a hyperbolicity cone (Sinn, Mathematical Sciences 2:3, 2015, doi:10.1186/s40687-015-0022-0). Secondly, we prove that the class of convex bases of these dual cones is closed under linear operations.

We discuss applications in quantum mechanics, namely singularities of Wigner distributions (Schwonnek and Werner, arXiv:1802.08343 [quant-ph], 2018) and local Hamiltonians. A research opportunity is finding the non-commutative counterpart to the toric variety, which describes implicitly the log-linear model of commutative local Hamiltonians in statistics (Geiger et al., Ann Stat 34, 1463–1492, 2006).

This is joint work with Daniel Plaumann (TU Dortmund) and Rainer Sinn (FU Berlin).

Aljaz Zalar
University of Ljubljana, Faculty of Computer and Information Science

The singular bivariate quartic tracial moment problem

The tracial truncated moment problem asks to characterize when a finite sequence of real numbers indexes by words in non-commuting variables can be represented with tracial moments of matrices. In the talk we will study the bivariate quartic case, i.e., indices run over words in two variables of degree at most four. By the result of Burgdorf and Klep every such sequence with a corresponding moment matrix of size 7 which is positive definite has a representing measure. We will present what can be said if the moment matrix is singular. First observation is that it must be of rank 4 and then we will look at each of ranks 4, 5 and 6 separately. Ranks 4 and 5 can be completely solved, i.e., the existence and the uniqueness questions of the measures can be answered. In rank 6 the existence is equivalent to the feasibility problem of certain linear matrix inequalities. Flat extensions of moment matrix, which is the most powerful tool for solving the classical problem, are mostly not a necessary condition for the existence of a measure in the tracial case.


text:
# Ordering Q-indices of graphs: given size and girth

The signless Laplacian matrix in graph spectra theory is extensively studied by researchers. In 1981, Cvetkovi\'{c} pointed $12$ directions in further investigations of graph spectra, one of which is classifying and ordering graphs''. Along with this classic direction, we pay our attention on the order of the largest eigenvalue of the signless Laplacian matrix of graphs, which is usually called the $Q$-index of a graph. Let $\mathbb{G}(m, g)$ (resp. $\mathbb{G}(m, \geq g)$) be the family of connected graphs on $m$ edges with girth $g$ (resp. no less than $g$), where $g\ge3$.

In this talk, we firstly order the first $(\lfloor\frac{g}{2}\rfloor+2)$ largest $Q$-indices of graphs in $\mathbb{G}(m, g)$, where $m\ge 3g\ge 12$. Secondly, we order the first $(\lfloor\frac{g}{2}\rfloor+3)$ largest $Q$-indices of graphs in $\mathbb{G}(m, \geq g)$, where $m\ge 3g\ge 12$. As a complement, we give the first five largest $Q$-indices of graphs in $\mathbb{G}(m, 3)$ with $m\ge 9$. Finally, we give the order of the first eleven largest $Q$-indices of all connected graphs with size $m$.


text:
# How to use pre trained word2vec model?

Where can I find a reliable word2vec model trained on some English articles?

I need a word2vec black box, where I, for example, can pass a sentence as array: ["London", "is", "the", "capital", "of", "Great", "Britain"]

and receive: [some_vector_of_floats1, some_vector_of_floats2, some_vector_of_floats3, some_vector_of_floats4, some_vector_of_floats5, some_vector_of_floats6, some_vector_of_floats7]

## 2 Answers

In Python, you can use Gensim

import gensim
model = gensim.models.Word2Vec.load_word2vec_format('path-to-vectors.txt', binary=False)
# if you vector file is in binary format, change to binary=True
sentence = ["London", "is", "the", "capital", "of", "Great", "Britain"]
vectors = [model[w] for w in sentence]

These vectors should give you better performance than the pre-trained ones you'd get with word2vec.

• thank you very much. it probably works, but I receive the error KeyError: 'of' – Dmitry Nalyvaiko Mar 13 '17 at 14:05
• That means of is not in your model's vocabulary. Which vectors are you using? – Alexandre Mar 13 '17 at 14:06
• GoogleNews-vectors-negative300.bin – Dmitry Nalyvaiko Mar 13 '17 at 14:06
• I use that model in node-word2vec and it works there with sentence about London – Dmitry Nalyvaiko Mar 13 '17 at 14:09
• Did you change binary=True to binary=False as noted? The pre-trained Google vectors are in binary format. – Alexandre Mar 13 '17 at 14:16

I slightly modified the code - for my purposes

vocab = model.vocab.keys()
sentence = ["London", "is", "the", "capital", "of", "Great", "Britain"]
vectors=[]
for w in sentence:
if w in vocab:
vectors.append(model[w])
else:
print("Word {} not in vocab".format(w))
vectors.append([0])

You could also use a try/catch - your call.


text:
# Programming Task: Find two unique numbers in an array of $10,000,000$ [closed]

Can anybody help with this? This problem have to be solved using programming language Java or C++. (Or just advice algorithm).

Task: We have $N$ ($N \le 10, 000, 000$) numbers in range from $-1,000,000,000$ to $1 ,000 ,000 ,000$. Most have a duplicate, but two are unique. We have to find the two unique numbers.

Input:
$N$ Numbers, delimited with space char

Output: The two unique numbers

Examples:

Input:

6
4 8 4 7 9 9

Output:

7 8

Input:

8
7 7 5 5 5 5 5 6

Output:

5 6

-

## closed as unclear what you're asking by Clive Newstead, Matt Pressland, Raskolnikov, Zander, O.L.Jul 4 '13 at 14:37

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.If this question can be reworded to fit the rules in the help center, please edit the question.

I've voted to close because it's unclear what is being asked here. –  Clive Newstead Jul 4 '13 at 14:15
How's 5 unique in the second example? –  Raskolnikov Jul 4 '13 at 14:24
You can find a good solution here: shamasis.net/2009/09/… –  vadim123 Jul 4 '13 at 14:35
@vadim123 This is a contest question, not a programming one. There is a nice $O(N)$ solution, but I will not post it here, unless the OP states the context of his question, so that I know it is not cheating. –  dtldarek Jul 4 '13 at 15:45

## 1 Answer

This question has been answered here, on stackoverflow. In short, the suggested approach there is to use XOR. You can look this up here if you need help on what XOR means. If you don't already know about this forum you should definitely check it out - you can log in with your same credentials as for this site, but that one's for programming questions. Personally, I sometimes struggle as to where I ought to post my computation / numerics questions between these two forums. If you are looking for help coding this algorithm in a specific language, I would recommend searching and then posting in the stackoverflow forums.

-
This algorithm only works if: (1) there is a single unique item, and (2) all other items appear an even number of times. Neither condition applies to OP. –  vadim123 Jul 4 '13 at 14:40
Sort the list and then measure the lengths of each consecutive sequence of the same number. The lists with an odd number of entries each correspond to having an element that is unpaired. The time complexity of the solution is nln(n) for list sorting and n for the list length making it very close to linear time for most cases (such as your case size) –  frogeyedpeas Jul 4 '13 at 15:00
@vadim123: Quite right. I just assumed it would be trivial to adapt it; I should be more careful. Thanks for catching this. –  Eric Kightley Jul 4 '13 at 15:59


text:
시간 제한메모리 제한제출정답맞힌 사람정답 비율
5 초 (추가 시간 없음) 256 MB42250.000%

## 문제

Prof. Elephant has a sequence $a_1, a_2, \ldots, a_n$. He has used the sequence to generate an undirected graph $G$ with $n$ vertices labeled by $1, 2, \ldots, n$.

For each even-length contiguous subsequence $a_l, a_{l + 1}, \ldots, a_{l + 2 k - 1}$, if $a_{l + i - 1} = a_{l + k + i - 1}$ always holds for $i = 1, 2, \ldots, k$, Prof. Elephant would add $k$ edges to $G$, where the endpoints of the $i$-th edge are vertices labeled by $(l + i - 1)$ and $(l + k + i - 1)$, and its weight is $w_k$.

Prof. Elephant would like to know the total weight of the minimum spanning forest of $G$.

## 입력

There are multiple test cases. The first line of the input contains an integer $T$, indicating the number of test cases. For each test case:

The first line contains an integer $n$ ($2 \leq n \leq 3 \times 10^5$).

The second line contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \leq a_i \leq n$).

The third line contains $\lfloor\frac{n}{2}\rfloor$ integers $w_1, w_2, \ldots, w_{\lfloor\frac{n}{2}\rfloor}$ ($1 \leq w_i \leq 10^9$).

It is guaranteed that the sum of $n$ in all test cases will not exceed $3 \times 10^5$.

## 출력

For each test case, output an integer denoting the total weight of the minimum spanning forest of $G$.

## 예제 입력 1

1
8
2 2 5 6 2 5 6 2
5 1 4 4

## 예제 출력 1

21


text:
# Magnetostatics - boundary condition

## Main Question or Discussion Point

Let's consider two media with magnetic permeability $$\mu_1, \mu_2$$.
What's the condition for magnetostatic vector potential $$\vec{A}$$
on the boundary. Is it true that its tangent component should be continuous.
Thanks for replay.

Related Classical Physics News on Phys.org
marcusl
Gold Member
The BC across the magnetic interface is

$$\vec{A_+} - \vec{A_-}=\mu_0\vec{M}\times\hat{n}$$

so only the normal component of A is continuous. A_tangential is continuous only in the special case when M is normal to the surface.

The condition on $$\vec{B}$$ are the following:
$$\vec{n}( \vec{B}^+ - \vec{B}^-) = 0$$
and
$$\vec{n} \times (\frac{1}{\mu_1}\vec{B}^+ -\frac{1}{\mu_2} \vec{B}^-) = 0$$
Vector potential satisfies the condition $$\nabla \times \vec{A} = \vec{B}$$.
I'm exacly asking if the above conditions implies that some components of A are continous.

Meir Achuz
Homework Helper
Gold Member
I don't agree with Marcus. Since curl A is finite, A tangential is continuous.
Since div A is zero, A normal is continuous.

marcusl


text:
Browse Questions

# $H_2O_2\rightarrow 2H^++O_2+2e^-$.$E^{\large\circ}=-0.68v$.The given equation represents the following nature of $H_2O_2$

$\begin{array}{1 1}(a)\;\text{Bleaching powder}\\(b)\;\text{Acidic}\\(c)\;\text{Reducing}\\(d)\;\text{Oxidising}\end{array}$

Can you answer this question?

Released electrons causes for reduction of other compounds.
Hence (c) is the correct answer.
answered Jan 23, 2014