text:
# Simulation-based inference with mosaic

## Introduction

The mosaic package is intended to support teaching statistics and modeling (as well as calculus) in a way that embraces the possibilities offered by modern computational techniques. Our goal is to make effective computation accessible to university-level students at an introductory level. With the broad availability of inexpensive, fast computing and powerful, free software such as R the rate-limiting factor in accessibility is intellectual: providing a notation in which ideas can be expressed and understood clearly.

This document describes how to use the mosaic package to carry out randomization-based statistical inference. The mosaic package supports an approach that is intended to be easy for students to learn and to generalize. To this end, we adopt the following tenets:

1. Students should be able to carry out useful statistics with only a very few lines of commands.
2. Basic commands should relate to statistical operations rather than programming operations. We seek to avoid programming overhead such as loops, counters, and accumulators.
3. Black boxes should perform a conceptually straightforward operations. Their output should be verifiable.
4. Statements should demonstrate the logical structure of statistics, rather than merely naming high-level procedures.
5. There should be a simple path to generalizing from simple descriptions — means, counts, proportions — to more complicated ones such as generalized linear models.

The mosaic operations allow students to implement each of the operations in what George Cobb calls the 3 Rs’’ of statistical inference: Randomization, Replication, and Rejection (Cobb, 2007). By putting the 3 Rs together in various ways, students learn to generalize and internalize the logic of inference, rather than just to blindly follow formulaic methods.

Terry Speed (2011) notes the changing role of simulation in statistics.

[Simulation used to be] something that people did when they can’t do the math… It now seems that we are heading into an era when all statistical analysis can be done by simulation.

Arguably, the most important operation in statistics is sampling: ideally, selecting a random subset from a population. Regrettably, sampling takes work and time, so instructors tend to de-emphasize the actual practice of sampling in favor of theoretical descriptions. What’s more, the algebraic notation in which much of conventional textbook statistics is written does not offer an obvious notation for sampling.

With the computer, however, these efficiency and notation obstacles can be overcome. Sampling can be placed in its rightfully central place among the statistical concepts in our courses.

Randomization-based inference using permutation testing and bootstrapping are an increasingly important set of techniques for introductory statistics and beyond. To help educators usefully compare different software approaches, Robin Lock and colleagues posed a series of problems at USCOTS 2011 (United States Conference on Teaching Statistics), as described at http://www.causeweb.org/uscots/breakout/breakout3_6.php, relating to bootstrapping and permutation tests. Bootstrapping and permutation testing are powerful and elegant approaches to estimation and testing that can be implemented even in many situations where asymptotic results are difficult to find or otherwise unsatisfactory (Efron and Tibshirani, 1993; Hesterberg et al 2005). Bootstrapping involves sampling with replacement from a population, repeatedly calculating a sample statistic of interest to empirically construct the sampling distribution. Permutation testing for a two group comparison is done by permuting the labels for the grouping variable, then calculating the sample statistic (e.g. difference between two groups using these new labels) to empirically construct the null distribution.

We will illustrate the use of the mosaic package using the Lock randomization problems. Then we will move beyond the simple settings of the Lock problems to show how the mosaic operations makes it straightforward to generalize the logic of randomization to more complicated models.

## Background and setup

### R and RStudio

R is an open-source statistical environment that has been used at a number of institutions to teach introductory statistics. Among other advantages, R makes it easy to demonstrate the concepts of statistical inference through randomization while providing a sensible path for beginners to progress to advanced and professional statistics. RStudio (http://www.rstudio.org) is an open-source integrated development environment for R which facilitates use of the system.

### Setup

The mosaic package is available over the Internet and can be installed into R using the standard features of the system (this needs only be done once).

install.packages("mosaic")

Once installed, the package must be loaded so that it is available (this must be done within each R session). In addition to loading the mosaic package, the following commands also set the number of digits to display by default.1

require(mosaic)
options(digits=3)

Commands such as the above can be provided for students in a set-up file to be executed automatically each time an R session is started.

The mosaic package works within R, so any of the data facilities within R can be used to provide data sets to students. In particular, R functions such as read.csv() and read.table() support accessing data files via a website URL, avoiding the need to download data files to individual student machines.

Here, one of the Lock data sets are read into R via the Internet:

Mustangs <- read.csv("http://www.mosaic-web.org/go/datasets/MustangPrice.csv")

## The Lock problems

The Lock problems are a series of short problems in statistical inference provided in 2011 by Robin Lock et al. to enable instructors to compare randomization software usability.

### Lock problem 1. Bootstrapping a mean (used Mustangs)

A student collected data on the selling prices for a sample of used Mustang cars being offered for sale at an internet website. The price (in $1,000’s), age (in years) and miles driven (in 1,000’s) for the 25 cars in the sample are given in the [file MustangPrice.csv]. Use these data to construct a 90<!– confidence interval for the mean –> price (in$1,000’s) of used Mustangs.

Students should learn to examine data before undertaking formal inference. Any of the standard R tools can be used for this. We advocate the use of ggformula-style graphics functions for two reasons:

1. They use a syntax that is consistent with the syntax used in mosaic.
2. They extend naturally to more complicated settings.
gf_histogram(~ Price, data = Mustangs)

The basic ggformula syntax here — operator, “formula” involving ~, and the use of data = to specify the relevant data set — will be used throughout mosaic. For example, here is the sample mean

mean(~ Price, data = Mustangs)
#> [1] 16

Those familiar with R may wonder why the statement has not been written as

mean(Mustangs$Price) You can, of course, carry out exactly the same calculation this way. By using mean(~ Price, data = Mustangs) we are making graphical and numerical summaries fit into a common template and anticipating the next steps, including the introduction of additional operations such as randomization and modeling. Resampling, also known as random selection with replacement, is an important operation in randomization. The resample() function performs this. It can be illustrated in a very basic way on a small set of numbers: simple = c(1, 2, 3, 4, 5) resample(simple) #> [1] 5 2 3 1 1 resample(simple) #> [1] 3 3 1 5 1 resample(simple) #> [1] 4 4 3 5 4 When applied to a dataframe, resample() selects random rows. It’s easy to demonstrate this with a statement such as: resample(Mustangs) #> Age Miles Price orig.id #> 13 8 100.8 9.0 13 #> 3 9 82.8 11.9 3 #> 2 7 33.0 45.0 2 #> 24 12 72.9 12.9 24 #> 2.1 7 33.0 45.0 2 #> 24.1 12 72.9 12.9 24 #> ... and so on By reference to the case numbers in the left column, you can see that case 19 has been selected twice. One resampling trial of the mean can be carried out with mean(~ Price, data = resample(Mustangs)) #> [1] 16.3 Even though a single trial is of little use, it’s a nice idea to have students do the calculation to show that they are (usually) getting a different results with each resample. Another trial can be carried out by repeating the command: mean(~ Price, data = resample(Mustangs)) #> [1] 13.9 Let’s generate five more, with a single command: do(5) * mean(~ Price, data = resample(Mustangs)) #> mean #> 1 11.8 #> 2 14.0 #> 3 13.8 #> 4 15.6 #> 5 20.2 Now conduct 1000 resampling trials2, saving the results in an object called Mustangs.Price.boot:3 Mustangs.Price.boot <- do(1000) * mean(~ Price, data = resample(Mustangs)) Plotting this resampling distribution is straightforward, e.g.: gf_histogram(~ mean, data = Mustangs.Price.boot, xlab="Mean Mustang Price (in thousand dollars)") The simplest way to translate this distribution into a confidence interval is to apply the operator for that purpose: confint(Mustangs.Price.boot, level = 0.90, method = "quantile") #> name lower upper level method estimate #> 1 mean 12.5 19.7 0.9 percentile 16 confint(Mustangs.Price.boot, level = 0.90, method = "stderr") #> name lower upper level method estimate margin.of.error df #> 1 mean 12.2 19.7 0.9 stderr 16 3.75 24 The confint() function is a black box. In introducing it, an instructor might well want to show the calculations behind the confidence interval in some detail using general-purpose operations. confint() implements two basic approaches, one based on quantiles of the distribution and the other using normal theory. 1. Calculation of the 90<!– confidence interval using quantiles –> qdata(~ mean, c(.05, .95), data = Mustangs.Price.boot) #> 5% 95% #> 12.5 19.7 # alternative cdata(~ mean, 0.90, data = Mustangs.Price.boot) #> lower upper central.p #> 5% 12.5 19.7 0.9 1. Using normal theory and the standard error. First calculate the critical value$t_TEX COMMAND NOT FOUND star for the appropriate degrees of freedom. Or use $z_TEX COMMAND NOT FOUND star , either for simplicity or to demonstrate how$t_TEX COMMAND NOT FOUND star differs. In either case, the confidence level needs to be converted to the appropriate tail probability, e.g. a level of 90<!– corresponds to a tail probability of 0.95. –>
tstar <- qt(.95, df = 24)
zstar <- qnorm(.95)

The resulting margin of error will be

tstar * sd(~ mean, data = Mustangs.Price.boot)
#> [1] 3.75
zstar * sd(~ mean, data = Mustangs.Price.boot)
#> [1] 3.6

There’s little reason to repeat this set of commands every time one needs a confidence interval. That’s where confint() comes in, abstracting the operation, allowing the user to specify a level and a method ("quantile" or "stderr") and avoiding the need to convert the level into a tail probability. The extent to which one should repeat the detailed steps of the margin-of-error calculation is a decision the instructor can make depending on local circumstances and the instructor’s goals. R and mosaic supports both approaches.

### Lock problem 2: Testing a proportion (NFL Overtimes)

The National Football League (NFL) uses an overtime period to determine a winner for games that are tied at the end of regulation time. The first team to score in the overtime wins the game. A coin flip is used to determine which team gets the ball first. Is there an advantage to winning the coin flip? Data from the 1974 through 2009 seasons show that the coin flip winner won 240 of the 428 games where a winner was determined in overtime. Treat these as a sample of NFL games to test whether there is sufficient evidence to show that the proportion of overtime games won by the coin flip winner is more than one half.

By and large, introductory students understand that, if first possession of the ball is unrelated to the game outcome, one would expect to see about half of the 428 games won by the team that won the coin flip. The question is whether the observed 240 wins is “about” half of the 428 games. Statistical inference compares the 240 to the $$428/2 = 214$$ in the context of sampling variation.

Using the built-in binomial distribution operators.

Generate a simulation where each trial is a random sample of 428 games from a world in which the null hypothesis holds true and see what proportion of trials give a result as or more extreme as the observed 240.

prop(~ rbinom(1000, prob = 0.5, size = 428) >= 240)
#> prop_TRUE
#>     0.005

The result indicates that it’s very unlikely, if the null were true, that the coin flip winner would win 240 or more times.

The exact result differs slightly from one simulation to the next, but that variation can be made small by making the number of trials larger.

prop(~ rbinom(1000, prob = 0.5, size = 428) >= 240)
#> prop_TRUE
#>      0.01

In this case, it is tempting entirely to avoid the variation due to simulation by doing a deterministic probability calculation rather than the simulation. This exact reproducibility comes at a cost, though, the need to customize the cut-off point to reflect which tail of the distribution corresponds to “as or more extreme than 240.” On the right side, this means subtracting 1 from the observed number.

xpbinom(239, prob = 0.5, size = 428)
#> [1] 0.993

Of course, R can handle all of these little details and do the entire calculation for us if we use the binom.test() function.

binom.test(x = 240, n = 428)
#>
#>
#>
#> data:  240 out of 428
#> number of successes = 240, number of trials = 428, p-value =
#> 0.01
#> alternative hypothesis: true probability of success is not equal to 0.5
#> 95 percent confidence interval:
#>  0.512 0.608
#> sample estimates:
#> probability of success
#>                  0.561

Even if you want to use the deterministic probability calculation (using either pbinom() or binom.test()), you might want to illustrate the logic with the random-number generator.

Explicitly simulating a coin flip.

Recognizing that coin flips are a staple of statistics courses, the mosaic package offers a function that simulates random coin tosses without the need to refer to the binomial distribution. Here is one trial involving flipping 428 coins:

do(1) * rflip(428)
#> 1 428   215   213 0.502

We’ll do 1,000 trials, and count what fraction of the trials the coin toss winner (say, “heads”) wins 240 or more of the 428 attempts:

NFL.null <- do(1000) * rflip(428)
prop(~ heads >= 240, data = NFL.null)
#> prop_TRUE
#>      0.01
gf_histogram(~ heads, fill = ~ (heads >= 240), data = NFL.null)

The observed pattern of 240 wins is not a likely outcome under the null hypothesis. The shading added through the groups = option helps to visually reinforce the result.

### Lock problem 3: Permutation test of means from two groups (sleep and memory)

In an experiment on memory (Mednicj et al, 2008), students were given lists of 24 words to memorize. After hearing the words they were assigned at random to different groups. One group of 12 students took a nap for 1.5 hours while a second group of 12 students stayed awake and was given a caffeine pill. The results below display the number of words each participant was able to recall after the break. Test whether the data indicate a difference in mean number of words recalled between the two treatments.

Sleep <- read.csv("http://www.mosaic-web.org/go/datasets/SleepCaffeine.csv")

The Sleep group tends to have remembered somewhat more words on average:

mean(Words ~ Group, data = Sleep)
#> Caffeine    Sleep
#>     12.2     15.2
obs <- diff(mean(Words ~ Group, data = Sleep))
obs
#> Sleep
#>     3
gf_boxplot(Words ~ Group, data = Sleep)

To implement the null hypothesis, scramble the Group with respect to the outcome, Words:

diff(mean(Words ~ shuffle(Group), data = Sleep))
#> Sleep
#>  1.33

That’s just one trial. Let’s try again:

diff(mean(Words ~ shuffle(Group), data = Sleep))
#> Sleep
#> -1.17

To get the distribution under the null hypothesis, we carry out many trials:

Sleep.null <- do(1000) * diff(mean(Words ~ shuffle(Group), data = Sleep))
gf_histogram(~ Sleep, fill = ~ (Sleep >= obs), data = Sleep.null,
binwidth = 0.4,
xlab = "Distribution of difference in meansTEX COMMAND NOT FOUND nunder  the null hypothesis")

The one-sided p-value for this test is the proportion of
trials which yielded a result as extreme or more extreme as the observed difference. We can calculate the one-sided p-value for this test by summing up the number of trials which yielded a result as extreme or more extreme as the observed difference. Here only 26 of the 1000 trials gave a result that large, so the p-value is equal to 0.026. We conclude that it’s unlikely that the two groups have the same mean word recall back in their respective populations.

### Lock problem 4: Bootstrapping a correlation

The data on Mustang prices in Problem #1 also contains the number of miles each car had been driven (in thousands). Find a 95<!– confidence interval for the correlation between price and mileage. –>

We can fallow essentially the same workflow to obtain a confidence interval for other statistics, including the correlation coefficient.4

cor(Price ~ Miles, data = Mustangs)
#> [1] -0.825
Mustangs.cor.boot <- do(1000) * cor(Price ~ Miles, data = resample(Mustangs))
quantiles <- qdata(~ cor, c(.025, .975), data = Mustangs.cor.boot)
quantiles
#>   2.5%  97.5%
#> -0.933 -0.723
Mustangs.hist <- mutate(Mustangs.cor.boot,
colorval = cut(cor, c(-Inf, quantiles, Inf),
labels = c("Lower", "Middle", "Upper")))
gf_histogram(~ cor, data = Mustangs.hist, fill = ~ colorval, n = 50)
confint(Mustangs.cor.boot)
#>   name  lower  upper level     method estimate
#> 1  cor -0.933 -0.723  0.95 percentile   -0.825

## Moving beyond means and proportions

The Lock problems refer to the descriptive statistics encountered in many introductory applied statistics courses: means, proportions, differences in means and proportions. There are advantages, however, in introducing such basic statistics in the context of a more general framework: linear models.

Usually, people think about linear models in the context of regression. For instance, using the Lock Mustang price dataset, there is presumably a relationship between the price of a car and its mileage. Here’s a graph:

gf_point(Price ~ Miles, data = Mustangs) %>%
gf_lm()

There’s a pretty clear relationship here, which in the Lock problems was quantified with the correlation coefficient.

In regression, one finds a straight-line functional relationship between the two variables. The built-in R lm() function does the calculations:

lm(Price ~ Miles, data = Mustangs)
#>
#> Call:
#> lm(formula = Price ~ Miles, data = Mustangs)
#>
#> Coefficients:
#> (Intercept)        Miles
#>      30.495       -0.219

The notation used is the same as used to produce a scatter plot.
The result indicates that for every additional 1000 miles driven, the price of a car typically decreases by \$219 dollars (or, given the units of the data, 0.2188 thousand dollars). In other words, the value of a Mustang goes down by about 22 cents per mile driven.

This number, 22 cents decrease per mile, can be thought of as an “effect size.” It’s likely much more meaningful to students (and car buyers!) than the correlation coefficient of $$-0.82$$. The ability to give a description in terms of an effect size is an advantage of using regression as a description rather than correlation. There are more such advantages to regression, which we will describe later. But for now, our emphasis is on the use of regression as a framework for the traditional sorts of calculations of means, proportions, and differences of means and proportions.

The mean price of the Mustangs is, calculated in the ordinary way:

mean(~ Price, data = Mustangs)
#> [1] 16

The same result can be generate via a linear model:

lm(Price ~ 1, data = Mustangs)
#>
#> Call:
#> lm(formula = Price ~ 1, data = Mustangs)
#>
#> Coefficients:
#> (Intercept)
#>          16

This may seem obscure. In lm(), the ~ notation is used to identify the response variable and the explanatory variables. In Price ~ Miles, the response variable is Price and Miles is being used as the explanatory variable.
The mileage varies from car to car; this variation in mileage is used to explain the variation in price.

In Price ~ 1, the 1 can be thought of as signifying that there are no explanatory variables, or, from a slightly different perspective, that the cars are all the same. The mean() function is set up to accept this same notation:

mean(Price ~ 1, data = Mustangs)
#>  1
#> 16

Why? So that the notation can be extended to include calculating the mean for different groups. To illustrate, consider the Lock Sleep data which compares the ability to memorize words after a nap versus after taking caffeine.

The mean number of words memorized, ignoring the explanatory group, is:

mean(Words ~ 1, data = Sleep)
#>    1
#> 13.8

To break this down by groups, use an explanatory variable:

mean(Words ~ Group, data = Sleep)
#> Caffeine    Sleep
#>     12.2     15.2

Conventionally, regression is introduced as a technique for working with quantitative explanatory variables, e.g. the Miles in the Mustang data, while groupwise means are used for categorical variables such as Group in the sleep data. But the regression technique applies to categorical data as well:

lm(Words ~ Group, data = Sleep)
#>
#> Call:
#> lm(formula = Words ~ Group, data = Sleep)
#>
#> Coefficients:
#> (Intercept)   GroupSleep
#>        12.2          3.0

What’s different between the information reported from mean() and the result of lm() is the format of the results. The GroupSleep coefficient from lm() gives the difference between the two groups.

diffmean(Words ~ Group, data = Sleep)
#> diffmean
#>        3

The lm() function also can be used to calculate proportions and differences in proportions. We’ll illustrate with the HELPrct data which contains information about patients in the Health Evaluation and Linkage to Primary Care randomized clinical trial. Consider the proportion of people who are reported as homeless:

prop(homeless ~ 1, data = HELPrct)
#> prop_homeless.1
#>           0.461

The proportion of patients who are homeless differs somewhat between the sexes; males are somewhat more likely to be homeless.

prop(homeless ~ sex, data = HELPrct)
#> prop_homeless.female   prop_homeless.male
#>                0.374                0.488

The difference between these two proportions is:

diffprop(homeless ~ sex, data = HELPrct)
#> diffprop
#>    0.115

The lm function gives the same results. (You have to specify which level you want the proportion of, “homeless” or “housed”.)

lm(homeless=="homeless" ~ 1, data = HELPrct)
#>
#> Call:
#> lm(formula = homeless == "homeless" ~ 1, data = HELPrct)
#>
#> Coefficients:
#> (Intercept)
#>       0.461

Why use lm() when mean() and prop() and (and diffmean() and diffprop()) will give the same result?
Because lm() can be generalized. It works for both categorical and quantitative explanatory variables and, very importantly, lm() allows multiple explanatory variables to be used.

Even when using mean() and prop(), there’s a reason to prefer the ~1 notation. It emphasizes that the calculation is not trying to explain the variability in the response variable; there are no explanatory variables being used.

lm(homeless=="homeless" ~ sex, data = HELPrct)
#>
#> Call:
#> lm(formula = homeless == "homeless" ~ sex, data = HELPrct)
#>
#> Coefficients:
#> (Intercept)      sexmale
#>       0.374        0.115

### Randomization with linear models

Randomization can be performed with lm() in the same style as with mean() and prop(). Here, for instance, is a resampling confidence interval on the price change with mileage in the Mustang data:

Mustangs.lm.boot <- do(1000) * lm(Price ~ Miles, data = resample(Mustangs))
confint(Mustangs.lm.boot)
#>        name  lower   upper level     method estimate
#> 1 Intercept 24.769  36.194  0.95 percentile   30.495
#> 2     Miles -0.276  -0.162  0.95 percentile   -0.219
#> 3     sigma  3.076   8.793  0.95 percentile    6.422
#> 4 r.squared  0.526   0.869  0.95 percentile    0.680
#> 5         F 25.543 152.918  0.95 percentile   48.873

Or, we can calculate a permutation test on the difference between homeless rates among men and women using the HELPrct data:

HELPrct.null <- do(1000) * lm(homeless=="homeless" ~ shuffle(sex), data = HELPrct)
prop(~ (abs(sexmale) > 0.1146), data = HELPrct.null)
#> prop_TRUE
#>     0.038

### Multiple explanatory variables

The regression framework allows more than one explanatory to be used. For instance, one can examine how each of Age and Miles is related to the Price of the Mustangs.

Mustangs.boot1 <- do(1000) * lm(Price ~ Age, data = resample(Mustangs))
Mustangs.boot2 <- do(1000) * lm(Price ~ Miles, data = resample(Mustangs))
Mustangs.boot3 <- do(1000) * lm(Price ~ Miles + Age, data = resample(Mustangs))

The first model suggests that Price goes down by about one to two thousand dollars per year of Age.

confint(Mustangs.boot1)
#>        name  lower  upper level     method estimate
#> 1 Intercept 23.813 37.305  0.95 percentile   30.264
#> 2       Age -2.282 -1.205  0.95 percentile   -1.717
#> 3     sigma  4.122 11.148  0.95 percentile    8.102
#> 4 r.squared  0.293  0.755  0.95 percentile    0.491
#> 5         F  9.525 71.004  0.95 percentile   22.154

The second model indicates that Price goes down by about 16 to 28 cents per mile driven.

confint(Mustangs.boot2)
#>        name  lower   upper level     method estimate
#> 1 Intercept 24.688  36.343  0.95 percentile   30.495
#> 2     Miles -0.279  -0.161  0.95 percentile   -0.219
#> 3     sigma  3.230   8.940  0.95 percentile    6.422
#> 4 r.squared  0.527   0.858  0.95 percentile    0.680
#> 5         F 25.609 138.404  0.95 percentile   48.873

The third model puts each explanatory variable in the context of the other, and suggests that Age may just be a proxy for Miles.

confint(Mustangs.boot3)
#>        name  lower  upper level     method estimate
#> 1 Intercept 25.795 36.734  0.95 percentile   30.867
#> 2     Miles -0.329 -0.116  0.95 percentile   -0.205
#> 3       Age -0.848  0.770  0.95 percentile   -0.155
#> 4     sigma  3.051  8.822  0.95 percentile    6.553
#> 5 r.squared  0.546  0.873  0.95 percentile    0.681
#> 6         F 13.212 75.854  0.95 percentile   23.512

One way to interpret this result is that, adjusting for Miles, there is little evidence for an Age effect. The inflation of the confidence intervals for Miles and Age is a result of the collinearity between those explanatory variables.

One way to think about {TEX COMMAND NOT FOUND sc ANOVA} is a way of quantifying the extent to which a model term, in the context of other model terms, is better than random “junk.” Consider, for example, the role of Age in a model of the Mustang prices that includes Miles. Here’s one {TEX COMMAND NOT FOUND sc ANOVA} report:

anova(lm(Price ~ Miles + Age, data = Mustangs))
#> Analysis of Variance Table
#>
#> Response: Price
#>           Df Sum Sq Mean Sq F value Pr(>F)
#> Miles      1   2016    2016   46.94  7e-07 ***
#> Age        1      4       4    0.09   0.77
#> Residuals 22    945      43
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The p-value on Age suggests that Age is not contributing to the model. But there’s a different {TEX COMMAND NOT FOUND sc ANOVA} report available that suggests a different conclusion.

anova(lm(Price ~ Age + Miles, data = Mustangs))
#> Analysis of Variance Table
#>
#> Response: Price
#>           Df Sum Sq Mean Sq F value  Pr(>F)
#> Age        1   1454    1454    33.9 7.4e-06 ***
#> Miles      1    565     565    13.2  0.0015 **
#> Residuals 22    945      43
#> ---
#> Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

The difference between the two {TEX COMMAND NOT FOUND sc ANOVA} reports can be explained in several ways, for example by regarding {TEX COMMAND NOT FOUND sc ANOVA} as a sequential report on a nested sequence of models, so that the order of model terms makes a difference. For instance, the $$R^2$$ from this sequence of models suggests that Age doesn’t add much to Miles.

do(1) * lm(Price ~ Miles, data = Mustangs)
#>   Intercept  Miles sigma r.squared    F numdf dendf .row .index
#> 1      30.5 -0.219  6.42      0.68 48.9     1    23    1      1
do(1) * lm(Price ~ Miles + Age, data = Mustangs)
#>   Intercept  Miles    Age sigma r.squared    F numdf dendf .row
#> 1      30.9 -0.205 -0.155  6.55     0.681 23.5     2    22    1
#>   .index
#> 1      1

Here, do() has been used without any randomization, merely to format the results in a way that allows them be readily compared. Note that the addition of Age as an explanatory variable has increased $$R^2$$ by a little bit, from $$0.680$$ to $$0.681$$.

Shuffling Age allows the actual change in $$R^2$$ to be compared to what would be expected under the null hypothesis:

Mustangs.Age.boot <- do(1000) * lm(Price ~ Miles + shuffle(Age), data = Mustangs )
favstats(~ r.squared, data = Mustangs.Age.boot)
#>   min    Q1 median    Q3   max  mean     sd    n missing
#>  0.68 0.682  0.687 0.702 0.793 0.695 0.0192 1000       0
cdata(~ r.squared, .95, data = Mustangs.Age.boot)
#>      lower upper central.p
#> 2.5%  0.68 0.751      0.95

The observed $$R^2$$ from Price ~ Miles + Age- falls in the middle portion of the observed range when Age is shuffled. We can conclude that Age is not an important predictor.

The result is very different when Miles is shuffled instead.

Mustangs.Miles.boot <- do(1000) * lm(Price ~ shuffle(Miles) + Age, data = Mustangs)
favstats(~ r.squared, data = Mustangs.Miles.boot)
#>    min    Q1 median    Q3   max  mean     sd    n missing
#>  0.491 0.493  0.501 0.521 0.763 0.513 0.0294 1000       0
cdata(~ r.squared, .95, data = Mustangs.Miles.boot)
#>      lower upper central.p
#> 2.5% 0.491 0.595      0.95

The observed value of $$R^2 = 0.681$$ falls well above the central 95<!– of resampled values: –> we conclude that Miles is an important predictor.

## Using simulations in other ways

The basic technology of resampling and shuffling can be used to demonstrate many other concepts in statistics than the generation of confidence intervals and p-values. For example, it is very useful for showing the origins of distributions such as t and F.

For the sake of illustration, consider a $$TEX COMMAND NOT FOUND chi 2$$-test of the independence of homeless and sex in the HELPrct data. To illustrate, here is a simulation to construct the distribution of p-values from a simple test under the null hypothesis. The

1. Carry out the test, e.g.
chisq.test(tally(~ homeless + sex,
data = HELPrct, margins = FALSE))
#>
#>  Pearson's Chi-squared test with Yates' continuity correction
#>
#> data:  tally(~homeless + sex, data = HELPrct, margins = FALSE)
#> X-squared = 4, df = 1, p-value = 0.05
1. Modify the statement to extract the portion of interest.
In this case, the p-value:
pval(chisq.test(tally(~ homeless + sex,
data = HELPrct, margins = FALSE)) )
#> p.value
#>  0.0491
1. Insert randomization to implement the null hypothesis:
pval(chisq.test(tally(~ shuffle(homeless) + sex,
data = HELPrct, margins = FALSE)))
#> p.value
#>   0.193
1. Iterate to get the distribution under the null:
Chisq.null <- do(1000)* pval(chisq.test(tally(~ shuffle(homeless) + sex,
data = HELPrct, margins = FALSE)))

Strictly speaking, only the last step is needed. The others are merely to illustrate construction of the statement and how each individual component fits into the whole.

Students often think that when the null hypothesis is true, p-values should be large. They can be surprised to see that the distribution of p-values under the null hypothesis is uniform from 0 to 1, or that there is a roughly 5% chance of rejecting the null (at $$p < 0.05$$) even when the null hypothesis is true.5

prop(~ (p.value < 0.05), data = Chisq.null)
#> prop_TRUE
#>      0.04
gf_histogram(~ p.value, data = Chisq.null, binwidth = 0.1, center = 0.05)

qqmath(~ p.value, data = Chisq.null, dist = qunif)

Perhaps more important, with the simulation approach it’s straightforward to segue into more advanced and appropriate models and tests. So, rather than the esteemed $$TEX COMMAND NOT FOUND chi 2$$ test, perhaps something a bit more modern and flexible such as logistic regression with age as a covariate:

HELP.logistic.boot <- do(1000) *
glm(homeless=="homeless" ~ age + sex,
data = resample(HELPrct), family = "binomial")
confint(HELP.logistic.boot)
#>        name     lower   upper level     method estimate
#> 1 Intercept -2.398723 -0.3465  0.95 percentile  -1.3846
#> 2       age  0.000232  0.0487  0.95 percentile   0.0239
#> 3   sexmale  0.027836  0.9622  0.95 percentile   0.4920

## Acknowledgments

Thanks to Sarah Anoke for comments on a draft, as well as to Robin Lock of St. Lawrence University for organizing the resampling demonstration session at USCOTS 2011.

Project MOSAIC is supported by the US National Science Foundation (DUE-0920350). More information about the package and this initiative can be found at the Project MOSAIC website: www.mosaic-web.org.

## Technical information

This document was produced using R version 4.0.0 (2020-04-24) and version 1.7.0 of the mosaic package.

## References

1. G. W. Cobb, The introductory statistics course: a Ptolemaic curriculum?, Technology Innovations in Statistics Education, 2007, 1(1).
2. B. Efron & R. J. Tibshirani, An Introduction to the Bootstrap, 1993, Chapman & Hall, New York.
3. T. Hesterberg, D. S. Moore, S. Monaghan, A. Clipson & R. Epstein. Bootstrap Methods and Permutation Tests (2nd edition), (2005), W.H. Freeman, New York.
4. D.T. Kaplan, Statistical Modeling: A Fresh Approach, 2nd edition, http://www.mosaic-web.org/StatisticalModeling.
5. S.C. Mednicj, D. J. Cai, J. Kanady, S. P. Drummond. “Comparing the benefits of caffeine, naps and placebo on verbal, motor and perceptual memory”, Behavioural Brain Research, 2008, 193(1):79-86.
6. T. Speed, “Simulation”, IMS Bulletin, 2011, 40(3):18.

1. If the parallel package is installed, loading it will allow the do() function in the mosaic package to take advantage of multiple processors to speed up simulations.↩

2. 1000 is a reasonable number of trials for illustration purposes, but Monte Carlo variability can be considerably reduced by using 10,000 or more.↩

3. It is a good idea to adopt a naming convention for your bootstrap and randomization distributions. Repeatedly using the same name (e.g., Trials) can become very confusing and lead to errors from misidentifying which distribution one has. The name we have chosen here makes it clear which data set an variable are being considered and that we are creating a bootstrap distribution (as opposed to simulating a null distribution).↩

4. Naive confidence intervals based on percentiles or bootstrap standard errors from small samples may not be as good as other methods (for example, the bootstrap t is preferred when generating a confidence interval for a mean), and the ability to easily create simulated bootstrap distributions does not guarantee that the resulting intervals will have the desired properties. Alternative methods and diagnostics are important topics not covered here.↩

5. We can also observe in this data the challenges of approximating a discrete distribution that takes on relatively few values with a continuous distribution like the Chi-squared distribution.↩


text:
# Probability of Disjoint Hands Across Rounds of Cards

Suppose you played two rounds of a game of cards. Each round you are independently dealt an $n$-card hand from a shuffled deck (e.g., n=5 $n=13$ for Bridge, $n=7$ for Hold'em, etc) .

Q1 (Motivating): In a game involving $n$-card hands, what is the probability that your first hand is disjoint from your second hand? That is, what is the probability your successive hands share no cards in common?

Where I'm getting stuck is generalizing this question to an $m$-card deck, $n$-card hand, and, in particular, a $k$-round game:

Q2 (General): After $k$ independent rounds of a game of $n$-card hands from a shuffled $m$-card deck, what's the probability all hands are disjoint (i.e., that you don't see the any card more than once)?

Clearly $P(disjoint\; hands)=1$ after just $k=1$ round, and by the pigeonhole principle $P(disjoint\; hands)=0$ after $k=\lceil\frac{n}{m}\rceil$ rounds. But I'm stuck reasoning through a closed-form equation.

Ultimately I'm interested in the $P=0.5$ scenario, something akin to the birthday paradox, namely:

Q3 (Goal): How many rounds of a (generalized) card game do you have to play before you would expect to see one (or more) cards repeated across hands?

Thanks for the help!

• Bridge uses 13-card hands not 5. No clue as to author's thoughts or context of this question. – BruceET Apr 2 '15 at 0:09

Given an $m$ card deck, how likely are you to to draw $k$ consecutive, disjoint hands, each of which have $n$ cards?

Let's assume, for some $k\geq 2$, that your previous $k-1$ hands have been disjoint. Then you have seen exactly $n*(k-1)$ cards thus far. Therefore your next hand must come solely from the remaining $m-n*(k-1)$ cards in the deck that you have not seen. There are $$\binom{m-n*(k-1)}{n}$$ ways of choosing such a hand, and there are $$\binom{m}{n}$$ total hands that you could be dealt. Thus the probability that your $k$th hand will consist of cards that you have not see yet, given that your previous $k-1$ hands have been disjoint, is $$\frac{\binom{m-n*(k-1)}{n}}{\binom{m}{n}}.$$ Letting $P(k)$ be the probability of getting $k$ consecutive disjoint hands, we thus have the recurrence relation $$P(1)=1, \:P(k)=\frac{\binom{m-n*(k-1)}{n}}{\binom{m}{n}}P(k-1).$$ Therefore $$P(k)=\frac{\prod_{j=1}^{k-1}\binom{m-n*j}{n}}{\binom{m}{n}^k}$$

Q1 (Motivating): In a game involving n -card hands, what is the probability that your first hand is disjoint from your second hand? That is, what is the probability your successive hands share no cards in common?

Assume this is using a deck of $52$ unique cards. You want the probability of selecting $n$ from the $52-n$ cards you did not select last time out of all the ways to select $n$ from $52$.

\begin{align} \mathsf P_2 & = \dfrac{\dbinom{52-n}{n}}{\dbinom{52}{n}} \\[1ex] & = \dfrac{(52-n)!^2}{52!(52-2n)!} \end{align}

Alternatively, this is the way to select $2n$ cards out of $52$ then sort them into ordered collections of $2$ unordered sets of $n$, out of all the ways to select any $n$ cards from $52$ twice.

\begin{align} \mathsf P_2 & = \dfrac{\dbinom{52}{2n}\dfrac{(2n)!}{n!^2}}{\dbinom{52}{n}^2} \\[1ex] & = \dfrac{(52-n)!^2}{52!(52-2n)!} \end{align}

Q2 (General): After k independent rounds of a game of n -card hands from a shuffled m -card deck, what's the probability all hands are disjoint (i.e., that you don't see the any card more than once)?

So you want to count the ways to choose $nk$ distinct cards from $52$, then sort them into into an ordered collection of $k$ unordered groups of $n$, then divide this count by all ways to select any $n$ from $52$ cards, $k$ times over.

$$\mathsf P_k = \dfrac{\dbinom{52}{nk}\dfrac{nk!}{n!^k}}{\dbinom{52}{n}^k}$$

Now, can you simplify and complete?

format: plain


text:
# Are the Lido STF font installation instructions up-to-date?

The Czech TUG homepage has instructions and files to install the Lido STF fonts here. I don't know much about how fonts work in TeX, and the files have a modification date of 2001, so I'd like to ask:

1. Are these instructions up-to-date and correct? If not, please provide corrections.
2. Do I need to install the OFS package? This is unclear for me from the instructions.
3. How do I invoke the font in my documents?

(I know I can just use XeTeX, but it's sometimes fun to do things like this. I'm using MiKTeX 2.9.)

Here is a summary in case the link breaks.

1. Unpack the .tgz archive.
2. Insert the following line into texmf/dvips/config/config.ps:

p +slido.map

3. Insert the following line into texmf/pdftex/config/pdftex.cfg:

map +slido.map

4. In texmf/web2c/mktex.cnf, delete fontmaps from the line setting MT-FEATURES.

5. Run texhash.
-
What TeX distribution are you using? –  egreg Jun 20 '13 at 10:26
@egreg MiKTeX 2.9. –  marczellm Jun 20 '13 at 10:28
No don't change config.ps or pdftex.cfg. Maps are added via updmap/initexmf docs.miktex.org/2.9/manual/advanced.html#psfonts –  Ulrike Fischer Jun 20 '13 at 10:57

## Correct installation instructions for MiKTeX

1. Unpack the .tgz archive into your texmf tree.
2. In the command line run initexmf --edit-config-file updmap
3. A text file appears; enter Map slido.map (as the last line probably, the file was empty in my case, except a comment.) Save and close the file.
4. Run texhash.
5. Run initexmf --mkmaps.

(You may have to run all command line stuff as administrator, depending on whether you saved the files to a global texmf tree ("common root directory") or a local (user) one. All MiKTeX command line utils have the --admin option.)

In a LaTeX document you can now enable the font globally with

\renewcommand{\rmdefault}{sld}

or locally with

\fontfamily{sld}\selectfont

The OFS package is not needed for basic usage of the font, but the homepage recommends installing it. It is needed if you want to \usepackage{slido} or \input slido because the provided .sty and .tex files use OFS macros.

Here's a MWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext}
\renewcommand{\rmdefault}{sld}

\begin{document}
\blinddocument
éáűőúöüóí
\textbf{öüóőú \textit{éáűí}}
\end{document}

-


text:
Publication 1995 Issue No. 1 - January Abstract - A New Public-Key Cipher System Based Upon the Diophantine Equations
 This Article Share Bibliographic References Add to: Digg Furl Spurl Blink Simpy Google Del.icio.us Y!MyWeb Search Similar Articles Articles by C. H. Lin Articles by C. C. Chang Articles by R. C. T. Lee
A New Public-Key Cipher System Based Upon the Diophantine Equations
January 1995 (vol. 44 no. 1)
pp. 13-19
 ASCII Text x C. H. Lin, C. C. Chang, R. C. T. Lee, "A New Public-Key Cipher System Based Upon the Diophantine Equations," IEEE Transactions on Computers, vol. 44, no. 1, pp. 13-19, January, 1995.
 BibTex x @article{ 10.1109/12.368013,author = {C. H. Lin and C. C. Chang and R. C. T. Lee},title = {A New Public-Key Cipher System Based Upon the Diophantine Equations},journal ={IEEE Transactions on Computers},volume = {44},number = {1},issn = {0018-9340},year = {1995},pages = {13-19},doi = {http://doi.ieeecomputersociety.org/10.1109/12.368013},publisher = {IEEE Computer Society},address = {Los Alamitos, CA, USA},}
 RefWorks Procite/RefMan/Endnote x TY - JOURJO - IEEE Transactions on ComputersTI - A New Public-Key Cipher System Based Upon the Diophantine EquationsIS - 1SN - 0018-9340SP13EP19EPD - 13-19A1 - C. H. Lin, A1 - C. C. Chang, A1 - R. C. T. Lee, PY - 1995VL - 44JA - IEEE Transactions on ComputersER -

Abstract—A new public-key (two-key) cipher scheme is proposed in this paper. In our scheme, keys can be easily generated. In addition, both encryption and decryption procedures are simple. To encrypt a message, the sender needs to conduct a vector product of the message being sent and the enciphering key. On the other hand, the receiver can easily decrypt it by conducting several multiplication operations and modulus operations. For security analysis, we also examine some possible attacks on the presented scheme.

Index Terms—Public keys, private keys, cryptosystems, Diophantine equation problems, integer knapsack problems, one-way functions, trapdoor one-way functions, NP-complete.

[1] E. F. Brickell,“A new knapsack based cryptosystem,”inCrypto '83, rump session, 1983.
[2] C. C. Chang and J. C. Shieh,“Pairwise relatively prime generating polynomials and their applications,”inProc. Int. Workshop on Discrete Algorithms and Complexity,Kyushu, Japan, Nov. 1989, pp. 137–140.
[3] B. Chor, and R. L. Rivest,“Knapsack Type Public Key Cryptosystem Based on Arithmetic in Finite Field,”IEEE Trans. Inform. Theory,vol. 34, No. 5, 1988, pp. 901–909.
[4] S. A. Cook,“The Complexity of Theorem-Proving Procedures,”Proc. 3rd Ann. ACM Symposium on Theory of Computing,New York: Association for Computing Machinery, 1971, pp. 151–155.
[5] D.E.R. Denning, Cryptography and Data Security. Addison-Wesley, 1983.
[6] W. Diffie and M. Hellman,“New directions in cryptography,”IEEE Trans. Inform. Theory,vol. 22, pp. 644–654, 1976.
[7] T. El Gamal,“A public key cryptosystem and signature scheme based on discrete logarithms,”IEEE Trans. Inform. Theory,vol. 31, no. 4, pp. 469–472, 1985.
[8] M.R. Garey and D.S. Johnson, Computers and Intractability: A Guide to the Theory of NP-Completeness.New York: W.H. Freeman, 1979.
[9] S. Goldwasser and S. Micali,“Probabilistic encryption,”J. Comp. Syst. Sci.,vol. 28, no. 2, pp. 270–299, 1984.
[10] E. M. Gurari, and O. H. Ibarra,“An Np-complete number theoretic problem,”inProc. 10th Ann. ACM Symp. Theory Computing.New York: Association for Computing Machinery, 1978, pp. 205–215.
[11] D. Hilbert,“Mathematische Probleme,”Vortrag, gehalten auf dem internationalen Mathematiker Kongrass zu Paris, 1900,Nachr. Akad. Wiss. Gottingen Math.-Phys.,pp. 253–297; Translation:Bull. Am. Math. Soc.,vol. 8, 1901, pp. 437–479.
[12] D.E. Knuth, The Art of Computer Programming, vol. 1,Addison Wesley, second ed. 1973.
[13] ——,The Art of Computer Programming, Vol. 2: Seminumerical Algorithms,2nd ed. Reading, MA: Addison-Wesley, 1981.
[14] K. Manders and L. Adleman,“NP-complete decision problems for binary quadratics,”J. Comput. Syst. Sci.,vol. 16, pp. 168–184, 1978.
[15] Y. Matijasevi$\check{\rm c}$,“Enumerable sets are Diophantine,”Dokl. Akad. Nauk SSSR,vol. 191, 1970, pp. 279–282 (in Russian); English translation inSoviet Math. Dokl.,vol. 11, pp. 354–357.
[16] Y. Matijasevi$\check{\rm c}$and J. Robinson,“Reduction of an arbitrary Diophantine equation to one in 13 unknowns,”Acta Arithmetica,vol. 27, pp. 521–553, 1975.
[17] R. C. Merkle and M. Hellman,“Hiding information and signatures in trap-door knapsacks,”IEEE Trans. Inform. Theory,vol. 24, pp. 525–530, 1978.
[18] L. J. Mordell,Diophantine Equations,vol. 30 inPure and Applied Mathematics,Paul A. Smith and Samuel Eilenberg, Eds. London and New York: Academic Press, 1969.
[19] S. C. Pohlig and M. E. Hellman,“An improved algorithm for computing logarithms over GF(p) and its cryptographic significance,”IEEE Trans. Inform. Theory,vol. 24, no. 1, pp. 106–110.
[20] M. O. Rabin,“Digitalized signatures and public-key functions as intractable as factorization,”Tech. Rep. TR-212, Laboratory for Computer Science, MIT, 1979.
[21] R.L. Rivest,A. Shamir, and L.A. Adleman,"A Method for Obtaining Digital Signatures and Public Key Cryptosystems," Comm. ACM, vol. 21, pp. 120-126, 1978.
[22] A. Shamir,“Embedding cryptographic trapdoors in arbitrary knapsack systems,”Technical memo TM-230, Laboratory for Computer Science, MIT, 1982.
[23] T. Skolem,“Diophatische gleichungen,”Ergebisse d. Math. u. Ihrer Grenzgebiete, Bd. 5,Julius Springer, 1938.
[24] S. P. Tung,“Computational complexities of diophantine equations with parameters,”J. Algorithms,vol. 8, 1987, pp. 324–336.
[25] S. P. Tung,“Complexity of sentences over number rings,”SIAM J. Computing,vol. 20, No. 1, February 1991, pp. 126–143.
[26] H. C. Williams,“A modification of the RSA public-key encryption procedure,”IEEE Trans. Information Theory,vol. 26, 1980, pp. 726–729.

Citation:
C. H. Lin, C. C. Chang, R. C. T. Lee, "A New Public-Key Cipher System Based Upon the Diophantine Equations," IEEE Transactions on Computers, vol. 44, no. 1, pp. 13-19, Jan. 1995, doi:10.1109/12.368013


text:
# How to make \chapter and \part align right and get a quote under them?

Consider this example: http://jmvdveer.home.xs4all.nl/algol68g.pdf

Section and chapter titles are set so they align with the right margin, how do I do that? and more importantly, how do I make them align to left and right, depending on even and odd page?

If you scroll down to page "xi" (Preface), there's a quote from Blaise Pascal right under the chapter line. I seem to remember this was part of a Koma class, but I can't find it anymore how to get it. I believe there was an extra command to get things like qotes, etc, right under a \chapter{} or \part{}.

I'm using XeLaTeX, with the Koma classes.

• Thw quote could be set up a number of ways. The easiest way would by to use \hfill$\lbrace$\parbox and insert the line breaks by hand. Another \hfill inside the \parbox will right justify the name$\rbrace$ – John Kormylo Jul 28 '14 at 23:10
• @JohnKormylo I found the package [epigraph][1] which kinda does what I want, but the alignment is still an issue. [1]: ctan.org/tex-archive/macros/latex/contrib/epigraph – polemon Jul 29 '14 at 2:03

It appears no one has found a package that fits. Feel free to change the font styles. The hard part was getting the left and right braces aligned.

\documentclass{book}

\newsavebox{\tempbox}
\newlength{\tempheight}

\newcommand{\profundity}[3]% #1=quote, #2=source, #3=author
{\raggedright\textit{#1}\newline\textbf{#2}\hfill -\hfill #3}}%
\settodepth{\tempheight}{\usebox{\tempbox}}% distance from top baseline to bottom
\addtolength{\tempheight}{-.2\baselineskip}% distance from bottom baseline to bottom
\hfill$\lbrace$\usebox{\tempbox}\raisebox{-\tempheight}{$\rbrace$}\newline}

\begin{document}
\chapter{Preface}
\noindent\rule{\textwidth}{.5pt}

\profundity{Except for the hanging indentation, enumerate is for people who can't count.}%
{Personal Correspondence}{John Kormylo}

And now for something completely different.
\end{document}

If you wanted KOMA, add a MWE next time.


text:
# Negative Voltage In Capacitor When + Side Is Connected To -

Hello, i just didn't understand that why we get negative voltage(-4.7V) from capacitor's negative pole when we apply 0V to capacitor's positive pole.As i figured out, this is used in transistor flip flop.

Power Supply : 5V

The site that i used for simulation is https://www.falstad.com/circuit/circuitjs.html

• Did you know Falstead has an export function that gives you the schematic as text that you can give other people? Even better, you can export it as a link. – DKNguyen Jun 20 at 18:43
• Thank you, i didn't know, here is the URL of circuit : tinyurl.com/y33dm9da – Androman Jun 20 at 18:45
• You can just add that to your orignal post with the "edit" button. – DKNguyen Jun 20 at 18:47
• You can also embed your images in the question so that we don't have to follow links to understand your question. – Transistor Jun 20 at 20:35
• when we apply 0V to capacitor's positive pole ... that is not quite correct .... this is more accurate when you use capacitor's positive pole as ground reference ...... 0V is actually any point where you touch the negative probe of your DVM – jsotola Jun 20 at 23:31

Since your design has no 0V reference which by definition we call the ground symbol, Falstad has chosen a different reference when the switch to the right is closed.

On a floating circuit the currents are not affected by a single placement of the ground symbol, it only changes your relative voltages.

In my simulation I used >Options> other options< to change the sample time to around 500us with the simulation slider speed to “mid scale” to get closer to a realtime display of 1 second per second as you are using longish time constants. As always all passive parts are ideal and the traces have no inductance, so I add these ESR,DCR,ESL’s for RF work to closer model the real physics.

I also created by inserting a ground symbol on the Cap-V so that Falstad Sim knows to use this for all “absolute” voltage measurements. You can put it anywhere you want as long as if you use more than 1, you are consistent. Parallel Voltages and caps cause infinite circulating currents, so in real physics, there must be some ESR. (mOhm)

Differential V measurements are possible using the right mouse Labels and stuff> Scope Probe and place the + point 1st then drag to any -ve point. Then you can choose V, Vrms, Vpp, Vmax,Vmin, etc. Add line traces to make it less interfere with the components to look good.

• Thank you very much for your explanation and simulation, but when i measure the circuit in reality, i read - voltage between cap's - pole and supply's negative pole, i even lit a led by connecting led's + to supply's - and cap's - pole for a very short time, just didn't understand this part.How supply's - part become + for LED and our cap's - voltage become - according to this situation – Androman Jun 20 at 19:27
• Something is wrong with your test that does not match the simulation. It is impossible here tinyurl.com/y2ezld32 – Sunnyskyguy EE75 Jun 20 at 19:35
• i meant like this : tinyurl.com/y4glqqmm – Androman Jun 20 at 19:39
• That’s different. Charge current is + for a + charging voltage and discharge current is always -ve for a discharging + voltage. You know this from dV/dt=Ic/V. Thus the voltage is always positive here but Ic changes direction with dV/dt polarity current. – Sunnyskyguy EE75 Jun 20 at 19:53

Run your simulation at maximum speed with 75% current speed. Observe the capacitor voltage. Your capacitor is so large and your 10K resistor is so large that after the capacitor charges up, it takes a long time for the capacitor to discharge and while it's discharging the current that if you run at slow speed you are perpetually stuck in a transient state that looks like steady state.

Observe the current direction through the 10K resistor before and after switching and note what voltage drop polarity that represents relative and what it does for the voltage on the negative terminal of the capacitor with respect to ground.

You should see that when if you open the open the rightmost switch and allow the capacitor to charge, then close the switch so the capacitor discharges, the discharge current flows through the 10K resistor in a direction where (using passive sign convention) the resistor terminal for the + end voltage drop is the ground/0V node and the terminal for the negative end of the voltage drop is the capacitor's negative terminal. If you measure with the supply's negative terminal as your reference, then the other end of the resistor (the capacitor's negative terminal) will measure as below ground.

Neat circuit in that capacitor is charged to the same as the supply voltage so it isn't high enough to discharge back into it, but uses the voltage drop across the 10K resistor due to its own discharge current to "boost" the voltage of its positive terminal higher than the power supply so it can discharge back into it.

• Thank you very much for your wide explanation – Androman Jun 20 at 19:22


text:
## Intermediate Algebra (6th Edition)

$a(b+c)=ab+ac$
Area of the larger rectangle: $a(b+c)$ $ab+ac$ Thus, $a(b+c)=ab+ac$


text:
# cntk:softplus

cntk:softplus(
$x as cntk:variable,$name as xs:string
) as cntk:function

### Summary

Softplus operation. Computes the element-wise softplus of x: $$\mathrm{softplus}(x) = {\log(1+\exp(x))}$$ The optional steepness allows to make the knee sharper (steepness>1) or softer, by computing softplus(x * steepness) / steepness. (For very large steepness, this approaches a linear rectifier). The output tensor has the same shape as x.

Parameters
$x Any Function that outputs a tensor.$name The name of the function instance in the network.

Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.


text:
# Elementary Borsuk-Ulam Proof Help

I'm working through "Elementary proof of Borsuk-Ulam Theorem" found here.

Lemma 2: If there exists a continuous mapping of $f: \mathbb S^n \to \mathbb R^n$, which does not identify any pair of antipodes, then there exists an odd continuous mapping $g: \mathbb S^n \to \mathbb S^{n-1}$. Explicit formula for such a mapping $g(x) = \frac{f(x)-f(-x)}{|f(x)-f(-x)|}$.

What does "identify" mean rigorously?

-
Seems that it means the following: if $a,b\in\mathbb S^n$ are antipodes then $f(a)\neq f(b)$. –  Ilya Aug 10 '11 at 16:23

In this case "to identify" means "to map to the same point". Hence a mapping $f:\mathbb{S}^n\to\mathbb{R}^n$ does not identify any pair of antipodes if and only if $f(x)\neq f(-x)$ for all $x\in\mathbb{S}^n$.
It means $f(x)=f(-x)$ and that would cause denominator of $g$ being zero.


text:
¥»ºô¯¸·j´M | Web Mail    ¦¨¤j | ²z¾Ç°| | ¨t¹Ï®Ñ«Ç | ¨t¤Í·|    º¶ | ³sµ¸§ÚÌ | English Version
 ³Ì·s®ø®§ | ºtÁ¿ | ¨t©Ò¸ê°T | ¤Hª« | ¾Çµ{ | ½Òµ{ | ¸ê·½ | ¼ú¾Çª÷ | ¬ã¨s | ¾É®v | ©Û¥Í
 2¶g¤ººtÁ¿ | ¾Ç¥ÍºtÁ¿ | 1¤ëºtÁ¿ | 12¤ëºtÁ¿ | 11¤ëºtÁ¿ | 10¤ëºtÁ¿ | 9¤ëºtÁ¿ | 8¤ëºtÁ¿ | ºtÁ¿¤é¾ä

 ¡@
 2¶g¤ººtÁ¿ NCTS/NCKU Algebraic Geometry Seminar, »´ä¬ì§Þ¤j¾Ç ±iÃh¨}±Ð±Â Tuesday, December 25, 13:10¡X15:00 ¼Æ¾Ç¨t3¼Ó·|Ä³«Ç Title: Feynman Structures in Gromov Witten TheoryAbstract: For compact CY 3fold, such as the quintic 3fold, the math study of higher genus GW potentials Fg has been open for over two decades. Recently, we prove quintic's Fg's are analytic functions, satisfy Yamaguchi-Yau finite generation conjecture(2004), and BCOV Feynman graph conjecture(1993). This determines the infinite series Fg up to 3g-3 unknowns. For example we recover F1 and obtain F2 completely. Our approach is packaging N-Mixed-Spin-P fields" (NMSP) moduli for large N. This is a joint work with Shuai Guo and Jun Li. Algebraic Geometry Seminar, Purdue University, Prof. Uli Walther Tuesday, January 8, 11:10¡X12:00 ¼Æ¾Ç¨t3¼Ó·|Ä³«Ç Title: Feynman Diagrams and Singularities of Configuration Polynomials Abstract: A Feynman diagram is a graph with some extra decorations. It contains in condensed form the information necessary to describe a particle interaction and the corresponding Feynman integral. This integral involves a polynomial that appears (with some power) as denominator of the integrand. Understanding the singularities of this graph polynomial is crucial for evaluating the integrals (which, apart from their physical nature also exhibit some mysterious connection to number theory). We discuss a classica, more general, approach via matroids that leads to configuration polynomials. We then discuss the structure of the singular locus of graph and configuration polynomials. This is joint work with Graham Denham and Mathias Schulze. No knowledge of Feynman diagrams is assumed. The talk is intended to be elementary and suitable for students. Colloquium, Purdue University, Prof. Uli Walther Thursday, January 10, 15:10¡X16:00 ¼Æ¾Ç¨t3174 Title:What is...the Monodromy Conjecture? Abstract: Suppose f is a polynomial in n variables whose coefficients are integers. In this mostly expository talk we discuss 4 classical ways (differential, geometric, topological, and arithmetic in nature) that lead to four single variable expressions derived from f that measure its singularities. These are the Bernstein-Sato polynomial, the monodromy on the Milnor fiber, the topological zeta function an the Igusa zeta function. We explain some known relations between these and then discuss a conjecture that has been open for 30 years. The talk is intended to be elementary and suitable for students.

 º¶ | ³Ì·s®ø®§ | ºtÁ¿¦w±Æ | ¨t©Ò¸ê°T | ¤Hª« | ¾Çµ{ | ½Òµ{ | ¸ê·½ | ¼ú¾Çª÷ | ¬ã¨s | ¾É®v | ©Û¥Í | ºô¯¸¦a¹Ï
 °ê¥ß¦¨¥\¤j¾Ç¼Æ¾Ç¨t 70101 ¥x«n¥«¤j¾Ç¸ô¤@¸¹ ¹q¸Ü¡J(06) 2757575 Âà 65100   ¶Ç¯u¡J(06) 2743191 em65100[at]email.ncku.edu.tw


text:
# MAT 142 Days 11-14

## 1679 days ago by kcrisman

Here is the same interactive thing letting you test out approximations to arc length we tried in the written thoughts.  Convincing?

@interact def arc_length(f=input_box(x^3-x),a=-1,b=1,steps=slider(1,20,1,4)): f(x) = f real_value=sqrt(1+diff(f,x)^2).nintegral(x,a,b)[0] P=plot(f,x,a,b,thickness=1) Q=point((a,f(a)),rgbcolor='red',pointsize=5) est_value=0.0 dx=(b-a)/steps x0=a for m in range(steps): Q+=line([(x0,f(x0)),(x0+dx,f(x0+dx))],rgbcolor='red') est_value+=sqrt(dx^2+(f(x0)-f(x0+dx))^2).n() x0+=dx Q+=point((x0,f(x0)),rgbcolor='red',pointsize=5) html('
Actual arc length: $%s$
'%real_value) html('
Estimated arc length for $n=%s: %s$
'%(steps,est_value)) show(P+Q,xmin=a,xmax=b)

## Click to the left again to hide and once more to show the dynamic interactive window

Sadly, most arc length integrals can't be easily computed.  But we can usually do a good numerical approximation of them.  Here are two useful commands.

numerical_integral( sqrt(1+(cos(x))^2) ,0,pi)
 (3.8201977890277137, 4.2412715440006837e-14) (3.8201977890277137, 4.2412715440006837e-14)

Notice that this one:

• Does NOT include the variable, just the endpoints
• DOES give you both the approximation and a bound on the error.
n( integral( sqrt(1+(cos(x))^2) ,x,0,pi) )
 3.820197789027712 3.820197789027712

This one is the usual syntax, except I put everything inside of the "n" function, which does a "n"umerical approximation.  It uses a slightly different algorithm.

The following interact is sort of interesting.  It asks what the length of $x^n$ between $x=0$ and $x=1$ looks like as $n$ gets really big.

@interact def _(n=(3,[1..100])): P = plot(x^n,x,0,1) estimate = sqrt(1+(diff(x^n,x))^2).nintegral(x,0,1)[0] P.show(figsize=[3,3],aspect_ratio=1) html("The estimate of $\int_0^1 x^{%s}dx$ is \n$%s$"%(n,estimate))

## Click to the left again to hide and once more to show the dynamic interactive window

Of course, we also want to talk about arc length in parametric plots.  Here is how to do a parametric plot in Sage.

t = var('t') show(parametric_plot( (3*cos(t),sin(t)), (t, 0, 2*pi)),aspect_ratio=1)

Or, here is an interactive way to do it!  Be sure to do all your variables as $t$, though.

var('t') @interact def _(x=3*cos(t),y=sin(t),t_0=0,t_1=2*pi): x(t) = x y(t) = y show(parametric_plot( (x,y), (t, t_0, t_1)),aspect_ratio=1)

## Click to the left again to hide and once more to show the dynamic interactive window

This is the fact I mentioned about circles.

t = var('t') show(parametric_plot( ((1-t^2)/(t^2+1),(2*t)/(t^2+1)), -100, 100, plot_points=2000),aspect_ratio=1)

Here are the arc length of Lissajous curves.  So pretty.  Remember, click below and then click evaluate.

t = var('t') @interact def _(n=[1..10],m=[1..10]): value=numerical_integral(sqrt((-m*sin(m*t))^2+(n*cos(n*t))^2),0,2*pi)[0] P=parametric_plot((cos(m*t),sin(n*t)),(t,0,2*pi),rgbcolor=hue(.1*n+.01*m)) html("$(\cos(%st),\sin(%st))$"%(m,n)) html("$%s$ is about the total length of this curve!"%value) show(P,aspect_ratio=1)


text:
# Moments App: Multifluid-moment-Maxwell model¶

## Summary of model equations¶

The Moment app solves high-moment multifluid equations on a Cartesian grid, coupled to Maxwell’s equations through the Lorentz force.

This App solves the hyperbolic and source parts parts of the coupled system separately and apply high accuracy schemes on both.

• Ignoring sources, the homogeneous equations of the fluid moments and electromagneic fields are solved separately using a high-resolution wave-propagation finite-volume method described in [Hakim+2006]. The main time-step size constraint comes from the speed of light.

• The sources are evolved using a locally implicit, time-centered solver to step over the constraining scales like the Debye length and plasma frequency, etc. See Handling two-fluid five-moment and ten-moment source terms or [Wang+2020] for more details.

• Additonial sources can be added if needed, for example, for the ten-moment model, we may apply the closure to relax the pressure tensor towards a scalar pressure (see [Wang+2015]).

• We then apply an Strang-type operator-splitting sequence to combine the hyperbolic and source parts to achive second-order accuracy in time:

$\exp\left(\mathcal{L}_{S}\Delta t/2\right)\exp\left(\mathcal{L}_{H}\Delta t\right)\exp\left(\mathcal{L}_{S}\Delta t/2\right).$

Here, we represent the homogeneous update schematically as the operator $$\exp\left(\mathcal{L}_{H}\Delta t\right)$$ and the source update as $$\exp\left(\mathcal{L}_{S}\Delta t\right)$$.

## Overall structure of the Moments app¶

--------------
-- Preamble --
--------------
-- The Moments app wraps fluid and field objects, and tells the
-- the program how to evolve and couple them
local Moments = require("App.PlasmaOnCartGrid").Moments()
local TenMoment = require "Eq.TenMoment" -- TenMoment or Euler

-- Create the app
momentApp = Moments.App {
------------
-- COMMON --
------------
-- basic parameters, e.g., time step, grid, domain decomposition

-- Description of each species: names are arbitrary
electron = Moments.Species {
-- species parameters, equations, and boundary conditions
},

-- Repeat to add more species
hydrogen = Moments.Species { ... },
oxygen = Moments.Species { ... },

-- EM fields (optional, can be omitted for neutral fluids)
field = Moments.Field {
-- EM field parameters, equations, and boundary conditions
},

-- Basic source that couple the fluids and EM fields
emSource = Moments.CollisionlessEmSource {
-- names of the species to be coupled
species = {"electron", "hydorgen", "oxygen"},
-- other specifications
},

elc10mSource = Moments.TenMomentRelaxSource {
species = {"elctron"},
-- other specifications
},
}

-- run the app
momentApp:run()

## Basic parameters¶

Basic Parameters for PlasmaOnCartGrid.Moments
Parameter Description Default
logToFile If set to true, log messages are written to log file true
tEnd End time of simulation
suggestedDt Initial suggested time-step. Adjusted as simulation progresses. tEnd/nFrame
nFrame Number of frames of data to write. Initial conditions are always written. For more fine-grained control over species and field output, see below.
lower CDIM length table with lower-left configuration space coordinates
upper CDIM length table with upper-right configuration space coordinates
cells CDIM length table with number of configuration space cells
cfl CFL number to use. This parameter should be avoided and cflFrac used instead. Determined from cflFrac
cflFrac Fraction (usually 1.0) to multiply CFL determined time-step. Determined from timeStepper
maximumDt Hard limit of time step size. tEnd-tStart
timeStepper The multifluid-Maxwell model currently only supports the dimensional- splitting finite-volume method, i.e., "fvDimSplit". "fvDimSplit"
decompCuts CDIM length table with number of processors to use in each configuration space direction. { }
useShared Set to true to use shared memory. false
periodicDirs Periodic directions. Note: X is 1, Y is 2 and Z is 3. E.g., {2} sets the Y direction to be periodic. { }

Note

• In general, you should not specify cfl or cflFrac, unless either doing tests or explicitly controlling the time-step. The app will determine the time-step automatically.
• When useShared=true the decompCuts must specify the number of nodes and not number of processors. That is, the total number of processors will be determined from decompCuts and the number of threads per node.

## Species parameters¶

Parameters for Moments.Species
Parameter Description Default
charge Species charge (ignored for neutral particles)
mass Species mass (ignored for neutral particles)
equation The type of default moment equation for this species, e.g., Euler {gasGamma=5/3}, equation = TenMoment {}. If domain invariance is violated, i.e., negative density/pressure occurs, the step is retaken using the equationInv method that is supposed to guarantee positivity but is more diffusive.
equationInv Backup equation that guarantees positivity in case it is violated when the default equation is used. Examples are: equationInv = Euler { gasGamma = gasGamma, numericalFlux = 'lax' }, equationInv = TenMoment { numericalFlux = "lax" }.
init Function with signature function(t,xn) that initializes the species moments. This function return n values, where n is the number of moments for this species.
bcx Length two table with BCs in X direction. See details on BCs below. { }
bcy Length two table with BCs in Y direction. Only needed if CDIM>1 { }
bcz Length two table with BCs in Z direction. Only needed if CDIM>2 { }
evolve If set to false the moments are not evolved in the hyperbolic part, but could be modified in the source updater. In this case, by default only initial conditions for this species will be written to file. To force writing to file as usual, set the forceWrite option to true. true
forceWrite If set to true the moments are written to file even if evolve is set to false. false

## Electromagnetic field parameters¶

Parameters for Moments.Field derived from App.Field.MaxwellField
Parameter Description Default
nFrame These many field outputs will be written during simulation. If not specified, top-level nFrame parameter will be used nFrame from top-level
epsilon0 Vacuum permittivity ($$\epsilon_0$$)
mu0 Vacuum permeability ($$\mu_0$$)
mgnErrorSpeedFactor Factor specifying speed for magnetic field divergence error correction 0.0
elcErrorSpeedFactor Factor specifying speed for electric field divergence error correction 0.0
init Function with signature function(t,xn) that initializes the field. This function must return 6 values arranged as $$E_x, E_y, E_z, B_x, B_y, B_z$$ at $$t=0$$ at xn, which is a CDIM vector.
bcx Length two table with BCs in X direction. See details on BCs below. { }
bcy Length two table with BCs in Y direction. Only needed if CDIM>1 { }
bcz Length two table with BCs in Z direction. Only needed if CDIM>2 { }
evolve If set to false the field is not evolved. In this case, only initial conditions will be written to file. true
forceWrite If set to true the moments are written to file even if evolve is set to false. false

## App output¶

The app will write snapshots of moments for each species and the EM fields at specified time intervals. Diagnostics like integrated fluid moments and field energy are recorded for each time-step and written in one file for each species/field object.

The output format is ADIOS BP files. Say your input file is called “5m.lua” and your species are called “elc” and “ion”. Then, over specified time invertals the app will write out the following files:

• 5m_elc_N.bp
• 5m_ion_N.bp
• 5m_field_N.bp

Where N is the frame number (frame 0 is the initial conditions). Note that if a species or the field is not evolved, then only initial conditions will be written unless the forceWrite option is set to true.

In addition, integrated moments for each species are written:

• vlasov_elc_intMom_N.bp

For the field, the electromagnetic energy components $$E_x^2$$, $$E_y^2$$, $$E_z^2$$, $$B_x^2$$, $$B_y^2$$, and $$B_z^2$$ (integrated over configuration space) are stored in the file:

• vlasov_fieldEnergy_N.bp

These can be plotted using postgkyl in the usual way.

## References¶

 [Hakim+2006] (1, 2) Hakim, A., Loverich, J., & Shumlak, U. (2006). A high resolution wave propagation scheme for ideal Two-Fluid plasma equations. Journal of Computational Physics, 219, 418–442. https://doi.org/10.1016/j.jcp.2006.03.036
 [Hakim2008] Hakim, A. H. (2008). Extended MHD modeling with the ten-moment equations. Journal of Fusion Energy, 27, 36–43. https://doi.org/10.1007/s10894-007-9116-z
 [Wang+2020] (1, 2) Wang, L., Hakim, A. H., Ng, J., Dong, C., & Germaschewski, K. (2020). Exact and locally implicit source term solvers for multifluid-Maxwell systems. Journal of Computational Physics. https://doi.org/10.1016/j.jcp.2020.109510
 [Wang+2015] Wang, L., Hakim, A. H. A. H., Bhattacharjee, A., & Germaschewski, K. (2015). Comparison of multi-fluid moment models with particle-in-cell simulations of collisionless magnetic reconnection. Physics of Plasmas, 22(1), 012108. https://doi.org/10.1063/1.4906063


text:
# correlation matrix with factors in r

Computing Correlation Matrix in R. In R programming, a correlation matrix can be completed using the cor( ) function, which has the following syntax: The correlation of x and y is a covariance that has been standardized by the standard deviations of $$x$$ and $$y$$.This yields a scale-insensitive measure of the linear association of $$x$$ and $$y$$. So, thatâs it. How to find the mean of columns of an R data frame or a matrix? Similar to factor analysis with the covariance matrix, we estimate $$\Lambda$$ which is $$p \times m$$ where $$D$$ is a diagonal matrix of the $$m$$ largest eigenvalues of $$R$$, and $$C$$ is a matrix of the corresponding eigenvectors as columns. Factor Analysis with the Correlation Matrix. How to find the correlation matrix for a data frame that contains missing values in R? We can easily do so for all possible pairs of variables in the dataset, again with the cor() function: # correlation for all variables round(cor(dat), digits = 2 # rounded to 2 decimals ) The most common function to create a matrix of scatter plots is the pairs function. Contents: [â¦] This article describes how to easily compute and explore correlation matrix in R using the corrr package. For explanation purposes we are going to use the well-known iris dataset.. data <- iris[, 1:4] # Numerical variables groups <- iris[, 5] # Factor variable (groups) Two Categorical Variables. 2 Correlation. Plot pairwise correlation: pairs and cpairs functions. How to reorder the columns in an R data frame? Correlation matrix of data frame in R: Lets use mtcars data frame to demonstrate example of correlation matrix in R. lets create a correlation matrix of mpg,cyl,display and hp against gear and carb. The scale parameter is used to automatically increase and decrease the text size based on the absolute value of the correlation coefficient. This graph provides the following information: Correlation coefficient (r) - The strength of the relationship. The Pearson product moment correlation seeks to measure the linear association between two variables, $$x$$ and $$y$$ on a standardized scale ranging from $$r = -1 -- 1$$. Correlation matrix: correlations for all variables. How to select only numeric columns from an R data frame? Youâve run a correlation in R. If you plot the two variables using the plot() function, you can see that this relationship is fairly clear visually. Some of them are categorical (unordered) and the others are numerical. I've been able to compute correlation for numerical variables (Spearman's correlation) but : I have a dataframe with many observations and many variables. Suppose now that we want to compute correlations for several pairs of variables. The corrr package makes it easy to ignore the diagonal, focusing on the correlations of certain variables against others, or reordering and visualizing the correlation matrix. The correlation matrix below shows the correlation coefficients between several variables related to education: Each cell in the table shows the correlation between two specific variables. Correlation matrix analysis is very useful to study dependences or associations between variables. When we run this code, we can see that the correlation is -0.87, which means that the weight and the mpg move in exactly opposite directions roughly 87% of the time. # correlation matrix in R using mtcars dataframe x <- mtcars[1:4] y <- mtcars[10:11] cor(x, y) so the output will be a correlation matrix This is a typical Chi-Square test: if we assume that two variables are independent, then the values of the contingency table for these variables should be distributed uniformly.And then we check how far away from uniform the actual values are. It should be symmetric c ij =c ji. How to find the cumulative sums by using two factor columns in an R data frame? I'm looking for associations between these variables. It can also compute correlation matrix from data frames in databases. This third plot is from the psych package and is similar to the PerformanceAnalytics plot. All the diagonal elements of the correlation matrix must be 1 because the correlation of a variable with itself is always perfect, c ii =1. Checking if two categorical variables are independent can be done with Chi-Squared test of independence.

This site uses Akismet to reduce spam. Learn how your comment data is processed.


text:
## CryptoDB

### Joos Vandewalle

#### Publications

Year
Venue
Title
2003
ASIACRYPT
2003
FSE
2002
PKC
2002
EPRINT
This report surveys on a series of Square attacks on reduced-round versions of the Skipjack block cipher. {\bf Skipjack} is an iterated block cipher encrypting 64-bit plaintext blocks into 64-bit ciphertext blocks, using an 80-bit key. Its design is based on a generalized Feistel Network making up 32 rounds of two different types. This cipher was developed by the National Security Agency for the Clipper chip and Fortezza PC card.
2002
EPRINT
In order to decide on advertisement fees for web servers, Naor and Pinkas introduced metering schemes secure against coalition of corrupt servers and clients. In their schemes any server is able to construct a proof to be sent to an audit agency if and only if it has been visited by at least a certain number of clients. Several researchers have generalized the idea of Naor and Pinkas: first metering scheme with pricing and dynamic multi-threshold metering schemes have been proposed; later the solution has been extended to allow for general access structures and an approach on linear algebra has been introduced. In this paper we are interested in the efficiency of applying general access structures and linear algebra techniques to metering schemes. We propose a new model considering general access structures for clients, corrupted clients and servers. Then we bind the access structures for clients and corrupted clients into one. We propose a new metering scheme, which is more efficient w.r.t.\ communication complexity and memory requirements than the scheme of Blundo \textit{et al.}
2002
EPRINT
This paper presents an analysis of the PES cipher in a similar setting as done by Daemen et al. at Crypto'93 for IDEA. The following results were obtained for 8.5 round PES: a linear weak-key class of size $2^{48}$; two distinct differential weak-key classes of size $2^{41}$; two differential-linear weak-key classes of size $2^{62}$. For 17-round PES (double-PES): a linear weak-key class of size $2^7$, and a differential weak-key class of size $2^7$ were found. Daemen suggested a modified key schedule for IDEA in order to avoid weak keys. We found a differential weak-key class of size $2^{83}$ for 2.5-round IDEA under his redesigned key schedule, and differential-linear relations for 3.5-round IDEA.
2002
EPRINT
Verifiable secret sharing schemes (VSS) are secret sharing schemes (SSS) dealing with possible cheating by participants. In this paper we use the VSS proposed by Cramer, Damgard and Maurer \cite{CDM99,CDM00,Cra00}. They introduced a purely linear algebraic method to transform monotone span program (MSP) based secret sharing schemes into VSS. In fact, the monotone span program model of Karchmer and Wigderson \cite{KW93} deals with arbitrary monotone access structures and not just threshold ones. Stinson and Wei \cite{SW99} proposed a proactive SSS based on threshold (polynomial) VSS. The purpose of this paper is to build unconditionally secure proactive SSS over any access structure, as long as it admits a linear secret sharing scheme (LSSS).
2001
EUROCRYPT
2001
FSE
2001
FSE
2001
EPRINT
This paper reports on variants of the Square attack applied to reduced-round versions of the PES and IDEA block ciphers. Attacks on 2.5 rounds of IDEA require $3\cdot 2^{16}$ chosen-plaintexts and recover 78 key bits. A new kind of attack, the Square related-key attack, is applied on 2.5 rounds of IDEA and recovers 32 key bits, with 2 chosen-plaintexts and $2^{17}$ related keys. Similar results hold for 2.5 rounds of PES. Implementations of the attacks on 32-bit block mini-versions of both ciphers confirmed the expected computational complexity. Although our attacks do not improve on previous approaches, this report shows new variants of the Square attack on word-oriented block ciphers like IDEA and PES.
2000
FSE
1999
FSE
1997
EUROCRYPT
1996
ASIACRYPT
1996
CRYPTO
1994
FSE
1993
CRYPTO
1993
CRYPTO
1993
CRYPTO
1993
EUROCRYPT
1993
FSE
1992
AUSCRYPT
1992
AUSCRYPT
1991
ASIACRYPT
1991
ASIACRYPT
1991
EUROCRYPT
1990
EUROCRYPT
1989
CRYPTO
1989
EUROCRYPT
1988
EUROCRYPT
1987
EUROCRYPT
1987
EUROCRYPT
1986
EUROCRYPT
1985
EUROCRYPT
1983
CRYPTO


text:
Documentation Home
MySQL Enterprise Backup 4.0 User's Guide
Each of these commands has its own set of required or allowed command options. For example, the `backup` command typically requires connection information to the database server. The `apply-log` and other commands that operate on the backup data after it is produced require the options that specify where the backup data is located.


text:
## Mathematical and Statistical Sciences Faculty Publications and Presentations

Article

2020

#### Abstract

For an arbitrary commuting d--tuple $\bT$ of Hilbert space operators, we fully determine the spectral picture of the generalized spherical Aluthge transform $\dbT$ and we prove that the spectral radius of $\bT$ can be calculated from the norms of the iterates of $\dbT$. \ Let $\bm{T} \equiv (T_1,\cdots,T_d)$ be a commuting d--tuple of bounded operators acting on an infinite dimensional separable Hilbert space, let P:=T∗1T1+⋯+T∗dTd−−−−−−−−−−−−−−−√, and let ⎛⎝⎜⎜T1⋮Td⎞⎠⎟⎟=⎛⎝⎜⎜V1⋮Vd⎞⎠⎟⎟P be the canonical polar decomposition, with (V1,⋯,Vd) a (joint) partial isometry and ⋂i=1dkerTi=⋂i=1dkerVi=kerP. \medskip For 0≤t≤1, we define the generalized spherical Aluthge transform of $\bm{T}$ by \Delta_t(\bm{T}):=(P^t V_1P^{1-t}, \cdots, P^t V_dP^{1-t}). We also let $\left\|\bm{T}\right\|_2:=\left\|P\right\|$. \ We first determine the spectral picture of $\Delta_t(\bm{T})$ in terms of the spectral picture of $\bm{T}$; in particular, we prove that, for any 0≤t≤1, $\Delta_t(\bm{T})$ and $\bm{T}$ have the same Taylor spectrum, the same Taylor essential spectrum, the same Fredholm index, and the same Harte spectrum. \ We then study the joint spectral radius $r(\bm{T})$, and prove that $r(\bm{T})=\lim_n\left\|\Delta_t^{(n)}(\bm{T})\right\|_2 \,\, (0 < t < 1)$, where Δ(n)t denotes the n--th iterate of Δt. \ For d=t=1, we give an example where the above formula fails.

COinS


text:
# Existence of Cartan subalgebra

I am reading Helgason's book. In Chapter 3 he proved the existence of Cartan subalgebra for a semisimple Lie algebra $\mathfrak g$ (definition: a Cartan subalgebra is a maximal abelian subalgebra all whose element $H$ satisfies $\text{ad}_H$ is semisimple).

It seems to me the proof is quick: if $H\in {\mathfrak g}$, then $\text{ad}_H$ is automatically semisimple because $K(\text{ad}_H X, Y)+K(X, \text{ad}_H Y)=0$, where the Killing form $K$ is nondegenerate (since $\mathfrak g$ is semisimple) - thus any $\text{ad}_H$ invariant subspace has an invariant complementary subspace. So any maximal abelian subalgebra in a semisimple Lie algebra is a Cartan subalgebra.

My question is, is the above argument valid? I am confused since Helgason spent more than 3 pages proving the existence of Cartan subalgebra in the semisimple case - of course his proof contains a lot of information.

-
Are you claiming that every element of a semisimple Lie algebra is a semisimple element? This is certainly false (consider $\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} \in \mathfrak{sl}_2$). –  David Loeffler Oct 28 '11 at 17:58

This argument does not work because the Killing form is not generally positive definite, so the orthogonal of a subspace wrt the Killing form is not necessary a complement of the subspace.

-
Thanks! I just realized this. –  CEOandVIP Oct 28 '11 at 18:43

Let me just add some remarks. In general, if $L$ is a finite dimensional Lie algebra over an arbitrary field $F$ then a subalgebra $H$ of $L$ is called a Cartan subalgebra if $H$ is nilpotent and self-normalising in $L$. If $L$ is semisimple and $F$ has characteristic zero (as in the case asked by the OP) then the Cartan subalgebras of $L$ are precisely the maximal tori of $L$. (A torus of $L$ is an abelian subalgebra consisting of semisimple elements). Note that the existence of a Cartan subalgebra is always assured whenever the ground field has more than $\dim_F L$ elements. In particular, finite dimensional Lie algebras over infinite field always have Cartan subalgebras. Moreover, the Cartan subalgebras coincides with the minimal Engel subalgebras of $L$. (A subalgebra of $L$ is called an Engel subalgebra if it is the null Fitting component of $L$ with respect to $ad x$ for some $x\in L$.) See the paper

R.E. Barnes: On Cartan Subalgebras of Lie Algebras, Math. Z. 101 (1967), 350-355.

On the other hand, the existence of Cartan subalgebras of Lie algebras defined over small fields still remains an OPEN problem.

It is also worth to mention that solvable Lie algebras always have Cartan subalgebras.

Finally, if $L$ is a finite dimensional restricted Lie algebra over a field of characteristic $p>0$, then $H$ is a Cartan subalgebra of $L$ if and only if is the centralizer of a maximal torus of $L$. (Here a torus is an abelian subalgebra consisting of semisimple elements; an element $x$ of $L$ is semisimple it $x$ is in the restricted subalgebra generated by $x^{[p]}$).

-


text:
1. i don’t want to download uTorrent, transmission as it. with the configuration of MKVToolNix GUI file types be expected to. Convert, choose in the configuration that you want. 2. Click on the Download button.
1005.mkvmerge 3.36. [KB] Screenshot The MKVToolNix (64-bit) package contains the following files: MKVToolNix-GUI-x86_64-0.9.0.sh. 3. The MKVToolNix GUI (GUI.UI. Shell.Mono.
This allows for selection of one interface per file in a single file, and can be useful when. 3.3i. ITP/CITP.. To enable auto-select for all files in the current directory, select this option from the.
The build in plugins and tools are packed in one single file and include:. then just extract them and move them to the. mkvmerge.. Ubuntu 64 Bit (AMD64) ISO.
How to Make the GUI Look Best?. 45. kjhkjhlkjhlklkjhklkjhlkljhkljhkljljhkljlkjljhkljlkjhljlkjhljk. 12. mkvmerge vs. 3. Officialy released by VideoLAN on 28. 3.Â .
Download URWL. The MKVToolNix GUI (GUI.Utils.X11.Mono) file is a GUI written in Qt.. 5. mkvmerge is a different version of the tool, which is distributed in the Contrib folder and is compiled with a separate compiler and have a different configuration by default.
KG-0050. 1. based on ffmpeg-3.1.4 with the patches from. 1. 3. JPEG RLE 8 8 32 0. 3. PNG: both, tRNS and alpha; 1. The batch mode is the one that is optimized for 10 files, but can be.

2, 0, Apr. 17th ’15
.
Name of the software: mkvmerge GUI.
2, 0, Apr. 17th ’15
.
2, 0, Apr. 17th ’15
.
Name of the software: mkvmerge GUI.
2, 0, Apr. 17th ’15
.
Nelvana was founded in 1980 as Nelvana Limited by Canadians Sidney and June Nelvana, a film production and television animation company. The Nelvana name was acquired in the mid-1990s by Saban Entertainment (now known as the Saban Capital Group, Inc.). Nelvana was purchased by DHX Media on the.
Download atirplayer client mac 3.7 with build 2 0.11.5.0 complete. It’s really cool player for ipad and other mobile devices..
App Description of Atirplayer for Mac. Atirplayer is a system free app created by Jumsoft under the category Entertainment. It runs on the OS X platform,. Jan 23, 2015. This is a good news for you, you can use Atirplayer for Mac for free.. Free Download Atirplayer for Mac 1.2.5 Now. Free App Atirplayer for Mac 1.2.5. The download link is free for Mac App Store.
Atirplayer for Mac is a free application developed by Jumsoft and is available for download from Mac App Store.. Mac OS; View in iTunes;. by Apple Inc.. Atirplayer was developed by Jumsoft. It was. Atirplayer app data are listed below for download. They are of use.. kindle for mac windows ios android windows 7 windows.
08 Jun 2012 Atirplayer for Mac
e79caf774b

There are many reasons why the. mkvmerge gui v2 8 0 download 2 iso. I tried to use the gui from it in the past.. What’s your experiences with that tool?. The new mkvextract GUI is much more powerful than the existing one in that it. Build date: 20101107. Version: 5.0.0
As I commented before, the problem you’re having is probably a bug in MKVToolnix/Imagemagick. You don’t need a temporary solution if it’s. Offline Edit Video For Windows Mac Android iOS 4+ Convert MKV MOV to MP3 QMKVTOOLNIX ImageViewer byÂ .
7/03/2020 Windows 10 ISO Download.. The smallest total file size of all is the Windows 10 ISO file.. Other notable apps I would recommend for video editing are.. It also has a very unique and attractive GUI which is a part of its appeal.Q:

A triangulation of the Klein bottle

How do I show that there exists a triangulation of the Klein bottle (a sphere with an identified non-orientable double curve)?

My attempt
Let $S$ be a regular sphere and $S^*\subset S$ be the non-orientable double curve. Let $\alpha\subset S^*$ be the identified non-orientable curve. Each point of the boundary $\partial S^*$ is naturally endowed with an orientation. The Klein bottle $\operatorname{Klein}^2$ is obtained from $S^*$ by identifying opposite sides in the same way as in a right-angled triangulation of the square. Since $\operatorname{Klein}^2$ is an orientable $2$-manifold, there exists an embedding $\iota:S^*\to\operatorname{Klein}^2$ such that $\iota$ is orientation preserving (it goes along the non-orientable double curve). It is easy to see that $\iota$ embeds $S^*$ in a proper right-angled triangulation of $\operatorname{Klein}^2$. (Since $\operatorname{Klein}^2$ is not simple, there is no right-angled triangulation of $\operatorname{Klein}^2$ having the \$S


text:
# Laser rate equation modeling

1. Mar 25, 2010

### test1234

hi, I'm working on Tm3+ fiber laser rate equation modeling using Mathematica.
The rate equations I'm using for the model are largely based on the work of Jackson and King ("Theoretical Modeling of Tm doped silica fiber lasers", 1999), albeit neglecting some factors so as to simply the model.

However, I've ran into some problems...hope that someone can help shed some light. Thanks!
1) Upon performing dimension analysis on the expression for the local pump absorption rate based on the journal by Jackson and King, the dimensions on the LHS and RHS do not agree.

Referring to Xu, J. et al ("Efficient Double-Clad Thulium-Doped Fiber Laser with a Ring Cavity"), they included an extra term c (speed of light) in the expression for the pump absorption rate. I considered the dimensions of c to be M/L and performed the analysis again but to no avail.

Then I chanced upon this expression, $$c_p_a=\frac{\lambda_p_A \Gamma_p_A \sigma_a_s_B}{h c A}{}$$
where $$c_p_a$$: speed of pump wavelength (I think?)
$$\lambda_p_A$$: pump wavelength
$$\Gamma_p_A$$: confinement factor
$$\sigma_a_s_B$$: absorption cross section at laser wavelength
h: planck's constant
c: speed of light
A: area of fiber core

This yields dimensions that are agreeable with the rate equation. But I don't know how this formula came about. could someone enlighten me? Thanks!

#### Attached Files:

• ###### rate.doc
File size:
69 KB
Views:
156
Last edited: Mar 25, 2010


text:
Are phase and particle (photon) number in QED conjugated variables?

I found in A. Zee's book "QFT in a nutshell" (1.edition) the interesting relation (8) respectively (9) in chapter III section 5 (p.173) which states that in a collective of non-relativistic bosons the (common) phase of the collective $$\theta$$ and the density of particles $$\rho$$ are conjugated variables:

$$[\rho(x',t), \theta(x,t)] = i \delta(x-x')$$

My question is: Is this relation only valid for a collective of quasi-particles respectively superfluids OR is it also valid for a collective of photons ?

At least I know that if a coherent photon state is considered, the phase is known, whereas the number of photons $$N=\int d^3x \rho(x,t)$$ has a significant uncertainty. On the other hand if a state (in Fock space) of fixed number of photons is considered, little is known of the phase of the corresponding electromagnetic field. So to which extent can the above relation be maintained ? Which conditions necessary for the validity of this relation in general ? May be it is simply not valid as photons are not non-relativistic. An illuminating explanation would be rather helpful.


text:
## Unconditionally stable difference schemes for a one-space-dimensional linear hyperbolic equation.(English)Zbl 1114.65347

Summary: A few explicit difference schemes are discussed for the numerical solution of the linear hyperbolic equation $$u_{tt} + 2\alpha u_{t} + \beta ^{2}u = u_{xx} + f(x, t), \alpha > 0, \beta > 0$$, in the region $$\Omega = \{(x, t)\mid a < x < b, t > 0\}$$ subject to appropriate initial and Dirichlet boundary conditions, where $$\alpha$$ and $$\beta$$ are real numbers. The proposed scheme is showed to be unconditionally stable, and a numerical result is presented.

### MSC:

 65M12 Stability and convergence of numerical methods for initial value and initial-boundary value problems involving PDEs 65M06 Finite difference methods for initial value and initial-boundary value problems involving PDEs 35L15 Initial value problems for second-order hyperbolic equations
Full Text:

### References:

 [1] Twizell, E.H., An explicit difference method for the wave equation with extended stability range, Bit, 19, 378-383, (1979) · Zbl 0441.65066 [2] Mohanty, R.K.; Jain, M.K.; George, K., On the use of high order difference methods for the system of one space second order non-linear hyperbolic equations with variable coefficients, I. comp. appl. math., 72, 421-431, (1996) · Zbl 0877.65066 [3] Ciment, M.; Leventhal, S.H., A note on the operator compact implicit method for the wave equation, Math. comput., 32, 143-147, (1978) · Zbl 0373.35039 [4] Mohanty, R.K.; Jam, M.K., An unconditionally stable alternating direction implicit scheme for the two space dimensional linear hyperbolic equation, Namer. meth. partial D. eq., 17, 684-688, (2001) · Zbl 0990.65101 [5] Mohanty, R.K.; Jain, M.K.; Arora, U., An unconditionally stable AD1 method for the linear hyperbolic equation in three space dimensions, Int. J. comput. math., 79, 133-142, (2002) · Zbl 0995.65093 [6] Mohanty, R.K., An unconditionally stable difference scheme for the one-space-dimensional linear hyperbolic equation, Appl. math. lett., 17, 101-105, (2004) · Zbl 1046.65076
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.