text:
• ### ILC Higgs White Paper(1310.0763)

Dec. 29, 2018 hep-ph
The ILC Higgs White Paper is a review of Higgs Boson theory and experiment at the International Linear Collider (ILC). Theory topics include the Standard Model Higgs, the two-Higgs doublet model, alternative approaches to electroweak symmetry breaking, and precision goals for Higgs boson experiments. Experimental topics include the measurement of the Higgs cross section times branching ratio for various Higgs decay modes at ILC center of mass energies of 250, 500, and 1000 GeV, and the extraction of Higgs couplings and the total Higgs width from these measurements. Luminosity scenarios based on the ILC TDR machine design are used throughout. The gamma-gamma collider option at the ILC is also discussed.
• ### Spitzer Observations of the North Ecliptic Pole(1712.01290)

Dec. 4, 2017 astro-ph.GA
We present a photometric catalog for Spitzer Space Telescope warm mission observations of the North Ecliptic Pole (NEP; centered at $\rm R.A.=18^h00^m00^s$, $\rm Decl.=66^d33^m38^s.552$). The observations are conducted with IRAC in 3.6 $\mu$m and 4.5 $\mu$m bands over an area of 7.04 deg$^2$ reaching 1$\sigma$ depths of 1.29 $\mu$Jy and 0.79 $\mu$Jy in the 3.6 $\mu$m and 4.5 $\mu$m bands respectively. The photometric catalog contains 380,858 sources with 3.6 $\mu$m and 4.5 $\mu$m band photometry over the full-depth NEP mosaic. Point source completeness simulations show that the catalog is 80% complete down to 19.7 AB. The accompanying catalog can be utilized in constraining the physical properties of extra-galactic objects, studying the AGN population, measuring the infrared colors of stellar objects, and studying the extra-galactic infrared background light.
• ### Ultraviolet to optical diffuse sky emission as seen by the Hubble Space Telescope Faint Object Spectrograph(1701.00885)

We present an analysis of the blank sky spectra observed with the Faint Object Spectrograph on board the Hubble Space Telescope. We study the diffuse sky emission from ultraviolet to optical wavelengths, which is composed of the zodiacal light (ZL), diffuse Galactic light (DGL), and residual emission. The observations were performed toward 54 fields distributed widely over the sky, with the spectral coverage from 0.2 to 0.7 um. In order to avoid contaminating light from the earthshine, we use the data collected only in orbital nighttime. The observed intensity is decomposed into the ZL, DGL, and residual emission, in eight photometric bands spanning our spectral coverage. We found that the derived ZL reflectance spectrum is flat in the optical, which indicates major contribution of C-type asteroids to the interplanetary dust (IPD). In addition, the ZL reflectance spectrum has an absorption feature at ~0.3 um. The shape of the DGL spectrum is consistent with those found in earlier measurements and model predictions. While the residual emission contains a contribution from the extragalactic background light, we found that the spectral shape of the residual looks similar to the ZL spectrum. Moreover, its optical intensity is much higher than that measured from beyond the IPD cloud by Pioneer10/11, and also than that of the integrated galaxy light. These findings may indicate the presence of an isotropic ZL component, which is missed in the conventional ZL models.
• ### First Detection of Galactic Latitude Dependence of Near-Infrared Diffuse Galactic Light from DIRBE Reanalysis(1603.07732)

March 24, 2016 astro-ph.CO, astro-ph.GA
Observational study on near-infrared (IR) scattering properties of interstellar dust grains has been limited due to its faintness. Using all-sky maps obtained from Diffuse Infrared Background Experiment (DIRBE), we investigate the scattering property from diffuse Galactic light (DGL) measurements at 1.25, 2.2, and 3.5 {\mu}m in addition to our recent analyses of diffuse near-IR emission (Sano et al. 2015; Sano et al. 2016). As a result, we first find that the intensity ratios of near-IR DGL to 100 {\mu}m emission increase toward low Galactic latitudes at 1.25 and 2.2 {\mu}m. The derived latitude dependence can be reproduced by a scattered light model of interstellar dust with a large scattering asymmetry factor g = <cos{\theta}> of $0.8^{+0.2}_{-0.3}$ at 1.25 and 2.2 {\mu}m, assuming an infinite Galaxy disk as an illuminating source. The derived asymmetry factor is comparable to the values obtained in the optical, but several times larger than that expected from a recent dust model. Since possible latitude dependence of ultraviolet-excited dust emission at 1.25 and 2.2 {\mu}m would reduce the large asymmetry factor to the reasonable value, our result may indicate the first detection of such an additional emission component in the diffuse interstellar medium.
• ### Reanalysis of near-infrared extragalactic background light based on the IRTS observation(1501.01359)

May 20, 2015 astro-ph.CO, astro-ph.GA
We reanalyze data of near-infrared background taken by Infrared Telescope in Space (IRTS) based on up-to-date observational results of zodiacal light, integrated star light and diffuse Galactic light. We confirm the existence of residual isotropic emission, which is slightly lower but almost the same as previously reported. At wavelengths longer than 2 {\mu}m, the result is fairly consistent with the recent observation with AKARI. We also perform the same analysis using a different zodiacal light model by Wright and detected residual isotropic emission that is slightly lower than that based on the original Kelsall model. Both models show the residual isotropic emission that is significantly brighter than the integrated light of galaxies.
• ### Measurements of the mean diffuse galactic light spectrum in the 0.95 {\mu}m to 1.65 {\mu}m band from CIBER(1503.04926)

March 19, 2015 astro-ph.GA, astro-ph.IM
We report measurements of the Diffuse Galactic Light (DGL) spectrum in the near-infrared, spanning the wavelength range 0.95-1.65 {\mu}m by the Cosmic Infrared Background ExpeRiment (CIBER). Using the low-resolution spectrometer (LRS) calibrated for absolute spectro-photometry, we acquired long-slit spectral images of the total diffuse sky brightness towards four high-latitude fields spread over four sounding rocket flights. To separate the DGL spectrum from the total sky brightness, we correlated the spectral images with a 100 {\mu}m intensity map, which traces the dust column density in optically thin regions. The measured DGL spectrum shows no resolved features and is consistent with other DGL measurements in the optical and at near-infrared wavelengths longer than 1.8 {\mu}m. Our result implies that the continuum is consistently reproduced by models of scattered starlight in the Rayleigh scattering regime with a few large grains.
• ### Near-infrared Brightness of the Galilean Satellites Eclipsed in Jovian Shadow: A New Technique to Investigate Jovian Upper Atmosphere(1405.5280)

May 21, 2014 astro-ph.EP
We have discovered that Europa, Ganymede and Callisto are bright around 1.5 {\mu}m even when not directly lit by sunlight, based on observations from the Hubble Space Telescope and the Subaru Telescope. The observations were conducted with non-sidereal tracking on Jupiter outside of the field of view to reduce the stray light subtraction uncertainty due to the close proximity of Jupiter. Their eclipsed luminosity was $10^{-6}$-$10^{-7}$ of their uneclipsed brightness, which is low enough that this phenomenon has been undiscovered until now. In addition, Europa in eclipse was <1/10 of the others at 1.5 {\mu}m, a potential clue to the origin of the source of luminosity. Likewise, Ganymede observations were attempted at 3.6 {\mu}m by the Spitzer Space Telescope but it was not detected, suggesting a significant wavelength dependence. The reason why they are luminous even when in the Jovian shadow is still unknown, but forward-scattered sunlight by haze in the Jovian upper atmosphere is proposed as the most plausible candidate. If this is the case, observations of these Galilean satellites while eclipsed by the Jovian shadow provide us a new technique to investigate Jovian atmospheric composition, and investigating the transmission spectrum of Jupiter by this method is important for investigating the atmosphere of extrasolar giant planets by transit spectroscopy.
• ### Higgs Working Group Report of the Snowmass 2013 Community Planning Study(1310.8361)

Jan. 8, 2014 hep-ph, hep-ex
This report summarizes the work of the Energy Frontier Higgs Boson working group of the 2013 Community Summer Study (Snowmass). We identify the key elements of a precision Higgs physics program and document the physics potential of future experimental facilities as elucidated during the Snowmass study. We study Higgs couplings to gauge boson and fermion pairs, double Higgs production for the Higgs self-coupling, its quantum numbers and $CP$-mixing in Higgs couplings, the Higgs mass and total width, and prospects for direct searches for additional Higgs bosons in extensions of the Standard Model. Our report includes projections of measurement capabilities from detailed studies of the Compact Linear Collider (CLIC), a Gamma-Gamma Collider, the International Linear Collider (ILC), the Large Hadron Collider High-Luminosity Upgrade (HL-LHC), Very Large Hadron Colliders up to 100 TeV (VLHC), a Muon Collider, and a Triple-Large Electron Positron Collider (TLEP).
• ### The Cosmic Infrared Background Experiment (CIBER): the Narrow Band Spectrometer(1307.0016)

June 28, 2013 astro-ph.CO, astro-ph.IM
We have developed a near-infrared spectrometer designed to measure the absolute intensity of the Solar 854.2 nm CaII Fraunhofer line, scattered by interplanetary dust, in the Zodiacal light spectrum. Based on the known equivalent line width in the Solar spectrum, this measurement can derive the Zodiacal brightness, testing models of the Zodiacal light based on morphology that are used to determine the extragalactic background light in absolute photometry measurements. The spectrometer is based on a simple high-resolution tipped filter placed in front of a compact camera with wide-field refractive optics to provide the large optical throughput and high sensitivity required for rocket-borne observations. We discuss the instrument requirements for an accurate measurement of the absolute Zodiacal light brightness, the measured laboratory characterization, and the instrument performance in flight.
• ### The Cosmic Infrared Background Experiment (CIBER): The Wide-Field Imagers(1206.4702)

June 20, 2012 astro-ph.CO, astro-ph.IM
We have developed and characterized an imaging instrument to measure the spatial properties of the diffuse near-infrared extragalactic background light in a search for fluctuations from z > 6 galaxies during the epoch of reionization. The instrument is part of the Cosmic Infrared Background Experiment (CIBER), designed to observe the extragalactic background light above the Earth's atmosphere during a suborbital sounding rocket flight. The imaging instrument incorporates a 2x2 degree field of view, to measure fluctuations over the predicted peak of the spatial power spectrum at 10 arcminutes, and 7"x7" pixels, to remove lower redshift galaxies to a depth sufficient to reduce the low-redshift galaxy clustering foreground below instrumental sensitivity. The imaging instrument employs two cameras with \Delta \lambda / \lambda ~0.5 bandpasses centered at 1.1 and 1.6 microns to spectrally discriminate reionization extragalactic background fluctuations from local foreground fluctuations. CIBER operates at wavelengths where the electromagnetic spectrum of the reionization extragalactic background is thought to peak, and complements fluctuations measurements by AKARI and Spitzer at longer wavelengths. We have characterized the instrument in the laboratory, including measurements of the sensitivity, flat-field response, stray light performance, and noise properties. Several modifications were made to the instrument following a first flight in 2009 February. The instrument performed to specifications in subsequent flights in 2010 July and 2012 March, and the scientific data are now being analyzed.
• ### The Cosmic Infrared Background Experiment (CIBER): The Low Resolution Spectrometer(1112.4217)

Dec. 22, 2011 astro-ph.CO, astro-ph.IM
Absolute spectrophotometric measurements of diffuse radiation at 1 \mu m to 2 \mu m are crucial to our understanding of the radiative content of the Universe from nucleosynthesis since the epoch of reionization, the composition and structure of the Zodiacal dust cloud in our solar system, and the diffuse galactic light arising from starlight scattered by interstellar dust. The Low Resolution Spectrometer (LRS) on the rocket-borne Cosmic Infrared Background Experiment (CIBER) is a \lambda / \Delta \lambda \sim 15-30 absolute spectrophotometer designed to make precision measurements of the absolute near-infrared sky brightness between 0.75 \mu m < \lambda < 2.1 \mu m. This paper presents the optical, mechanical and electronic design of the LRS, as well as the ground testing, characterization and calibration measurements undertaken before flight to verify its performance. The LRS is shown to work to specifications, achieving the necessary optical and sensitivity performance. We describe our understanding and control of sources of systematic error for absolute photometry of the near-infrared extragalactic background light.
• ### The Cosmic Infrared Background Experiment (CIBER): A Sounding Rocket Payload to Study the Near Infrared Extragalactic Background Light(1112.1424)

Dec. 6, 2011 astro-ph.CO, astro-ph.IM
The Cosmic Infrared Background Experiment (CIBER) is a suite of four instruments designed to study the near infrared (IR) background light from above the Earth's atmosphere. The instrument package comprises two imaging telescopes designed to characterize spatial anisotropy in the extragalactic IR background caused by cosmological structure during the epoch of reionization, a low resolution spectrometer to measure the absolute spectrum of the extragalactic IR background, and a narrow band spectrometer optimized to measure the absolute brightness of the Zodiacal light foreground. In this paper we describe the design and characterization of the CIBER payload. The detailed mechanical, cryogenic, and electrical design of the system are presented, including all system components common to the four instruments. We present the methods and equipment used to characterize the instruments before and after flight, and give a detailed description of CIBER's flight profile and configurations. CIBER is designed to be recoverable and has flown twice, with modifications to the payload having been informed by analysis of the first flight data. All four instruments performed to specifications during the second flight, and the scientific data from this flight are currently being analyzed.
• ### $\mu - e$ Conversion With Four Generations(1106.5085)

July 4, 2011 hep-ph, hep-ex
We study $\mu - e$ conversion with sequential four generations. A large mass for the fourth generation neutrino can enhance the conversion rate by orders of magnitude. We compare constraints obtained from $\mu - e$ conversion using experimental bounds on various nuclei with those from $\mu \to e \gamma$ and $\mu \to e\bar e e$. We find that the current bound from $\mu - e$ conversion with Au puts the most stringent constraint in this model. The relevant flavor changing parameter $\lambda_{\mu e} = V^*_{\mu 4}V_{e4}^{}$ is constrained to be less than $1.6\times 10^{-5}$ for the fourth generation neutrino mass larger than 100 GeV. Implications for future $\mu -e$ conversion, $\mu \to e\gamma$ and $\mu \to e\bar e e$ experiments are discussed.
• ### Observations of the Near-Infrared Spectrum of the Zodiacal Light with CIBER(1004.5445)

July 22, 2010 astro-ph.EP
Interplanetary dust (IPD) scatters solar radiation which results in the zodiacal light that dominates the celestial diffuse brightness at optical and near-infrared wavelengths. Both asteroid collisions and cometary ejections produce the IPD, but the relative contribution from these two sources is still unknown. The Low Resolution Spectrometer (LRS) onboard the Cosmic Infrared Background Experiment (CIBER) observed the astrophysical sky spectrum between 750 and 2100 nm over a wide range of ecliptic latitude. The resulting zodiacal light spectrum is redder than the solar spectrum, and shows a broad absorption feature, previously unreported, at approximately 900 nm, suggesting the existence of silicates in the IPD material. The spectral shape of the zodiacal light is isotropic at all ecliptic latitudes within the measurement error. The zodiacal light spectrum, including the extended wavelength range to 2500 nm using IRTS data, is qualitatively similar to the reflectance of S-type asteroids. This result can be explained by the proximity of S-type asteroidal dust to Earth's orbit, and the relativily high albedo of asteridal dust compared with cometary dust.
• ### Derivation of Covariant Dissipative Fluid Dynamics in the Renormalization-group Method(hep-ph/0609056)

We derive generic relativistic hydrodynamical equations with dissipative effects from the underlying Boltzmann equation in a mechanical and systematic way on the basis of so called the renormalization-group (RG) method. A macroscopic frame vector is introduced to specify the frame on which the macroscopic dynamics is described. Our method is so mechanical with only few ansatz that our method give a microscopic foundation of the available hydrodynamical equations, and also can be applied to make a reduction of the kinetic equations other than the simple Boltzmann equation.
• ### Charmonium properties in deconfinement phase in anisotropic lattice QCD(hep-lat/0602008)

June 14, 2006 hep-ph, hep-lat
J/Psi and eta_c above the QCD critical temperature T_c are studied in anisotropic quenched lattice QCD, considering whether the c\bar c systems above T_c are spatially compact (quasi-)bound states or scattering states. We adopt the standard Wilson gauge action and O(a)-improved Wilson quark action with renormalized anisotropy a_s/a_t =4.0 at \beta=6.10 on 16^3\times (14-26) lattices, which correspond to the spatial lattice volume V\equiv L^3\simeq(1.55{\rm fm})^3 and temperatures T\simeq(1.11-2.07)T_c. We investigate the c\bar c system above T_c from the temporal correlators with spatially-extended operators, where the overlap with the ground state is enhanced. To clarify whether compact charmonia survive in the deconfinement phase, we investigate spatial boundary-condition dependence of the energy of c\bar c systems above T_c. In fact, for low-lying S-wave c \bar c scattering states, it is expected that there appears a significant energy difference \Delta E \equiv E{\rm (APBC)}-E{\rm (PBC)}\simeq2\sqrt{m_c^2+3\pi^2/L^2}-2m_c (m_c: charm quark mass) between periodic and anti-periodic boundary conditions on the finite-volume lattice. In contrast, for compact charmonia, there is no significant energy difference between periodic and anti-periodic boundary conditions. As a lattice QCD result, almost no spatial boundary-condition dependence is observed for the energy of the c\bar c system in J/\Psi and \eta_c channels for T\simeq(1.11-2.07)T_c. This fact indicates that J/\Psi and \eta_c would survive as spatially compact c\bar c (quasi-)bound states below 2T_c. We also investigate a $P$-wave channel at high temperature with maximally entropy method (MEM) and find no low-lying peak structure corresponding to \chi_{c1} at 1.62T_c.
• ### Bi-maximal mixing at GUT, the low energy data and the leptogenesis(hep-ph/0411239)

Nov. 18, 2004 hep-ph
In the framework of the minimum supersymmetric model with right-handed neutrinos, we consider the Bi-maximal mixing which is realized at the GUT scale and discuss a question that this model can reproduce the low energy phenomena and the leptogenesis.
• ### Yukawa Matrix for the Neutrino and Lepton Flavour Violation(hep-ph/0411240)

Nov. 18, 2004 hep-ph
We estimate the magnitude of Lepton Flavour Violation (LFV) from the phase of the neutrino Yukawa matrix. In the minimal supersymmetric standard model with right-handed neutrinos, the LFV processes l_i \to l_j \gamma can appear through the slepton mixing, which comes from the renormalization group effect on the right-handed neutrino Yukawa interaction between the Grand Unified Theory scale and the heavy right-handed neutrino mass scale. Two types of phases exist in the neutrino Yukawa matrix. One is the Majorana phase, which can change the magnitude of the LFV branching ratios by a few factor. The other phases relate for the size of the Yukawa hierarchy and its phase effect can change the LFV branching ratios by several orders of magnitude.
• ### Phase contribution to LFV(hep-ph/0409283)

Sept. 24, 2004 hep-ph
We analyze the phase effect of the neutrino Yukawa matrix in the context of the Minimal Supersymmetric Standard Model with right-handed neutrinos. Its effect can change the Lepton Flavor Violation branching ratios by a few order of magnitude.


text:
2015
09-18

Campus Design

Nanjing University of Science and Technology is celebrating its 60th anniversary. In order to make room for student activities, to make the university a more pleasant place for learning, and to beautify the campus, the college administrator decided to start construction on an open space.
The designers measured the open space and come to a conclusion that the open space is a rectangle with a length of n meters and a width of m meters. Then they split the open space into n x m squares. To make it more beautiful, the designer decides to cover the open space with 1 x 1 bricks and 1 x 2 bricks, according to the following rules:

1. All the bricks can be placed horizontally or vertically
2. The vertexes of the bricks should be placed on integer lattice points
3. The number of 1 x 1 bricks shouldn’t be less than C or more than D. The number of 1 x 2 bricks is unlimited.
4. Some squares have a flowerbed on it, so it should not be covered by any brick. (We use 0 to represent a square with flowerbet and 1 to represent other squares)

Now the designers want to know how many ways are there to cover the open space, meeting the above requirements.

There are several test cases, please process till EOF.
Each test case starts with a line containing four integers N(1 <= N <= 100), M(1 <= M <= 10), C, D(1 <= C <= D <= 20). Then following N lines, each being a string with the length of M. The string consists of ‘0’ and ‘1’ only, where ‘0’ means the square should not be covered by any brick, and ‘1’ otherwise.

There are several test cases, please process till EOF.
Each test case starts with a line containing four integers N(1 <= N <= 100), M(1 <= M <= 10), C, D(1 <= C <= D <= 20). Then following N lines, each being a string with the length of M. The string consists of ‘0’ and ‘1’ only, where ‘0’ means the square should not be covered by any brick, and ‘1’ otherwise.

1 1 0 0
1
1 1 1 2
0
1 1 1 2
1
1 2 1 2
11
1 2 0 2
01
1 2 0 2
11
2 2 0 0
10
10
2 2 0 0
01
10
2 2 0 0
11
11
4 5 3 5
11111
11011
10101
11111

0
0
1
1
1
2
1
0
2
954

#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
using namespace std;

const int MOD = 1000000007;
int n, m, c, d, pre = 0, now = 1;
long long dp[2][25][1222];
char g[105][15];

int main() {
while (~scanf("%d%d%d%d", &n, &m, &c, &d)) {
int maxs = (1<<m);
memset(dp[now], 0, sizeof(dp[now]));
dp[now][0][maxs - 1] = 1;
for (int i = 0; i < n; i++)
scanf("%s", g[i]);
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
swap(pre, now);
memset(dp[now], 0, sizeof(dp[now]));
int tmp = g[i][j] - '0';
if (tmp) {
for (int k = 0; k <= d; k++) {
for (int s = 0; s < maxs; s++) {
if (k && (s&1<<j))
dp[now][k][s] = (dp[now][k][s] + dp[pre][k - 1][s]) % MOD;//放1X1
if (j && !(s&1<<(j-1)) && (s&1<<j))
dp[now][k][s|1<<(j-1)] = (dp[now][k][s|1<<(j-1)] + dp[pre][k][s]) % MOD;//横放1X2
dp[now][k][s^1<<j] = (dp[now][k][s^1<<j] + dp[pre][k][s]) % MOD;//竖放1X2
}
}
}
else {
for (int k = 0; k <= d; k++) {
for (int s = 0; s < maxs; s++) {
if ((s&1<<j))
dp[now][k][s] = (dp[now][k][s] + dp[pre][k][s]) % MOD;//不能放的情况，和放1X1类似
}
}
}
}
}
long long ans = 0;
for (int i = c; i <= d; i++)
ans = (ans + dp[now][i][maxs - 1]) % MOD;
printf("%lld\n", ans);
}
return 0;
}

format: plain


text:
# What's the difference between using a composite null and running a power calculation for minimal effect size?

Probably a weird place to quote, but I just stumbled across this discussion on Reddit, and one of them said (with typos fixed):

The effect size in a power calculation has no relationship whatsoever to the minimal effect size under a non-point null. These are two completely unrelated. If you consider an effect size in your power calculation against a point null, you're still testing a point null.

(......) Of course you can have a null of zero in a power simulation. You usually do. You compute power at the alternative, but the test statistic is computed under the assumption of the null. You shouldn't be running around changing your null.

(......) You can use composite nulls, but this is in general very uncommon. Using a composite null is also different than running a power calculation for minimal effect size.

As indicated, the most obvious difference between (A) using a composite null and (B) running a power calculation for minimal effect size is that the sample distributions of statistics are calculated under the assumption of their respective null hypothesis. However, I'm not sure if it's the only difference. More importantly, what's their implications, and when should we use (A), (B), or both?

To put it more concretely, given that I specify the expected minimum effect size as "the actual difference in means is at least $$0.8\sigma$$", what the difference among the following configurations?

\begin{align} H_0&: \mu = 0 & H_1&: \mu \ne 0 \tag 1\\ H_0&: -0.8\sigma \le \mu \le 0.8\sigma & H_1&: \mu \ne 0 \tag 2\\ H_0&: \mu = 0 & H_1&: \mu < -0.8\sigma \lor \mu > 0.8\sigma \tag 3 \end{align}

By the way, I'm not familiar with the terms "power analysis" and "effect size", so please don't assume me a strong background. Believe it or not, my professor didn't even mention them when teaching us hypothesis testing. (Yeah, as a Statistics major, this really sucks.)

• Neither term was used in my stats major either, indeed not even in my PhD, but it's not because anything was lacking from my education; you have probably encountered all the necessary concepts, just not framed in this exact way. Effect size is usually some standardized measure of how false the null is (like $\frac{\mu_2-\mu_1}{\sigma}$ in a two sample test of means) and what people usually mean when they say "power analysis" is not an analysis of power at all; it's usually instead a calculation of the required sample size to achieve a particular power given an effect size of interest ... ctd Jul 23 '19 at 5:14
• ctd ... - e.g. we want at least an 80% chance to reject the null when the actual difference in means is (say) 0.4 standard deviations, what is the required sample size? ... why they call that power analysis instead of 'sample size calculation' is beyond me; to me a power analysis would be something along the lines of finding a power curve (typically as a function of effect size given a sample size, or as a function of sample size, given an effect size.) Jul 23 '19 at 5:15
• @Glen_b Can you elaborate on the relationship of "effect size", "null hypothesis" and "alternative hypothesis"? Your description suggests they are unrelated, and that the effect size is essentially a parameter of the test, like $\alpha$ and $\beta$. However, this paper defines the effect size as the distance between the null and the alternative: (...) These two groups differ by some degree: the effect size. Jul 23 '19 at 6:11
• Not in comments. I was attempting to reassure you that your stats education was probably not lacking, it's a matter of what application areas focus on. Don't rely on any one source. Read widely and you'll find all manner of definitions of effect size. I suggest you stick with Jacob Cohen, though (where much of this usage of terminology and focus originates). In the subject areas that use these terms the alternatives are never simple alternatives, so "the alternative" doesn't really make sense, except in so far as they focus on a particular effect size. Jul 23 '19 at 6:21
• @Glen_b Thanks, will check out A power primer by Jacob Cohen! Jul 23 '19 at 6:39


text:
# Detect Perfect Pairings

Let's have a function $f$ that takes a string and removes all pairs of adjacent identical characters. For example

$f(a\color{red}{bb}ba\color{red}{cc}) = aba$

Note that when two pairs overlap we only remove one of them.

We will call a string perfectly paired if repeated application eventually yields the empty string. For example the string above $abbbacc$ is not perfectly paired because if we apply $f$ again we still get $aba$. However a string like $eabbccadde$ is perfectly paired because if we apply $f$ three times we get the empty string

$f(ea\color{red}{bbcc}a\color{red}{dd}e) = eaae$

$f(e\color{red}{aa}e) = ee$

$f(\color{red}{ee}) =$

Your task is to write perfectly paired computer code that takes a string (of printable ASCII) and decides if it is perfectly paired. The bytestring of your source must be itself a perfectly paired string, although your code doesn't necessarily have to be restricted to printable ASCII.

You may output two distinct values: one for the case where the input is perfectly paired, and another one for cases where it isn't.

This is a question so answers will be scored by the size in bytes of their source with fewer bytes being better.

## Test Cases

$abbbacc \rightarrow \mathrm{False}\\ abcba \rightarrow \mathrm{False}\\ abab \rightarrow \mathrm{False}\\ abbbaabacc \rightarrow \mathrm{True}\\ eabbccadde \rightarrow \mathrm{True}\\ bbbb \rightarrow \mathrm{True}$

• While it may be too late to change it now, I feel like the "twist" part of the challenge is rendered almost pointless if you allow comments or similar "dead" code. – Geobits Jun 25 '18 at 17:26
• @Geobits I disagree. For one I think that disallowing dead code is just a mire of vague definitions and never turns out fun anyway. For two I think allowing comments lowers the bar of entry. For three I believe that the comment-less code will inevitably be better scoring than the comment-full code. Maybe the twist isn't fun but it would definitely be less fun if I added unenfoceable restrictions to make answers do it in a particular way. – Wheat Wizard Jun 25 '18 at 17:32
• Unary doesn't give a damn about your source restriction rule, mwahahahaha (that is ... as long as the answer has an even number of bytes). – Arnauld Jun 25 '18 at 17:41
• @Geobits One thing that might have encouraged more creative answers is to factor the number of steps to get to the empty string into the scoring. Using comments tends to cause this number to be quite high because the comments naturally nest where as a lower score requires you to interlace the pairs quite a bit. Obviously it is too late to make that change though. – Wheat Wizard Jun 25 '18 at 18:12
• @dylnan The empty string can be, looping forever however is not valid output. – Wheat Wizard Jun 25 '18 at 18:18

((""##))
a===bb=bb==a
((aa:bb))##((cc:dd))|aa===cc=bb##dd|1==1=((cc:aa:bb))##dd
a##""=""===a
""##cc=((cc!!00:cc!!00:""))##cc

No comments. Returns either True or False.

Try it online!

Edit: -22 bytes thanks to @Cat Wizard

• This is the least haskell like haskell I've ever seen – Cubic Jun 26 '18 at 15:14

# Python 2, 94 bytes

ss=''

for cc in input():ss=[cc+ss,ss[1:]][cc==ss[:1]]

print''==ss##tnirp[,+[=:)(tupni nirof=

Try it online!

The whole update step ss=[cc+ss,ss[1:]][cc==ss[:1]] cancels to just =[+,[.

# 05AB1E, 26 24 22 20 18 bytes

-2 bytes thanks to ovs. Outputs 0 if the string is perfectly paired, 1 otherwise.

ΔγʒgÉ}JJ}ĀqqĀÉgʒγΔ

Try it online!

ΔγʒgÉ}JJ}ĀqqĀÉgʒγΔ – Full program.
Δ       }          – Until the result no longer changes:
γʒ  }               – Split the string into chunks of equal characters and filter by:
gÉ                – Is the length odd?
JJ           – And after filtering, join the parts back together, but do this
twice to save 2 bytes, as in the previous versions.
Ā         – Check whether the result is empty
q        – Terminate (quit) execution. The rest of the code is ignored.
qĀÉgʒγΔ – Mirror the non-matched part to help with the source layout.

### Previous versions

This one purely relies on undefined behaviour (so there's no "dead code"), and outputs [['0']] for perfectly paired strings and [['1']] for non-perfectly matched strings:

ΔγεDgÉ£}JJ}ĀĀ£ÉgDεγΔ

And the 22-byte version, explained, which is just the above but not abusing UB, and yielding sane values.

ΔγεDgÉ£}JJ}ĀqqĀ£ÉgDεγΔ – Full program.
Δ         }            – Until fixed point is reached (starting from the input value):
γε    }                 – Group equal adjacent values, and for each chunk,
DgÉ                     – Duplicate, get its length mod by 2.
£                    – And get the first ^ characters of it. This yields the
first char of the chunk or "" respectively for odd-length
and even-length chunks respectively.
JJ                – Join the result to a string, but do this twice to help
us with the source layout, saving 2 bytes.
Ā           – Check if the result is an empty string.
q          – Terminate the execution. Any other commands are ignored.
qĀ£ÉgDεγΔ – Mirror the part of the program that isn't otherwise removed
anyways. This part forgoes }JJ} because that substring will
always be trimmed by the algorithm anyway.

# Cubix, 54 bytes

U#;!u1@.Oi>??>i..??O.@1^^...u--u.u!ww;..#..U..;..;!^^!

Outputs nothing if the string is perfectly paired and 1 otherwise.
Try it here

### Cubified

      U # ;
! u 1
@ . O
i > ? ? > i . . ? ? O .
@ 1 ^ ^ . . . u - - u .
u ! w w ; . . # . . U .
. ; .
. ; !
^ ^ !

### Explanation

Most of the characters are filler needed to perfectly pair the code. Replacing those with . (no-op), we get

      U # ;
! u 1
@ . O
i . ? . > i . . ? . . .
. . ^ . . . . u - . . .
. . . w ; . . . . . . .
. ; .
. ; !
^ ^ !

This can be broken into three steps:

• Check against the empty string (the left i and the ?).
• Loop, throwing characters onto the stack and popping duplicates (everything on the bottom and right).
• Check if the stack is empty (the stuff at the top).

# V, 20, 18 bytes

òóˆ±òø‚

::‚øò±ˆóò

Try it online!

Hexdump:

00000000: f2f3 88b1 f2f8 820a 0a3a 3a82 f8f2 b188  .........::.....
00000010: f3f2                                     ..                   ....

Outputs 0 for truthy, 1 for falsy. Thanks to nmjcman101 for indirectly saving 2 bytes.

ò        ò        " Recursively...
ó                "   Remove...
<0x88>          "     Any printable ASCII character
±         "     Followed by itself
ø       " Count...
<0x82> "   The number of non-empty strings

::<0x82>øò±<0x88>óò      " NOP to ensure that the code is paired

• You could replace ^$ with . and return 0 for truthy, anything else for falsy? I'm a bit foggy on the rules after not doing this for a while. – nmjcman101 Jun 25 '18 at 19:05 • I think that would work except that the rules said You may output two distinct values one for the case where the input is perfectly paired and one for otherwise.. That does give me an idea though... – DJMcMayhem Jun 25 '18 at 19:06 # R, 142 126 bytes Tighter logic and some comment bytes golfed by @Giuseppe f=function(x,p="(.)\\1")"if"(grepl(p,x),f(sub(p,"",x)),!nchar(x))##x(rahcn!,x,,p(bus(f,)x,p(lperg("fi")"1\\).("=p,x(noitcnuf=f  Try it online! f=function(x,p="(.)\\1")"if"(nchar(x),"if"(grepl(p,x),f(sub(p,"",x)),0),1)##)1,)0,xp(bus(f,)x,p(lperg("fi",)x(rahcn("fi")"1).("=p,x(noitcnuf=f  Original: Try it online! Recursive detector function followed by comment with all the characters in the function in reverse order. • Your code currently throws an error. Here is a working version at 142 bytes. – ovs Jun 25 '18 at 20:09 • Thank you. Must have been a cut-and-paste mishap. – ngm Jun 25 '18 at 20:18 • 126 bytes -- you might be able to compress the comment some more as well... – Giuseppe Jun 26 '18 at 14:35 • I am wondering if \\ˋ will simplify or needs to be duplicated in the comments. – JayCe Jun 28 '18 at 2:03 • @JayCe you'd think it wouldn't need to be in the comments, but try this and it doesn't seem to work. I don't know why. – ngm Jun 28 '18 at 12:52 # APL (Dyalog), 38 bytes ''≡{'(.)\1'⎕R''⊢⍵}⍣≡⍝⍝≡⍣}⍵⊢R⎕'1\).('{≡  Try it online! # Retina, 28 26 bytes +(.)\1 C^$

O;;O:,B,,|,,>$,,*W  Try it online! Fun fact: This was 272 bytes long before the explanation was started, now it beats Java. Outputs True for perfectly balanced strings, and False otherwise To my great satisfaction, this beats the boring palindromize version by 2 bytes, to prevent the result being printed twice. I have also aimed to have as little dead code as possible, nevertheless there are still some commented-out sections, and the code exits with an error code of 1, after printing the correct value. NB : A bug with the BF commands was fixed while this answer was in development. ## How it works The code starts by defining the two key functions, $\mathit{ff}$ and $g$. These two functions are used to calculate the next step in the process of removing pairs, and work entirely from $\mathit{ff}$ i.e. only $\mathit{ff}$ is called from the main program, never $g$. If we define the input string as $S$, $\mathit{ff}(S)$ modifies $S$ in the following way: First, identical adjacent characters in $S$ are grouped together. For an example of $abbbaabacc$, this yields the array $[[a], [bbb], [aa], [b], [a], [cc]]$. Over each of the sublists (i.e. the identical groups), we run the function $g$, and replace the sublists with the result of the function. $g$ starts by unpacking the group, splatting the characters onto the stack. It then pushes the number of characters on the stack and takes the absolute difference with $2$ and that number. We'll call this difference $x$. Lets see how this transforms the respective inputs of $[a]$, $[bb]$ and $[ccc]$: $$[a] \Rightarrow [a, 1]$$ $$[bb] \Rightarrow [b, b, 0]$$ $$[ccc] \Rightarrow [c, c, c, 1]$$ As you can see $x$ indicates how many of the next character we wish to keep. For simple pairs, we remove them entirely (yielding 0 of the next character), for lone characters we leave them untouched, or yield 1 of them, and for groups where $x > 2$, we want $x - 2$ of the character. In order to generate $x$ of the character, we repeat the character with *, and the function naturally returns the top element of the stack: the repeated string. After $g(s)$ has been mapped over each group $s$, we splat the array to the stack to get each individual result with BF. Finally, the ^ flag at the function definition (D,ff,@^^,) tells the return function to concatenate the strings in the stack and return them as a single string. For pairs, which yielded the empty string from $g$, this essentially removes them, as the empty string concatenated with any string $r$ results in $r$. Anything after the two ;; is a comment, and is thus ignored. The first two lines define the two functions, $\mathit{ff}$ and $g$, but don't execute $\mathit{ff}$ just yet. We then take input and store it in the first of our 4 variables. Those variables are: • $\mathit{xx}$ : The initial input and previous result of applying $\mathit{ff}$ • $\mathit{yy}$ : The current result of applying $\mathit{ff}$ • $\mathit{aa}$ : The loop condition • $\mathit{bb}$ : Whether $\mathit{yy}$ is truthy As you can see, all variables and functions (aside from $g$) have two letter names, which allows them to be removed from the source code fairly quickly, rather than having a comment with a significant amount of $\mathit{xyab}$. $g$ doesn't do this for one main reason: If an operator, such as €, is run over a user defined function $\mathit{abc}$, the function name needs to be enclosed in {...}, so that the entire name is taken by the operator. If however, the name is a single character, such as $g$, the {...} can be omitted. In this case, if the function name was $\mathit{gg}$, the code for $\mathit{ff}$ and $g$ would have to change to D,gg,@~~,L2_|*;;*|_2L,@D (NB: -2 bytes) D,ff,@^^,BG€{gg}BF;;FB}gg{€GB,@D?: (NB: +6 bytes)  which is 4 bytes longer. An important term to introduce now is the active variable. All commands except assignment assign their new value to the active variable and if the active variable is being operated on, it can be omitted from function arguments. For example, if the active variable is $x = 5$, then we can set $x = 15$ by x+10 ; Explicit argument +10 ; Implicit argument, as x is active  The active variable is $x$ by default, but that can be changed with the  command. When changing the active variable, it is important to note that the new active variable doesn't have to exist beforehand, and is automatically assigned as 0. So, after defining $\mathit{ff}$ and $g$, we assign the input to $\mathit{xx}$ with xx:?. We then need to manipulate our loop conditions ever so slightly. First, we want to make sure that we enter the while loop, unless $\mathit{xx}$ is empty. Therefore, we assign a truthy value to $\mathit{aa}$ with aa:1, the shortest such value being $1$. We then assign the truthiness of $\mathit{xx}$ to $\mathit{bb}$ with the two lines bb Bxx  Which first makes $\mathit{bb}$ the active variable, then runs the boolean command on $\mathit{xx}$. The respective choices of $\mathit{aa} := 1$ and $\mathit{bb} := \neg \neg \mathit{xx}$ matter, as will be shown later on. Then we enter our while loop: Waa*bb,yy,$ff>xx,aa,xx|yy,bb,Byy,xx:yy

A while loop is a construct in Add++: it operates directly on code, rather than variables. Constructs take a series of code statements, separated with , which they operate on. While and if statements also take a condition directly before the first , which consist of a single valid statement, such as an infix command with variables. One thing to note: the active variable cannot be omitted from the condition.

The while loop here consists of the condition aa*bb. This means to loop while both $\mathit{aa}$ and $\mathit{bb}$ are truthy. The body of the code first makes $\mathit{yy}$ the active variable, in order to store the result of $\mathit{ff}(x)$. This is done with

yy,$ff>xx  We then activate our loop condition $\mathit{aa}$. We have two conditions for continued looping: • 1) The new value doesn't equal the old value (loop while unique) • 2) The new value isn't the empty string One of Add++'s biggest drawbacks is the lack of compound statements, which necessitates having a second loop variable. We assign our two variables: $$\mathit{aa} := \mathit{xx} \neq \mathit{yy}$$ $$\mathit{bb} := \neg \neg (\mathit{yy})$$ With the code aa,xx|yy,bb,Byy  Where | is the inequality operator, and B converts to boolean. We then update the $\mathit{xx}$ variable to be the $\mathit{yy}$ variable with xx:yy, in preperation for the next loop. This while loop eventually reduces the input into one of two states: the empty string or a constant string, even when applied to $\mathit{ff}$. When this happens, either $\mathit{aa}$ or $\mathit{bb}$ result in False, breaking out of the loop. After the loop is broken, it can break for one of two reasons, as stated above. We then output the value of $\mathit{aa}$. If the loop was broken due to $\mathit{x} = \mathit{y}$, then both the output and $\mathit{aa}$ are False. If the loop was broken because $\mathit{yy}$ was equal to the empty string, then $\mathit{bb}$ is falsy and $\mathit{aa}$ and the output are truthy. We then reach our final statement: O  The program can now be in one of three states, in all of which the active variable is $\mathit{bb}$: • 1) The input was empty. In this case, the loop didn't run, $\mathit{aa} = 1$ and $\mathit{bb} = \mathrm{False}$. The correct output is $\mathrm{False}$. • 2) The input was perfectly balanced. If so, the loop ran, $\mathit{aa} = \mathrm{True}$ and $\mathit{bb} = \mathrm{False}$. The correct output is $\mathrm{False}$ • 3) The input was not perfectly balanced. If so, the loop ran, $\mathit{aa} = \mathrm{False}$ and $\mathit{bb} = \mathrm{True}$. The correct output is $\mathrm{True}$ As you can see, $\mathit{bb}$ is equal to the expected output (albeit reversed from the logical answer), so we simply output it. The final bytes that help us beat Java come from the fact that $\mathit{bb}$ is the active variable, so can be omitted from the argument, leaving us to output either $\mathrm{True}$ or $\mathrm{False}$, depending on whether the input is perfectly balanced or not. # JavaScript (ES6), 76 bytes Returns a boolean. ff=ss=>ss==(ss=ss.replace(/(.)\1/,''))?!ss:ff(ss)//)(:!?,/1\).(/(ecalper.=(>  Try it online! Suggested by @Shaggy: 58 bytes by returning an empty string for perfectly paired or throwing an error otherwise. • If one of the "return values" can be an error (waiting for confirmation on that) then this could be 66 bytes. – Shaggy Jun 25 '18 at 17:31 • Programs can by default output via exit code. In this answer's particular case, the possible outputs would be exit code 0 for perfectly paired strings and exit code 1 for non-perfectly paired strings, which are two distinct values therefore fulfilling the criteria; so the 58 byter must be perfectly valid. – Mr. Xcoder Jun 25 '18 at 18:50 # Wolfram Language (Mathematica), 70 64 bytes {#//.{aa___,bb__,bb_,cc___}:>{aa,cc}}=={{}}(**(,{>:}_,{.#{&)**)&  Try it online! ### Without comments, 92 bytes ((#//.bb_:>StringReplace[00[ecalpeRgnirtS>aa__:_.#&];bb,{{,}};00>00;00;aa:_~~aa_:>""]))==""&  Try it online! # Lua, 178 bytes p=...S={}for a in p:gmatch"."do E=S[#S]~=a;S[E and#S+1 or#S]=E and a or X end;print(#S==0)--)0S#(tnirp;dne X ro a dna E=]S#ro 1+S#dna E[S;a=~]S#[S=E od"."hctamg:p ni a rof}{=S.=p  Try it online! While it is a terribly long solution, this does make quite a bit of use of Lua-specific quirks. This is actually a minified brute force stack algorithm. The program is made complicated by the fact that Lua's patterns don't allow replacing pairs and regex is not built in. Explanation: p=... -- command-line argument S={} -- the stack for c in p:gmatch"." do -- shorter than "for i=1,#p do ..." E=S[#S]~=c -- check whether we have the right letter on top of stack -- could've saved some bytes by doing == instead of ~= -- but the double negation is necessary for ternary operator -- to work with nil values S[E and #S+1 or #S]=E and c or X -- Lua's awesome "ternary operator" end -- i'm sure there is a better way to output this (table indexing?) print(#S==0)  # Gol><>, 30 bytes 1ll1**F:}}:{=Q{~~||lzBBzl{Q={F  Try it online! Everything after the first B is excess code and is not executed. A function that returns the top of stack as 1 if the input is a perfect pairing, 0 otherwise. ### Explanation: 1 Push 1 as the end string marker ll1** Push n, where n (len+1)*(len+2), This is larger than the amount of steps needed to determine pairing F | Repeat that many times :}}:{= Compare the first two characters of the string Q | If they are equal {~~ Pop both of them String is also rotated by 1 If the string becomes empty, the 1 is compared to itself and removed. lzB Return whether the length of the stack is 0 Bzl{Q={F Excess code to match unpaired symbols  # Haskell, 92 bytes gg"" gg((aa:cc:bb))dd|aa==cc=gg bb dd gg aa""=""==aa gg aa((bb:c))=gg((bb:aa))c--c:=c:|  Try it online! @nimi's answer is pretty cool, it doesn't use any comments. This one is shorter but does use a comment. @xnor's answer is also pretty cool, it does use comments and is shorter than this one. # Python 2, 114 bytes import re e=lambda i,nn=1:e(*re.subn('(.)\\1','',i))if nn else''==i##ieslef'1).('(nbus.er*(e:1=,i adbmal=r tropmi  Try it online! Returns True for perfectly-paired strings, False otherwise. (Actually fails to verify itself, because (.) won't match the newlines in the code! But @Cat Wizard said this is okay, because newlines aren't printable ASCII characters, so my program needn't handle them.) This is a perfectly-paired version of: import re;p=lambda s,n=1:p(*re.subn('(.)\\1','',s))if n else''==i  for which a “lazier” perfectization of code + '##' + f(code[::-1]) would give 120 bytes. (That is, renaming the variables etc. to introduce more collapsed pairs inside the comment half of the code saved 6 bytes.) re.subn is a little-known variant of re.sub that returns a tuple (new_string, number_of_substitutions_made). It's pretty good for finding regex substitution fixpoints! # Jelly, 26 24 22 bytes ẠƬµF€ḂLḣgŒŒgḣLḂ$$€FµƬẠ  Try it online! Weirdly seems to work without moving the backwards code to an unused link. Returns 0 if the input is perfectly paired, 1 otherwise. Active code: ŒgḣLḂ$$€FµƬẠ Œg Group runs 'abbbcc'->['a','bbb','cc'] € For each of these strings:$       Monad{
L                  Find the length...
Ḃ                 ...mod 2.
} -> [1, 1, 0] in this example.
ḣ               Take this many characters from the string.
} -> [['a'], ['b'], []]
F     Flatten -> ['a', 'b']
Ƭ   Repeat...
µ    The last monadic chain until a fixed point is reached.
Ạ  All. If it is not a perfectly paired string, all elements in the
result of Ƭ will be nonempty and 1 is returned.
If it is perfectly paired, the last element is [] which is falsy
and 0 is returned.

# Attache, 82 bytes

{0=#Fixpoint[{Replace[_,/"(.)\\1",""]},_]}??}]_,}],"1).("/,_[ecalpeR{[tniopxiF#=0{

Try it online!

Nothing incredible here. Fixpoints a function which removes consecutive pairs.

# Java 8, 158156 154 bytes

n->{for(;n.matches(".*(.)\\1.*");n=n.replaceAll("(.)\\1",""));return  n.isEmpty();}//};)(ytpmEsi.ruter;,"1).("(Aecalper.n=n;)"*.1).(*."(sehctam.n;(rof{>-n

Returns a boolean (true/false).

-2 bytes thanks to @raznagul.

Try it online.

Explanation:

n->{                              // Method with String parameter and boolean return-type
for(;n.matches(".*(.)\\1.*");   //  Loop as long as the String still contains pairs
n=n.replaceAll("(.)\\1","")); //   Remove all pairs
return  n.isEmpty();}           //  Return whether the String is empty now
//};)(ytpmEsi.ruter;,"1).("(Aecalper.n=n;)"*.1).(*."(sehctam.n;(rof{>-n
// Comment reversed of the source code,
// minus the pairs: '\\';'ll';'\\';'""))';'n  n';'//'

• By renaming s to n and adding a second space to return s.isEmpty you can remove s n` from the comment, saving 2 bytes in total. – raznagul Jun 26 '18 at 15:36


text:
+0

# Factoring

0
74
1

Factor x^8 - y^8 as the product of four polynomials of degree 1, each of which has a positive coefficient of x.

Jun 22, 2021

#1
+785
+1

\begin{align*} x^8 - y^8 &= (x^4)^2 - (y^4)^2 \\ &= (x^4 - y^4)(x^4 + y^4) \\ &= ((x^2)^2 - (y^2)^2)(x^4 + y^4) \\ &= (x^2 - y^2)(x^2 + y^2)(x^4 + y^4) \\ &= (x-y)(x+y)(x^2 + y^2)(x^4 + y^4) \end{align*}

Can you take it from here?

Hint: Manipulate $x^2 + y^2$ into $(x+y)^2 - 2xy$ and do the same thing with $x^4 + y^4.$ You can substitute your equation for $x^2 + y^2$ and do some further manipulation and you are done. If you have degrees $>1,$ you can square root it.

Jun 22, 2021


text:
# How to test the difference in two proportions when the outcomes aren't binary?

An e-commerce website is testing two different designs for a checkout page. Customers who visit the checkout page are randomly presented with one of the two designs.

The first metric of interest, sales uplift, can be measured by comparing the proportion of customers that finalized the sale (a binary outcome) for each of the two designs.

It is reasonably straightforward to compare these using a test for two proportions.

A second metric of interest is the dollar conversion. This is the final dollar value of the sale, as a proportion of the initial dollar value of the incoming shopping cart.

For example: A customer comes to the checkout page with \$160 worth of items in the cart (initial value). The customer removes some items from the cart and finalizes the sale for \$40 worth of items (final value). The sales conversion is 100% (we still sold the customer something), but the dollar conversion is only 25%.

How can I properly test the difference in dollar conversion for the two groups against a null hypothesis of no difference?

See below for some R code specifying the problem:

# example data
set.seed(1)
total_customers <- 1000
target_control <- rbinom(total_customers, 1, 0.5)
sale_success <- rbinom(total_customers, 1, 0.1)
initial_value <- rexp(total_customers, rate=0.1)
final_value <- runif(total_customers, 0, 1.1) * initial_value * sale_success
sales_data <- data.frame(target_control, sale_success, initial_value, final_value)

# sales conversion - test for two proportions (two-tailed)
n1 <- sum(target_control)
n2 <- sum(!target_control)
p1 <- sum(sales_data[target_control==1,"sale_success"])/n1
p2 <- sum(sales_data[target_control==0,"sale_success"])/n2
pbar <- (p1*n1+p2*n2)/(n1+n2)
z <- (p1-p2)/sqrt(pbar*(1-pbar)/n1+pbar*(1-pbar)/n2)
pval <- 2*(1-pnorm(abs(z)))

# dollar conversion - ??
p1 <- sum(sales_data[target_control==1,"final_value"])/sum(sales_data[target_control==1,"initial_value"])
p2 <- sum(sales_data[target_control==0,"final_value"])/sum(sales_data[target_control==0,"initial_value"])

Some things to consider:

• Initial value & final value are correlated
• Initial value & final value both follow a long-tailed distribution, e.g. the negative exponential distribution
• Sometimes final value will be greater than initial value, e.g. the customer adds more to the cart before finalizing the sale
• Sale success & initial value are correlated, but I haven't specified this in the example code

Update 1: Brumar has suggested that the customer-level change in behavior, for those customers who do finalize a sale, can be compared using a Wilcoxon rank-sum test:

sales_data\$ratios=final_value/initial_value ratios_A=sales_data\$ratios[sale_success==1 & target_control==0]
ratios_B=sales_data\$ratios[sale_success==1 & target_control==1] wilcox.test(ratios_A,ratios_B)  I'm still interested to know if there is any way to compare the difference in the overall dollar conversion, i.e. the sum of final values over the sum of initial values? Update 2: Solved by Brumar. # permutation test (two-tailed) p1 <- sum(sales_data[target_control==1 & sale_success==1,"final_value"])/sum(sales_data[target_control==1 & p2 <- sum(sales_data[target_control==0 & sale_success==1,"final_value"])/sum(sales_data[target_control==0 & yourGap<-p1-p2 L<-sales_data[,"target_control"]==1 LfilterOnlyBuyers<-sales_data[,"sale_success"]==1 nulldist <- vector(mode="numeric", length=10000) for ( i in 1:10000) { Lperm <- sample(L) LpermInv <- !Lperm & LfilterOnlyBuyers Lperm <- Lperm & LfilterOnlyBuyers p1_perm <- sum(sales_data[Lperm,"final_value"])/sum(sales_data[Lperm,"initial_value"]) p2_perm <- sum(sales_data[LpermInv,"final_value"])/sum(sales_data[LpermInv,"initial_value"] ) nulldist[i] = p1_perm-p2_perm } pvalue=sum(abs(nulldist) > yourGap)/10000 alpha=0.05 ci_upper <- yourGap + quantile(nulldist, (1-alpha/2)) ci_lower <- yourGap - quantile(nulldist, (1-alpha/2))  ## 1 Answer The first part seems indeed reasonable. Concerning the second part, I think these ratios can't be handled as proportions because they are not related to binary events, this imply that we have no clue how these ratios are distributed, which excludes z-test (well unless you have a lucky empirical normal distribution, but you mentioned to have not). First Proposition : Wilcoxon test. My suggestion would be to simply compare these ratios by a wilcoxon test. >sales_data$ratios=final_value/initial_value
>ratios_A=sales_data$ratios[sale_success==1 & target_control==0] >ratios_B=sales_data$ratios[sale_success==1 & target_control==1]
>wilcox.test(ratios_A,ratios_B)

Thinking twice on it, this test treat "1 dollar bought for 5 dollars" selected the same as "100 dollars bought for 500 dollars selected". I can understand why you want to avoid it and favor your overall ratio.

Second Proposition : Permutation test.

In order to keep your measure, what I would suggest then is to craft "your own test" with a permutation test. Under the null hypothesis being in random or treatment group makes no difference. Then, the idea is to randomly relabel which subjects are in the control or treatment group and count how many times a randomized permutation grant an equal or better gap between control and treatment group than the one you initially measure. This gap is measured by the difference of your ratio between the two groups. If you divide this number of success by the number of trials, it gives a p-value.

p1 <- sum(sales_data[target_control==1,"final_value"])/sum(sales_data[target_control==1,"initial_value"])
p2 <- sum(sales_data[target_control==0,"final_value"])/sum(sales_data[target_control==0,"initial_value"])
yourGap<-abs(p1-p2)
L<-sales_data["target_control"]==1

count=0
for ( i in 1:10000) {
Lperm=sample(L)
if (abs(p1_perm-p2_perm)>=yourGap) {
count=count+1
}
}
pvalue=count/10000

Use absolute values when your compute your gap if you want to two-tail test.

In this permutation test, as in the wilcoxon I suggested, I filtered out non-buyers. The idea behind it is that you don't want that the first hypothesis you tested comes into a play here. You may prefer to separate both assumptions 1)they buy less/more often 2)when they buy it's closer/farther than the initial amount selected.

• Thank you for your answer. If I understand correctly, this approach separates out those customers who did finalize the sale, and asks whether there was a change in behaviour for these customers. This is a useful way to look at the problem, and something I hadn't properly considered. It would still be interesting to know, is there some way to test the difference in the overall dollar conversion? That is, the sum of finalized sales over the sum of initial values? Jun 24 '15 at 3:43
• Thanks for your comment. I had a second look on your question and edited my answer with a new solution. I also explain why I selected buyers, even if I see you picked that up properly. Jun 24 '15 at 6:25
• Oh! Very interesting :) I made a few changes and have added the updated code to the question - 1. p1 & p2 need to filter for only buyers as well; 2. your syntax for setting L and LfilterOnlyBuyers didn't work for me; 3. filtering for buyers needs to happen after the inversion of Lperm. Also, if I understand correctly, I can store the distribution and use the quantiles of the distribution to create a conifdence interval? Jun 24 '15 at 23:34
• Oh ! indeed, thanks for having picked up my mistakes. I have also updated my answer then. I don't think you can put the distribution of the null around your value. Maybe you mixed things up with the bootstraping procedure, which could indeed allow the computation of a confidence interval. Another note : I think that for a two-tailed test, yourGap must be an absolute value too (if it's negative you have no chance to reject the null). Jun 25 '15 at 6:46
• @brumar could you have a look here ? thx ! stats.stackexchange.com/questions/398436/… Mar 20 '19 at 20:34


text:
# Print only existing footnotes / suppress empty footnotes

This is a follow-up to my earlier question Merge separate footnotes into text.

I now have a similar case, where I need to check whether there actually are footnotes relating to a particular number:

\documentclass[a4paper]{article}

\usepackage{lipsum}
\newcommand{\mylips}[1]{\printfootnote#1 \lipsum[#1]}

\def\printfootnote#1{\footnote{\csname extfootnote#1\endcsname}}
\def\definefootnote#1 #2\endfootnote{%
\expandafter\def\csname extfootnote#1\endcsname{#2}}
\input{footnotefile}

\begin{document}
\mylips{1}
\mylips{2}
\mylips{3}
\mylips{4}
\mylips{5}
\mylips{6}
\mylips{7}
\end{document}

footnotefile.tex would be

\definefootnote1 Some footnote\endfootnote
\definefootnote3 Another footnote\endfootnote
\definefootnote7 And another footnote\endfootnote

The challenge is that I don't want the empty notes to appear at all.

How would I write a test for whether the result of a certain \printfootnote\arabic{somecounter} will be empty?

-

Well, your \printfootnote should check whether the footnote was defined:
\def\printfootnote#1{%


text:
# Can't seem to figure out how to solve for C! Diff EQ question

1. Jan 14, 2006

### mr_coffee

Hello everyone i'm stuck, i got right to the end of this intial value problem and it doens't seem to want to work.

Solve the separable differential equation for u
{du}/{dt} = e^{3 u + 10 t}.
Use the following initial condition: u(0) = 6.
u = ?

I might have screwed up here:
du = e^(3u)*e^(10*t) dt
I took the ln of both sides but can u take the ln of du? thats where i might have screwed up, if it is, what do u suggest?

Here is my work:

I tried this and it was wrong, i also tried the answers of 1, ln(5), also was wrong, any ideas on where i screwed up? also the problem says find U, not C, but i don't think i have my C right, once i find the correct C, then do i plug it into one of the equations above invovling C? Like this:
u = (e^(10*t^2/2)+e^(ln(5)/3))^3; This is also incorrect i just submitted!
Thjanks!

Last edited: Jan 14, 2006
2. Jan 14, 2006

### Pyrrhus

How does

$$du =e^{3u} e^{10t} dt$$

goes to

$$du = 3u10t dt$$

3. Jan 14, 2006

### benorin

Here you go, the easy way

Solve the separable differential equation for u:

$$\frac{du}{dt} = e^{3u + 10t}$$

Use the following initial condition: u(0) = 6.

Rearranging the given differential equation gives

$$e^{-3u}du= e^{10t}dt$$

integrate both sides

$$\int e^{-3u}du = \int e^{10t}dt$$

to get

$$-\frac{1}{3}e^{-3u} = \frac{1}{10}e^{10t} +C$$

solving for u gives

$$u(t)=-\frac{1}{3}\ln \left( -\frac{3}{10}e^{10t}-3C\right)$$

to solve for the value of C that satisfies the initial condition u(0)=6 (the easy way,) substitute t=0 and u(0)=6 into

$$-\frac{1}{3}e^{-3u} = \frac{1}{10}e^{10t} +C$$

to get

$$-\frac{1}{3}e^{-3(6)} = \frac{1}{10}e^{10(0)} +C$$

which simplifies to

$$-\frac{1}{3}e^{-18} = \frac{1}{10} +C$$

yielding

$$C= -\frac{1}{10} -\frac{1}{3}e^{-18}$$

so the particular solution is

$$u(t)=-\frac{1}{3}\ln \left( -\frac{3}{10}e^{10t}-3\left( -\frac{1}{10} -\frac{1}{3}e^{-18} \right) \right) = -\frac{1}{3}\ln \left( -\frac{3}{10}e^{10t}+\frac{3}{10} +e^{-18} \right)$$

4. Jan 14, 2006

### d_leet

Yea that's waht I was wondering as well. Taking the natural log when you did is really not advisable, and doesn't help because you get ln(du) which is just going to make things harder for you. You started out pretty well changin the sum in the exponent into the product, but you should notice then that the equation is seperable and fairly simple to integrate once you seperate it.

5. Jan 14, 2006

### mr_coffee

Thank you everyone for your tips and yes Benion that is exactly what i got too after redoing it! thanks everyone! :)


text:
• Volume 120, Issue 3

June 2010,   pages  259-394

• Zero-Sum Problems with Subgroup Weights

In this note, we generalize some theorems on zero-sums with weights from [1], [4] and [5] in two directions. In particular, we consider $\mathbb{Z}^d_p$ for a general 𝑑 and subgroups of $Z^∗_p$ as weights.

• Theta Function Identities Associated with Ramanujan's Modular Equations of Degree 15

We present alternative proofs of some of Ramanujan’s theta function identities associated with the modular equations of composite degree 15. Along the way we also find some new theta-function identities. We also give simple proofs of his modular equations of degree 15.

• Power Cocentralizing Generalized Derivations on Prime Rings

Let 𝑅 be a prime ring, 𝑈 the Utumi quotient ring of $R,C=Z(U)$ the extended centroid of 𝑅,𝐿 a non-central Lie ideal of 𝑅,𝐻 and 𝐺 non-zero generalized derivations of 𝑅. Suppose that there exists an integer $n≥ 1$ such that $(H(u)u-uG(u))^n=0$, for all $u\in L$, then one of the following holds: (1) there exists $c\in U$ such that $H(x)=xc,G(x)=cx;(2)R$ satisfies the standard identity $s_4$ and char (𝑅)=2; (3) 𝑅 satisfies $s4$ and there exist $a, b, c\in U$, such that $H(x)=ax+xc,G(x)=cx+xb$ and $(a-b)^n=0$.

• The Atiyah Bundle and Connections on a Principal Bundle

Let 𝑀 be a 𝐶 manifold and 𝐺 a Lie a group. Let $E_G$ be a 𝐶 principal 𝐺-bundle over 𝑀. There is a fiber bundle $\mathcal{C}(E_G)$ over 𝑀 whose smooth sections correspond to the connections on $E_G$. The pull back of $E_G$ to $\mathcal{C}(E_G)$ has a tautological connection. We investigate the curvature of this tautological connection.

• Some Equivalent Multiresolution Conditions on Locally Compact Abelian Groups

Conditions under which a function generates a multiresolution analysis are investigated. The definition of the spectral function of a shift invariant space is generalized from $\mathbb{R}^n$ to a locally compact abelian group and the union density and intersection triviality properties of a multiresolution analysis are characterized in terms of the spectral functions. Finally, all multiresolution analysis conditions are characterized in terms of the scaling and the spectral functions.

• Eigenvalue Estimates of Positive Integral Operators with Analytic Kernels

In this paper, we exhibit canonical positive definite integral kernels associated with simply connected domains. We give lower bounds for the eigenvalues of the sums of such kernels.

• Regularity of the Interband Light Absorption Coefficient

In this paper we consider the interband light absorption coefficient (ILAC), in a symmetric form, in the case of random operators on the 𝑑-dimensional lattice. We show that the symmetrized version of ILAC is either continuous or has a component which has the same modulus of continuity as the density of states.

• Critical Age-Dependent Branching Markov Processes and their Scaling Limits

This paper studies: (i) the long-time behaviour of the empirical distribution of age and normalized position of an age-dependent critical branching Markov process conditioned on non-extinction; and (ii) the super-process limit of a sequence of age-dependent critical branching Brownian motions.

• On Short Wave Stability and Sufficient Conditions for Stability in the Extended Rayleigh Problem of Hydrodynamic Stability

We consider the extended Rayleigh problem of hydrodynamic stability dealing with the stability of inviscid homogeneous shear flows in sea straits of arbitrary cross section. We prove a short wave stability result, namely, if $k>0$ is the wave number of a normal mode then $k>k_c$ (for some critical wave number $k_c$) implies the stability of the mode for a class of basic flows. Furthermore, if $K(z)=\frac{-({U''}_0-T_0{U'}_0)}{U_0-U_{0s}}$, where $U_0$ is the basic velocity, $T_0$ (a constant) the topography and prime denotes differentiation with respect to vertical coordinate 𝑧 then we prove that a sufficient condition for the stability of basic flow is $0 < K(z)≤\left(\frac{𝜋^2}{D^2}+\frac{T^2_0}{4}\right)$, where the flow domain is $0≤ z≤ D$.

• # Proceedings – Mathematical Sciences

Current Issue
Volume 127 | Issue 4
September 2017


text:
# Foreword on working directory, data and packages

The Data for this tutorial are provided via Github. In order to reproudce the code with your own data, replace the url with your local filepath

If you work locally, you may define the working directory

setwd("YOUR/FILEPATH")
# this will not work. if you want to use it, define a path on your computer

This should be the place where your data and other folders are stored. more Information can be found here

Code chunks for saving data and results are disabeled in this tutorial (using a #). Please replace (“YOUR/FILEPATH”) with your own path.

The code is written in such a way, that packages will be automatically installed (if not already installed) and loaded. Packages will be stored in the default location of your computer.

# Intro

Using rmarkdown you can reproduce your r code and export the results as a report in various formats (html, word, pdf). First, you need to create a markdown file (.rmd). This can be done by clicking file -> New document –> and the selecting R Markdown. Then you add your code plus additional Information. Alternatively you open an existing .rmd file.

R Studio offers a good cheat sheet to get started.

if (!require(rmarkdown)){install.packages("rmarkdown"); library(rmarkdown)}

# Basic syntax or inline formatting

rmarkdown as a number of expressions that define the basic structure of the document:

Use an asterisk (*) for emphasis, such as italics or double asterisk for bold.

Tildes (~) turn text to a subscript, for example useful when writing chemical formulas: CO2, NO2, H3PO4.

Inline code can be highlighted by usage of backticks: There were nrow(cars) cars studied. It will return the number of rows of the dataset cars.

Hyperlinks can be inserted by usage of the following syntax: [linked phrase](http://example.com).

Images are loaded similarily. Simply add an exclamation mark. Be careful with backslashes and add the file format of the image. Images can bes stored locally or on the web.

![Example of a local image]((https://www.fossgis.de/w/images/thumb/3/3a/Entwurf_fossgis2020-sticker-rund.png/600px-Entwurf_fossgis2020-sticker-rund.png)

Images from URL not possible when using Latex -_> Downlad image instead and load from local Folder.

For footnotes use square brackets after a caret ^[], e.g. this example 1. The footnote also works as a hyperlink.

# Block level elements

The hashtag # at the beginning of a line implements a header. The number of hashtags also defines the level of the header; one being a first order header, two for second order headers etc. To exclude the number from the header (as in H3-H6), add {-} to header.

# H1

## Lists

Unordered lists can be started with *, -, or +. Through indenting, one list can be nested in another.

• one item
• one item
• one item
• one more item
• one more item
• one more item

Ordered lists start with numbers and may also be nested through indenting.

1. the first item
2. the second item
3. the third item
• unordered item
1. sub item

## Quotes

To start quotes, use the > sign:

“Without a systematic way to start and keep data clean, bad data will happen.”

— Donato Diorio

## Tables

Markdown does not provide any special syntax for tables . Instead, HTML syntax is used. Simple tables separate columns with the | symbol and headers from content cells with the --- symbols.

Content Cell Content Cell
Content Cell Content Cell

To create nicely looking tables, it is easiest to use a table generator. Here you can customize your table as you would in Excel. Then you can copy and paste the generated code to yor markdwon file:

R-Package Dependencies
geonames
ncdf4
geosphere
devtools/tamboRapi
dismo
eurostat
owmr
rdwd
rnoaa
futureheatwaves
HiClimR
rWBclimate
rWind
SCI
iki.dataclim
rvest

# Math expressions

Math expressions such as formulas can be written by using the LaTeX syntax. It is started by a pair of dollar signs. LaTex is an open source typesetting system. It is somewhat similar to markdown but with arguably more complex capabilities to convert plain text files into high-quality documents. Since we will not use LaTex in this course, only this brief introduction and a couple of examples for Latex’s math mode are given:

Square root $\sqrt{x+y}$

Integral $\int\limits^{b}_{a} f(x) dx$

Greek letters $\pi \Phi \varepsilon$

The possibility of including your R code in a markdown document is a very powerful option and the main reason why we use it. You can turn yor analysis in r into high quality documents, reports or even presentations. The documents (and therefore your produced text output, tables, or graphics) are fully reproducible which is also very important when communicating your code or results.

You can simply embed your r code in in a markdwon document and it will be executed. You simply need to tell RStudio that the following chunk is to be treated as R code. This is done by using  in between curly braces and by specifying that r sytax is used.

{r}

End the code chunk with . In between you can insert your r code:

There are a lot of things you can do in a code chunk: you can produce text output, tables, or graphics. You have fine control over all these output via chunk options, which can be provided inside the curly braces. This is in order to modify the output of the document. By default, the code, all outputs in the console and the viewer will be included in the markdown document:

# plot simple map of the happy planet index from the data of the tmap package
if (!require(tmap)){install.packages("tmap"); library(tmap)}
## Lade nötiges Paket: tmap
## Warning: Paket 'tmap' wurde unter R Version 3.6.2 erstellt
data("World")
str(World)
## Classes 'sf' and 'data.frame':   177 obs. of  16 variables:
##  $iso_a3 : Factor w/ 177 levels "AFG","AGO","ALB",..: 1 2 3 4 5 6 7 8 9 10 ... ##$ name        : Factor w/ 177 levels "Afghanistan",..: 1 4 2 166 6 7 5 56 8 9 ...
##  $sovereignt : Factor w/ 171 levels "Afghanistan",..: 1 4 2 159 6 7 5 52 8 9 ... ##$ continent   : Factor w/ 8 levels "Africa","Antarctica",..: 3 1 4 3 8 3 2 7 6 4 ...
##  $area :Object of class units: ## num 652860 1246700 27400 71252 2736690 ... ## ..- attr(*, "units")=List of 2 ## .. ..$ numerator  : chr  "km" "km"
##   .. ..$denominator: chr ## .. ..- attr(*, "class")= chr "symbolic_units" ##$ pop_est     : num  28400000 12799293 3639453 4798491 40913584 ...
##  $pop_est_dens: num 43.5 10.3 132.8 67.3 15 ... ##$ economy     : Factor w/ 7 levels "1. Developed region: G7",..: 7 7 6 6 5 6 6 6 2 2 ...
##  $income_grp : Factor w/ 5 levels "1. High income: OECD",..: 5 3 4 2 3 4 2 2 1 1 ... ##$ gdp_cap_est : num  784 8618 5993 38408 14027 ...
##  $life_exp : num 59.7 NA 77.3 NA 75.9 ... ##$ well_being  : num  3.8 NA 5.5 NA 6.5 4.3 NA NA 7.2 7.4 ...
##  $footprint : num 0.79 NA 2.21 NA 3.14 2.23 NA NA 9.31 6.06 ... ##$ inequality  : num  0.427 NA 0.165 NA 0.164 ...
##  $HPI : num 20.2 NA 36.8 NA 35.2 ... ##$ geometry    :sfc_MULTIPOLYGON of length 177; first list element: List of 1
##   ..$:List of 1 ## .. ..$ : num [1:69, 1:2] 5310471 5408503 5470647 5477147 5541607 ...
##   ..- attr(*, "class")= chr  "XY" "MULTIPOLYGON" "sfg"
##  - attr(*, "sf_column")= chr "geometry"
##  - attr(*, "agr")= Factor w/ 3 levels "constant","aggregate",..: NA NA NA NA NA NA NA NA NA NA ...
##   ..- attr(*, "names")= chr  "iso_a3" "name" "sovereignt" "continent" ...
tm_shape(World) +
tm_polygons("HPI")

The ## show the output of the console. readers might not be interested in this information, nor the code youu use. The following commands specify the appearance of your document:

• include = FALSE prevents code and results from appearing in the finished file. R Markdown still runs the code in the chunk, and the results can be used by other chunks.
• echo = FALSE prevents code, but not the results from appearing in the finished file. This is a useful way to embed figures.
• message = FALSE prevents messages that are generated by code from appearing in the finished file.
• warning = FALSE prevents warnings that are generated by code from appearing in the finished.
• fig.cap = “…” adds a caption to graphical results.

A full list of chunk options can be found in the R MarkdownReference Guide

## Chunk options

Only show results

Options for figures might also be very useful:

## Using other languages in R MArkdown

R Markdown supports many other languages such as sql, python and css. Most of the language engines are loaded via the knitr package. A full list of languag engines can be found here.

names(knitr::knit_engines$get()) if (!require(reticulate)){install.packages("reticulate"); library(reticulate)} use_python("C:/Python27/ArcGIS10.6/python") # depends where you have installed Python scipy <- import("Numpy") scipy$amin(c(1,3,5,7))
x <- 42
print(x)

For a python chunk to be executed we need to specify the location of the python engine. We can use the one that comes with ArcGIS. It may be stored somewhere else on your computer. You may also need to install python first….

{python} #x = 42 * 2 #print(x)  For more info on wheter to chose python over R check the “Data Science Wars: R vs Python”. ——-End——-

1. This is a footnote.↩

Previous


text:
# Cramer's rule explained

In linear algebra, Cramer's rule is an explicit formula for the solution of a system of linear equations with as many equations as unknowns, valid whenever the system has a unique solution. It expresses the solution in terms of the determinants of the (square) coefficient matrix and of matrices obtained from it by replacing one column by the column vector of right-hand-sides of the equations. It is named after Gabriel Cramer (1704 - 1752), who published the rule for an arbitrary number of unknowns in 1750,[1] [2] although Colin Maclaurin also published special cases of the rule in 1748[3] (and possibly knew of it as early as 1729).[4] [5] [6]

Cramer's rule implemented in a naïve way is computationally inefficient for systems of more than two or three equations.[7] In the case of equations in unknowns, it requires computation of determinants, while Gaussian elimination produces the result with the same computational complexity as the computation of a single determinant.[8] [9] Cramer's rule can also be numerically unstable even for 2×2 systems.[10] However, it has recently been shown that Cramer's rule can be implemented in O(n3) time,[11] which is comparable to more common methods of solving systems of linear equations, such as Gaussian elimination (consistently requiring 2.5 times as many arithmetic operations for all matrix sizes), while exhibiting comparable numeric stability in most cases.

## General case

Consider a system of linear equations for unknowns, represented in matrix multiplication form as follows:

Ax=b

where the matrix has a nonzero determinant, and the vector

x=(x1,\ldots,

 T x n)
is the column vector of the variables. Then the theorem states that in this case the system has a unique solution, whose individual values for the unknowns are given by:

xi=

 \det(Ai) \det(A)

i=1,\ldots,n

where

Ai

is the matrix formed by replacing the -th column of by the column vector .

A more general version of Cramer's rule[12] considers the matrix equation

AX=B

where the matrix has a nonzero determinant, and, are matrices. Given sequences

1\leqi1<i2<<ik\leqn

and

1\leqj1<j2<<jk\leqm

, let

XI,J

be the submatrix of with rows in

I:=(i1,\ldots,ik)

and columns in

J:=(j1,\ldots,jk)

. Let

AB(I,J)

be the matrix formed by replacing the

is

column of by the

js

column of, for all

s=1,\ldots,k

. Then

\detXI,J=

 \det(AB(I,J)) \det(A)

.

In the case

k=1

, this reduces to the normal Cramer's rule.

The rule holds for systems of equations with coefficients and unknowns in any field, not just in the real numbers.

## Proof

The proof for Cramer's rule uses the following properties of the determinants: linearity with respect to any given column and the fact that the determinant is zero whenever two columns are equal, which is implied by the property that the sign of the determinant flips if you switch two columns.

Fix the index j of a column. Linearity means that if we consider only column j as variable (fixing the others arbitrarily), the resulting function (assuming matrix entries are in) can be given by a matrix, with one row and n columns, that acts on column j. In fact this is precisely what Laplace expansion does, writing for certain coefficients C1, ..., Cn that depend on the columns of other than column j (the precise expression for these cofactors is not important here). The value is then the result of applying the one-line matrix to column j of . If is applied to any other column k of, then the result is the determinant of the matrix obtained from by replacing column j by a copy of column k, so the resulting determinant is 0 (the case of two equal columns).

Now consider a system of linear equations in unknowns

x1,\ldots,xn

, whose coefficient matrix is, with det(A) assumed to be nonzero:

\begin{matrix} a11x1+a12x2+ … +a1nxn&=&b1\\ a21x1+a22x2+ … +a2nxn&=&b2\\ &\vdots&\\ an1x1+an2x2+ … +annxn&=&bn. \end{matrix}

If one combines these equations by taking C1 times the first equation, plus C2 times the second, and so forth until Cn times the last, then the coefficient of will become, while the coefficients of all other unknowns become 0; the left hand side becomes simply det(A)xj. The right hand side is, which is applied to the column vector b of the right hand side . In fact what has been done here is multiply the matrix equation on the left by . Dividing by the nonzero number det(A) one finds the following equation, necessary to satisfy the system:

x
 j= L(j) ⋅ b \det(A)

.

But by construction the numerator is the determinant of the matrix obtained from by replacing column j by b, so we get the expression of Cramer's rule as a necessary condition for a solution. The same procedure can be repeated for other values of j to find values for the other unknowns.

The only point that remains to prove is that these values for the unknowns, the only possible ones, do indeed together form a solution. But if the matrix is invertible with inverse, then will be a solution, thus showing its existence. To see that is invertible when det(A) is nonzero, consider the matrix M obtained by stacking the one-line matrices on top of each other for j = 1, ..., n (this gives the adjugate matrix for). It was shown that where appears at the position j; from this it follows that . Therefore,

 1{\det(A)}M=A -1

,

completing the proof.

For other proofs, see below.

## Finding inverse matrix

See main article: article. Let be an matrix with entries in a field . Then

where denotes the adjugate matrix, is the determinant, and is the identity matrix. If is nonzero, then the inverse matrix of is

A-1=

 1 \det(A)

This gives a formula for the inverse of, provided . In fact, this formula works whenever is a commutative ring, provided that is a unit. If is not a unit, then is not invertible over the ring (it may be invertible over a larger ring in which some non-unit elements of may be invertible).

## Applications

### Explicit formulas for small systems

Consider the linear system

\left\{\begin{matrix} a1x+b1y&={\color{red}c1}\\ a2x+b2y&={\color{red}c2} \end{matrix}\right.

which in matrix format is

\begin{bmatrix}a1&b1\a2&b2\end{bmatrix}\begin{bmatrix}x\y\end{bmatrix}=\begin{bmatrix}{\color{red}c1}\{\color{red}c2}\end{bmatrix}.

Assume nonzero. Then, with help of determinants, and can be found with Cramer's rule as

\begin{align} x&=

 \begin{vmatrix \color{red

{c1}}&b1\{\color{red}{c2}}&b2\end{vmatrix}}{\begin{vmatrix}a1&b1\a2&b2\end{vmatrix}}={{\color{red}c1}b2-b1{\color{red}c2}\overa1b2-b1a2}, y=

 \begin{vmatrix a

1&{\color{red}{c1}}\a2&{\color{red}{c2}}\end{vmatrix}}{\begin{vmatrix}a1&b1\a2&b2\end{vmatrix}}={a1{\color{red}c2}-{\color{red}c1}a2\overa1b2-b1a2} \end{align}.

The rules for matrices are similar. Given

\left\{\begin{matrix} a1x+b1y+c1z&={\color{red}d1}\\ a2x+b2y+c2z&={\color{red}d2}\\ a3x+b3y+c3z&={\color{red}d3} \end{matrix}\right.

which in matrix format is

\begin{bmatrix}a1&b1&c1\a2&b2&c2\a3&b3&c3\end{bmatrix}\begin{bmatrix}x\y\z\end{bmatrix}=\begin{bmatrix}{\color{red}d1}\{\color{red}d2}\{\color{red}d3}\end{bmatrix}.

Then the values of and can be found as follows:

x=

 \begin{vmatrix \color{red

d1}&b1&c1\{\color{red}d2}&b2&c2\{\color{red}d3}&b3&c3\end{vmatrix}}{\begin{vmatrix}a1&b1&c1\a2&b2&c2\a3&b3&c3\end{vmatrix}}, y=

 \begin{vmatrix a

1&{\color{red}d1}&c1\a2&{\color{red}d2}&c2\a3&{\color{red}d3}&c3\end{vmatrix}}{\begin{vmatrix}a1&b1&c1\a2&b2&c2\a3&b3&c3\end{vmatrix}},and z=

 \begin{vmatrix a

1&b1&{\color{red}d1}\a2&b2&{\color{red}d2}\a3&b3&{\color{red}d3}\end{vmatrix}}{\begin{vmatrix}a1&b1&c1\a2&b2&c2\a3&b3&c3\end{vmatrix}}.

### Differential geometry

#### Ricci calculus

Cramer's rule is used in the Ricci calculus in various calculations involving the Christoffel symbols of the first and second kind.[13]

In particular, Cramer's rule can be used to prove that the divergence operator on a Riemannian manifold is invariant with respect to change of coordinates. We give a direct proof, suppressing the role of the Christoffel symbols.Let

(M,g)

be a Riemannian manifold equipped with local coordinates

(x1,x2,...,xn)

. Let

A=Ai

 \partial \partialxi
be a vector field. We use the summation convention throughout.

Theorem.

The divergence of

A

,

\operatorname{div}A=

 1 \sqrt{\detg
} \frac \left(A^i \sqrt \right),

is invariant under change of coordinates.

Let

(x1,x2,\ldots,xn)\mapsto(\barx1,\ldots,\barxn)

be a coordinate transformation with non-singular Jacobian. Then the classical transformation laws imply that

A=\barAk

 \partial \partial\barxk
where

\barAk=

 \partial\barxk \partialxj

Aj

. Similarly, if

g=gmkdxmdxk=\bar{g}ijd\barxid\barxj

, then

\bar{g}ij=

 \partialxm \partial\barxi
 \partialxk \partial\barxj

gmk

. Writing this transformation law in terms of matrices yields

\barg=\left(

 \partialx \partial\bar{x
}\right)^g\left(\frac\right), which implies

\det\barg=\left(\det\left(

 \partialx \partial\bar{x
}\right)\right)^\det g.

Now one computes

\begin{align} \operatorname{div}A&=

 1 \sqrt{\detg
}\frac\left(A^\sqrt\right)\\ &=\det\left(\frac\right)\frac\frac\frac\left(\frac\bar^\det\!\left(\frac\right)^\!\sqrt\right).\endIn order to show that this equals
 1 \sqrt{\det\barg
}\frac\left(\bar A^\sqrt\right),it is necessary and sufficient to show that
 \partial\barxk \partialxi
 \partial \left( \partial\barxk
 \partialxi \det\left( \partial\barx\ell
 \partialx \partial\bar{x
}\right)^\right)=0\qquad\text \ell, which is equivalent to
 \partial \det\left( \partial\barx\ell
 \partialx \partial\bar{x
}\right)=\det\left(\frac\right)\frac\frac.Carrying out the differentiation on the left-hand side, we get:
 \begin{align} \partial \det\left( \partial\barx\ell
 \partialx \partial\bar{x
}\right) &=(-1)^\frac\det M(i|j)\\ &=\frac\det\left(\frac\right)\frac\det M(i|j)=(\ast), \endwhere

M(i|j)

denotes the matrix obtained from
 \left( \partialx \partial\bar{x
}\right) by deleting the

i

th row and

j

th column.But Cramer's Rule says that
(-1)i+j
 \det\left( \partialx \partial\bar{x

\right)}\detM(i|j)

is the

(j,i)

th entry of the matrix
 \left( \partial\bar{x
}\right).Thus
 (\ast)=\det\left( \partialx \partial\bar{x
}\right)\frac\frac,completing the proof.

#### Computing derivatives implicitly

Consider the two equations

F(x,y,u,v)=0

and

G(x,y,u,v)=0

. When u and v are independent variables, we can define

x=X(u,v)

and

y=Y(u,v).

An equation for

\dfrac{\partialx}{\partialu}

can be found by applying Cramer's rule.

First, calculate the first derivatives of F, G, x, and y:

\begin{align} dF&=

 \partialF \partialx

dx+

 \partialF \partialy

dy+

 \partialF \partialu

du+

 \partialF \partialv

dv=0\\[6pt] dG&=

 \partialG \partialx

dx+

 \partialG \partialy

dy+

 \partialG \partialu

du+

 \partialG \partialv

dv=0\\[6pt] dx&=

 \partialX \partialu

du+

 \partialX \partialv

dv\\[6pt] dy&=

 \partialY \partialu

du+

 \partialY \partialv

dv. \end{align}

Substituting dx, dy into dF and dG, we have:

\begin{align} dF&=\left(

 \partialF \partialx
 \partialx + \partialu
 \partialF \partialy
 \partialy \partialu

+

 \partialF \partialu

\right)du+\left(

 \partialF \partialx
 \partialx + \partialv
 \partialF \partialy
 \partialy + \partialv
 \partialF \partialv

\right)dv=0\[6pt] dG&=\left(

 \partialG \partialx
 \partialx + \partialu
 \partialG \partialy
 \partialy + \partialu
 \partialG \partialu

\right)du+\left(

 \partialG \partialx
 \partialx + \partialv
 \partialG \partialy
 \partialy + \partialv
 \partialG \partialv

\right)dv=0. \end{align}

Since u, v are both independent, the coefficients of du, dv must be zero. So we can write out equations for the coefficients:

 \begin{align} \partialF \partialx
 \partialx + \partialu
 \partialF \partialy
 \partialy \partialu

&=-

 \partialF \\[6pt] \partialu
 \partialG \partialx
 \partialx + \partialu
 \partialG \partialy
 \partialy \partialu

&=-

 \partialG \\[6pt] \partialu
 \partialF \partialx
 \partialx + \partialv
 \partialF \partialy
 \partialy \partialv

&=-

 \partialF \\[6pt] \partialv
 \partialG \partialx
 \partialx + \partialv
 \partialG \partialy
 \partialy \partialv

&=-

 \partialG \partialv

. \end{align}

Now, by Cramer's rule, we see that:

 \partialx \partialu

=

\begin{vmatrix
 - \partialF \partialu

&

 \partialF \ - \partialy
 \partialG \partialu

&

 \partialG \end{vmatrix}}{\begin{vmatrix} \partialy
 \partialF \partialx

&

 \partialF \ \partialy
 \partialG \partialx

&

 \partialG \partialy

\end{vmatrix}}.

This is now a formula in terms of two Jacobians:

 \partialx \partialu

=-

 \left( \partial(F,G) \right) \partial(u,y)
 \left( \partial(F,G) \right) \partial(x,y)

.

Similar formulas can be derived for

 \partialx \partialv

,

 \partialy \partialu

,

 \partialy \partialv

.

### Integer programming

Cramer's rule can be used to prove that an integer programming problem whose constraint matrix is totally unimodular and whose right-hand side is integer, has integer basic solutions. This makes the integer program substantially easier to solve.

### Ordinary differential equations

Cramer's rule is used to derive the general solution to an inhomogeneous linear differential equation by the method of variation of parameters.

## Geometric interpretation

Cramer's rule has a geometric interpretation that can be considered also a proof or simply giving insight about its geometric nature. These geometric arguments work in general and not only in the case of two equations with two unknowns presented here.

Given the system of equations

\begin{matrix}a11x1+a12x2&=b1\\a21x1+a22x2&=b2\end{matrix}

it can be considered as an equation between vectors

x1\binom{a11

}+x_2\binom=\binom.

The area of the parallelogram determined by

\binom{a11

} and

\binom{a12

} is given by the determinant of the system of equations:

\begin{vmatrix}a11&a12\\a21&a22\end{vmatrix}.

In general, when there are more variables and equations, the determinant of vectors of length will give the volume of the parallelepiped determined by those vectors in the -th dimensional Euclidean space.

Therefore, the area of the parallelogram determined by

x1\binom{a11

} and

\binom{a12

} has to be

x1

times the area of the first one since one of the sides has been multiplied by this factor. Now, this last parallelogram, by Cavalieri's principle, has the same area as the parallelogram determined by

\binom{b1}{b2}=x1\binom{a11

}+x_2\binom and

\binom{a12

}.

Equating the areas of this last and the second parallelogram gives the equation

\begin{vmatrix}b1&a12\\b2&a22\end{vmatrix}=\begin{vmatrix}a11x1&a12\\a21x1&a22\end{vmatrix}=x1\begin{vmatrix}a11&a12\\a21&a22\end{vmatrix}

from which Cramer's rule follows.

## Other proofs

### A proof by abstract linear algebra

This is a restatement of the proof above in abstract language.

Consider the map

x=(x1,\ldots,xn)\mapsto

 1 \detA

\left(\det(A1),\ldots,\det(An)\right),

where

Ai

is the matrix

A

with

x

substituted in the

i

th column, as in Cramer's rule. Because of linearity of determinant in every column, this map is linear. Observe that it sends the

i

th column of

A

to the

i

th basis vector

ei=(0,\ldots,1,\ldots,0)

(with 1 in the

i

th place), because determinant of a matrix with a repeated column is 0. So we have a linear map which agrees with the inverse of

A

on the column space; hence it agrees with

A-1

on the span of the column space. Since

A

is invertible, the column vectors span all of

Rn

, so our map really is the inverse of

A

. Cramer's rule follows.

### A short proof

A short proof of Cramer's rule [14] can be given by noticing that

x1

is the determinant of the matrix

X1=\begin{bmatrix} x1&0&0&&0\\ x2&1&0&&0\\ x3&0&1&&0\\ \vdots&\vdots&\vdots&\ddots&\vdots\\ xn&0&0&&1 \end{bmatrix}

On the other hand, assuming that our original matrix is invertible, this matrix

X1

has columns

A-1b,A-1v2,\ldots,A-1vn

, where

vn

is the n-th column of the matrix . Recall that the matrix

A1

has columns

b,v2,\ldots,vn

, and therefore
 -1 X 1=A

A1

. Hence, by using that the determinant of the product of two matrices is the product of the determinants, we have

x1=\det(X1)=\det(A-1)\det(A1)=

 \det(A1) \det(A)

.

The proof for other

xj

is similar.

## Incompatible and indeterminate cases

A system of equations is said to be incompatible or inconsistent when there are no solutions and it is called indeterminate when there is more than one solution. For linear equations, an indeterminate system will have infinitely many solutions (if it is over an infinite field), since the solutions can be expressed in terms of one or more parameters that can take arbitrary values.

Cramer's rule applies to the case where the coefficient determinant is nonzero. In the 2×2 case, if the coefficient determinant is zero, then the system is incompatible if the numerator determinants are nonzero, or indeterminate if the numerator determinants are zero.

For 3×3 or higher systems, the only thing one can say when the coefficient determinant equals zero is that if any of the numerator determinants are nonzero, then the system must be incompatible. However, having all determinants zero does not imply that the system is indeterminate. A simple example where all determinants vanish (equal zero) but the system is still incompatible is the 3×3 system x+y+z=1, x+y+z=2, x+y+z=3.

## Notes and References

1. Web site: Introduction à l'Analyse des lignes Courbes algébriques . Cramer, Gabriel . 1750 . Geneva . fr . 2012-05-18 . Europeana . 656–659.
2. Kosinski . A. A. . Cramer's Rule is due to Cramer . Mathematics Magazine . 74 . 310–312 . 2001 . 4 . 10.2307/2691101. 2691101 .
3. Book: MacLaurin , Colin . A Treatise of Algebra, in Three Parts. . 1748.
4. Book: Boyer , Carl B. . Carl Benjamin Boyer . A History of Mathematics . 2nd . Wiley . 1968 . 431.
5. Book: Katz , Victor . A History of Mathematics . Pearson Education . Brief . 2004 . 378–379.
6. Hedman . Bruce A. . An Earlier Date for "Cramer's Rule" . Historia Mathematica . 26 . 4 . 365–368 . 1999 . 10.1006/hmat.1999.2247 .
7. Book: David Poole. Linear Algebra: A Modern Introduction. 2014. Cengage Learning. 978-1-285-98283-0. 276.
8. Book: Joe D. Hoffman. Steven Frankel. Numerical Methods for Engineers and Scientists, Second Edition. 2001. CRC Press. 978-0-8247-0443-8. 30.
9. Book: Thomas S. Shores. Applied Linear Algebra and Matrix Analysis. 2007. Springer Science & Business Media. 978-0-387-48947-6. 132.
10. Book: Nicholas J. Higham. Accuracy and Stability of Numerical Algorithms: Second Edition. 2002. SIAM. 978-0-89871-521-7. 13.
11. Ken Habgood . Itamar Arel . A condensation-based application of Cramerʼs rule for solving large-scale linear systems . Journal of Discrete Algorithms . 10 . 2012 . 98–109 . 10.1016/j.jda.2011.06.007. free .
12. Zhiming Gong . M. Aldeen . L. Elsner . A note on a generalized Cramer's rule . Linear Algebra and Its Applications . 340 . 2002 . 1–3 . 253–254 . 10.1016/S0024-3795(01)00469-4. free .
13. Book: Levi-Civita, Tullio. The Absolute Differential Calculus (Calculus of Tensors). Dover. 1926. 9780486634012. 111–112.
14. Robinson . Stephen M. . A Short Proof of Cramer's Rule . Mathematics Magazine. 43 . 94–95 . 1970. 2 . 10.1080/0025570X.1970.11976018 .


text:
# Distributive Aronszajn trees

Joint work with Ari Meir Brodsky.

Abstract.  Ben-David and Shelah proved that if $\lambda$ is a singular strong-limit cardinal and $2^\lambda=\lambda^+$, then $\square^*_\lambda$ entails the existence of a $\lambda$-distributive $\lambda^+$-Aronszajn tree. Here, it is proved that the same conclusion remains valid after replacing the hypothesis $\square^*_\lambda$  by $\square(\lambda^+,{<\lambda})$.

As $\square(\lambda^+,{<\lambda})$ does not impose a bound on the order-type of the witnessing clubs, our construction is necessarily different from that of Ben-David and Shelah, and instead uses walks on ordinals augmented with club guessing.

A major component of this work is the study of postprocessing functions and their effect on square sequences. A byproduct of this study is the finding that for $\kappa$ regular uncountable, $\square(\kappa)$ entails the existence of a partition of $\kappa$ into $\kappa$ many fat  sets. When contrasted with a classic model of Magidor, this shows that it is equiconsistent with the existence of a weakly compact cardinal that $\omega_2$ cannot be split into two fat  sets.