text:
# thraxil.org:

## Subprocess Hanging: PIPE is your enemy

by anders pearson Thu 13 Mar 2008 20:35:31

Every once in a while, I run across a bug or a tricky problem where googling for a solution doesn't turn up much. When I come up with a solution, I like to write it up and put it online so the next person to come across it hopefully will have an easier time figuring it out. This is one of those posts.

One of the internal applications I wrote at work does a lot of work via external programs. It's basically glueing together a whole bunch of shell scripts and putting a nice interface on them.

Running an external program from Python isn't very hard in the simple case. There's actually a wealth of options available. The entry level is to use os.system() and give it a list of arguments. That gives you the return code but doesn't give you the output of the command.

For what I'm doing, I need to have access to the return code, STDOUT, and STDERR. Requirements like that lead to the os.popen* functions. Basically, something like:

import os
(c_stdin,c_stdout,c_stderr) = os.popen3(cmd,'r')
c_stdin.close()
c_stdout.close()
c_stderr.close()

There are still problems with that. The environment that the child command runs in (variables, cwd, tty, etc) is the same environment that the parent is running in. So to set, eg, to set environment variables for the child, you have to put them into os.environ in the parent, or to set the cwd for the child command, you have to have the parent do an os.chdir(). That can be troublesome in some situations. Eg, if the parent is a CherryPy process, doing an os.chdir() makes it hopelessly lost and it will crash. So you have to fork() a child process, set up the environment there, do the above code, and then pass the results back to the parent process.

This has been enough of a pain point for Python programmers that Python 2.4 added the subprocess module. The code above can be replaced with:

from subprocess import Popen, PIPE
p = Popen(cmd,stdout=PIPE,stderr=PIPE)
(out,err) = p.communicate()

Aside from being a little shorter, subprocess.Popen() also takes additional arguments like cwd and env that let you manipulate the environment of the child process (it does the fork() for you). It basically gives you one very nice interface for doing anything and everything related to spawning external commands. Life is generally better with subprocess around.

Unfortunately, there is a subtle, devious bug in that code. I know this after encountering it and spending many hours trying to figure out what was going on.

Where I encountered it was when the command being run was doing an svn checkout. The checkout would run for a while and then the svn command would hang at some point. It wouldn't use CPU, there would be no error messages. The process would still show up in ps or top. It would just stop and the parent process would sit and wait for it to finish. Complete deadlock. Running the exact svn command on the commandline, it would run with no problems. Doing an svn checkout of a different repository would work fine. Kill the hung svn process and the parent would complete and STDOUT would show most of the expected output from the svn checkout. With the particular repository, it would always hang at exactly the same spot; completely repeatable.

How could an svn checkout of a particular repository hang, but only when run via subprocess?

After much frustrating debugging, searching, and experimentation, I narrowed it down to the output of the svn command on STDOUT. If I added a -q (quiet) flag, it would complete without hanging. I eventually noticed that the output that had been collected in STDOUT after killing the svn process was right around 65,000 characters. Since 216 is 65536, that seemed like a coincidence worth investigating. I wrote a test script that just wrote 216 characters to STDOUT and ran it via subprocess. It hung. I modified it to print 216 - 1 characters to STDOUT. No hanging. The troublesome svn repository happened to have a lot of files in it, so a lot of verbose output on the checkout.

A closer inspection of the subprocess.Popen docs revealed a warning "Note: The data read is buffered in memory, so do not use this method if the data size is large or unlimited." I'd probably read that before and assumed that it was a warning about possibly consuming a lot of memory and being inefficient if you try to pass a lot of data around. So I ignored it. The STDOUT chatter of shell scripts that I was collecting for logging purposes did not strike me as "large" (65K is positively tiny these days) and it isn't an application where I'm particularly concerned about memory consumption or efficiency.

Apparently, that warning actually means "Note: if there's any chance that the data read will be more than a couple pages, this will deadlock your code." What was happening was that the memory buffer was a fixed size. When it filled up, it simply stopped letting the child process write to it. The child would then sit and patiently wait to be able to write the rest of its output.

Luckily the solution is fairly simple. Instead of setting stdout and stderr to PIPE, they need to be given proper file (or unix pipe) objects that will accept a reasonable amount of data. (A further hint for anyone who found this page because they encountered the same problem and are looking for a fix: Popen() needs real file objects with fileno() support so StringIO-type fake file objects won't work; [tempfile.TemporaryFile] is your friend).

This strikes me as kind of a poor design. Subprocess is wonderful in most ways and a real improvement over the old alternatives. But with this kind of issue, the programmer using it will probably not encounter any problems in development and think everything is fine but some day will find their production app mysteriously deadlocked and have almost no clues as to what's causing it. That seems like something that deserves a big flashing red warning in the docs every time PIPE is mentioned.

I like the fact that you added the page because you could not find it in Google, that was nice of you to think about the next guy!

Using your solution is a really great way to solve this problem, I just hope the next person who needs and finds this info leaves a thank you on your discovery should they be heading in the same direction.

consider pexpect

http://news.ycombinator.com/item?id=146816

What about deadlocks when invoking a shell script which itself forks a child process? From the real shell, it returns right away as expected; but, from Subprocess, it deadlocks until the child process dies. Before you ask, data output does NOT exceed 64K. :)

Thanks.

It's kind of a different issue entirely, but basically, don't do that.

One of my pet peeves is command line apps or scripts that background themselves and don't have a "foreground" mode. I consider that a major unix faux pas. So if you're writing the shell script that you're calling, just don't do it. If you didn't write it, can you fix it and add a foreground mode? If, for some reason you can't fix it, you're going to be stuck with some kind of ugly workaround, probably involving pidof.

I've seen more of the command line apps that background themselves without a foreground mode cropping up lately, particularly on OS X. I suspect that it's programmers who are used to writing GUI apps and making polished "user friendly" interfaces who have been asked to put a command line frontend on their application. The command takes a long time to run and, coming from a GUI background, they think "the user shouldn't have to wait around while it works, let's do it in the background". Good instinct for a GUI app. Annoying as hell for a command line application as all it really does it make it hard to put in a script.

Thanks Anders, I hit this recently and worked around it but didn't get to the bottom.

I was just debugging this very same issue. You have saved me quite some time. Thanks!

I have run into the same issue. Thanks to your post, now I have a solution!

One way to diagnose the issue - an strace of the hung child process shows that it is waiting on a write().

Is it still an issue? I've just tested this on python 2.6.2 and Linux and found no problems. Also I've experimented with different buffer sizes (bufsize parameter for Popen).

Holy Cow Thanks!

Thank you for your informative post!

Encountered the same problem, we had a log client running that suddenly stopped without explanation. Doing strace revealed that it hanged when writing to stdout. I totally agree that the note in python documentation should warn more for this behaviour.

Brilliant, thank you! Saved me quite a lot of trouble.

This problem had me stuck for the last few months, and I'd almost given up on it. That's why it was hanging on large sound files. Thanks a lot!

I found this myself, and wasn't sure if it is a buggish behavior. It took me a few hours to notice that the problem was subprocess.PIPE couldn't handle "large" output. By the way I am using python 2.7.1 and this is still an issue!

Thank you for posting on this issue. We were experiencing the same exact problem. Setting the stdout and stderr to a file worked perfectly.

Excellent article. I also ran into this issue and solved it by making the child process less chatty. Thanks for sharing your insight!

I think the fact that the subprocess waits until you read its output before it produces more isn't a problem. The problem is calling the communicate() method, which (at least now) is documented as "do not use this method if the data size is large or unlimited". What you should do is reading from .stdout of the object returned from Popen(), without expecting the process to terminate before you read its output.

Buffering to a disk file is the same as buffering to memory, only slower and with a slightly larger size limit.

I just ran into this issue in Python 3 (so this might not apply to Python 2), but in my case the solution was to RTFM about file buffering and realize that 1) subprocesses will hang if their output buffer fills up, so you must make sure to read all of it as the subprocess runs; 2) Popen.stdout is an instance of FileIO, which means that its read() method returns at most the requested number of bytes but could also return less. You can wrap it in a BufferedReader object to get a read() method that returns all of the requested data.

I experienced a similar issue that I need to run zcat, and then head, tail or wc -l on the output, all called from within python 2.65. Apparently the output is much larger than the 65K (it is a few hundreds MB to a few GB). It has puzzled me for a while why zcat always hang until I read this wonderful post. For my case, I would like to avoid creating temp file as well since it could be very big, and I don't necessarily want to write out the entire file. I ended up wrapping the two commands with unix pipe ("|") connected into one string, than pass that into subprocess.Popen, with shell=True (which I try to avoid usually). This has been working fine for my case.

While I do not yet need this solution, I DO work with the subprocess module fairly often and surely will need it sooner or later, so thank you very much for this page. Bookmarked and Captured. :)

Thank you!!

Thank you very much for your post. This is the reason my process was getting stuck. I wasted 1 day before reading your post.

Hey, I just found your post, it's great!

This helped me to write this blogpost and some workaround code which works great for me:

http://www.synsecblog.com/2013/01/python-subprocesspipe-is-your-enemy.html

Cheers!

Checked this on Python 3.3 on W32. Doesn't apply.

Wrote a program (in C) that just writes zero bytes into stdout and stderr in a loop (1 write into each, per iteration), and takes one argument - number of bytes to write).

Wrote a Python script that runs that program via subprocess, with two pipes, and receives the output via communicate() method.

Works as intended - memory usage visibly grows, and length of the returned variables is correct. It also takes longer to run as the argument grows.

I stopped at 16 megabytes, didn't try more.

Thanks a lot for this information. I was also facing the same issue.

Like many others I ran into this problem as well. The issue seems to be in the way the Linux Kernel implements pipes, from the pipe(7) man page:

"In Linux versions before 2.6.11, the capacity of a pipe was the same as the system page size (e.g., 4096 bytes on i386). Since Linux 2.6.11, the pipe capacity is 65536 bytes."

Granted Python could come up with a version of communicate() that allows python to read from the child's stdout without waiting for the child process to complete.

I honestly just spent all night scratching my head. This was it, and it all makes sense now. Fantastic explanation, and good catch, I may never have found it :)

Thank you VERY much. You just saved my web application from a bug I've been struggling with for days!

Holy freaking shite!

We are now in 2014 and this post is still relevant!

Many thanks!

P.s. Boo Python subprocess' 65k limit !

OMG THANK YOU SO MUCH! I WANNA MAKE SWEET LOVE TOO YOU!

No, seriously, thanks so much. I was about to go berserk. I have a rather complex piece of python code at hand here (with 3 threads and several distributed calls to subprocess) and I already spent 2-3h searching for the problem, desperately trying to isolate the cause. And your blog post not only solved the issue but also prevented that to happen in the future, by explaining the mechanic.

If you ever come to Amsterdam, drop me a mail, I owe you a coffee/beer.

Dec 7, 2014... 24 more days and we are in 2015, and this post still hold. I'm using python 2.6.6, and facing same issue. Luckily for me, I've searched the issue before trying to resolved it, so this post saved ton of hours.

Thank you

You have saved me an insane amount of heartache. I don't usually comment on these blogs, but I am so thankful to you. I was experiencing exactly the same issue with a phantomjs sub-process. Thank you!

Very concise and apt info. Thank you so much. After spending endless hours debugging my code, I finally figured what was wrong. Using Python 2.7.11 and this deadlock issue still exists with Popen. :-|

Thank you very much, Mr. Pearson! I have run into the same issue. I am writing a python script using subprocess to call oracle sqlplus. Everything worked perfect in development environment. When I ran my script in prod, it’s hanging. The sqlplus will return over 1 million records from prod database and the size is over 1.5 Gb. I have spent one week debugging and I couldn’t figure out why until I read your post. Thanks for sharing your investigation on this subprocess issue, you saved me tons of time! Btw, I am using Python 2.4.3 on RH linux 2.6.

Wow now late 2016 and still a very valid post! I would have never been able to figure that out myself! So thank you sooo much for posting this! Great explanation!

Thanks for writing the best post on this topic.

My situation was to calling external program on large number of files, which chokes the pipe very quickly. I've tried:

1. stdout=subprocess.PIPE, stderr=subprocess.STDOUT
2. using a temp file object for stdout and stderr
3. shell = True or False
4. lots of variants of Popen(), check_output(), and call().

None worked!

My solution in the end was to use the default stdout and stderr of call(), namely None by Python 3.7.2.

In other words, don't bother with a full list of arguments, simply:

completed = subprocess.call(cmd, shell=True)

That's it!

formatting is with Markdown syntax. Comments are not displayed until they are approved by a moderator. Moderators will not approve unless the comment contributes value to the discussion.

name email required required remember info?


text:
# Project Euler 280 (Revisited)

A while ago I wrote this blog post on this problem. The previous code was able to produce the answer in about 20 minutes, using several gigabytes of RAM.

You may want to read the previous blog post first.

There is a simpler and more efficient solution (used by inamori, zwuupeape, and many others).

### The new approach

We do not need to know the exact value of the solution, only an approximate. This approximation has to be accurate only to six digits.

Any any step, there is a certain probability that the ant will reach the final state in that step.

Let’s call this function $P(s)$: the probability that the ant will reach the final state on step s:

At very small values of s, the probability is zero because it takes a certain number of steps to get to the final position. 44 is the smallest number of steps to get from the initial to the final position, and the probability increases from there.

But it only increases until a certain point. After that point, the probability decreases. After all, if we run this for thousands of steps, how likely is the ant to still not have reached the final position?

However, the graph continues forever to the right. Even after thousands of steps, there is still a chance, however small, that the final position hasn’t been reached.

Let’s define $Q(s)$ as the weighted average of the probabilities of each value of $P(s)$ from 0 to s:

The expected value and the answer for this problem would simply be the weighted average for the entire graph.

Since s must be an integer greater than zero, we don’t have to do any integration with curves. A bit misleading because I’ve drawn $P(s)$ and $Q(s)$ as curves, when they are not.

But because $Q(s)$ cannot be expressed algebraically, we cannot evaluate it as it approaches infinity. Instead, we pick a point that gives us enough precision:

Either that, or we keep calculating the weighted average while increasing s until we have enough precision.

### Calculating the probabilities

In order to calculate a weighted average $Q(s)$, we need to be able to calculate $P(s)$; while $P(s)$ is the probability function for the final state, we’ll need to know the probabilities for the in-between states as well.

The probabilities of the states on step s depend most upon the probabilities of the previous step, s-1.

So if on step s-1 there’s a 0.6 probability that we’re on state X, then on step s we should have a 0.3 probability of being on either Y or Z as there’s an equal chance of moving to either state.

And if multiple states can go to our state, we can get the probability by adding up the probabilities:

### Coding a solution

At first we start on the initial state, with a probability of 1 (certain chance) of being on it.

On each step we generate a new set of probabilities using rules I described above, and so on.

A lot of code is stolen from my previous work on this problem. The `State` class is essentially unchanged in this version.

Here’s the code:

```import java.util.*;

public class Main{

public static void main(String[] args){

final int ITERATIONS = 2501;

// Initialize probability map.
// The initial step is 0, containing the initial position with a probability of 1.
prevProbs.put(State.INIT_STATE, 1.0);

// Distributions for the final state.
double[] finalValues = new double[ITERATIONS+1];
Arrays.fill(finalValues, 0);

// Keep the time.
long startTime = System.currentTimeMillis();

// Loop counter is actually the step number of the next step.
for(int step=1; step<ITERATIONS; step++){

// Make new probabilities.

// Loop through old probabilities and add
Set<State> stateSet = prevProbs.keySet();

for(State state : stateSet){

// Probability of being on this state right now
double stateProb = prevProbs.get(state);

// List of next states
List<State> nextStates = nextStates(state);

// Probability factor for each of the next states
double multiplier = 1.0 / nextStates.size();

// Added value to each of the next states
double added = stateProb * multiplier;

// Now go and update all the state probabilities.
for(State nextState : nextStates){

// If we've got the final state, handle it separately.
if(nextState.equals(State.FINAL_STATE)){
continue;
}

// Could be the first time.
if(!nextProbs.containsKey(nextState))

// Might not be the first time.
else {
// Old value, we need to add to it instead of replacing it.
double previous = nextProbs.get(nextState);
}
}
}

// Our new probabilities are the old probabilities for the next loop.
prevProbs = nextProbs;

System.out.println(step + " " + weightedAverage(finalValues));
}

System.out.println((System.currentTimeMillis() - startTime) + "ms");
}

// Calculates a weighted average of a double array with the indices as
// values and the values in the array as weights.
static double weightedAverage(double[] array){

double sumValues = 0;
for(int i=0; i<array.length; i++)
sumValues += i * array[i];

return sumValues;
}

// Returns a list of possible continuation states from the current one.
static List<State> nextStates(State state){

// Current and changing position of the ant
int antX = state.ant % 5;
int antY = state.ant / 5;

// Whether it can go into each of the four directions (N,S,E,W respectively).
boolean[] possibleDirs = new boolean[4];
Arrays.fill(possibleDirs, true);

// Take out some directions if it's in the corner.
if(antY == 0) possibleDirs[0] = false; // Can't go north
if(antY == 4) possibleDirs[1] = false; // Can't go south
if(antX == 4) possibleDirs[2] = false; // Can't go east
if(antX == 0) possibleDirs[3] = false; // Can't go west

// Construct a list of continuations.
List<State> nextStates = new ArrayList<State>();

// Loop through the four directions.
for(int i=0; i<4; i++){

// Cannot go this direction.
if( !(possibleDirs[i])) continue;

int newAntX = antX;
int newAntY = antY;

// Modify direction.
switch(i){
case 0: newAntY--; break;
case 1: newAntY++; break;
case 2: newAntX++; break;
case 3: newAntX--; break;
}

// Start constructing new state object.
int oldAnt = state.ant; // old ant position
int newAnt = 5*newAntY + newAntX;
int[] board = state.board.clone();
boolean carrying = state.carrying;

// Carrying a seed. Notice that a square can contain
// two seeds at once (but not more); seeds are indistinguishable
// so we just need to keep track of the number of seeds
// on each square.
if(carrying){
board[oldAnt] --;
board[newAnt] ++;
}

// Drop off the seed.
if(newAntY == 0 && board[newAnt] == 1 && carrying)
carrying = false;

// Pick up a new seed.
if(newAntY == 4 && board[newAnt] == 1 && !carrying)
carrying = true;

// Treat the five done positions the same.
if(donePosition(board))

}

return nextStates;
}

// Is the board in the done position?
static boolean donePosition(int[] b){
return b[0]==1 && b[1]==1 && b[2]==1 && b[3]==1 && b[4]==1;
}
}

class State{

static final State INIT_STATE = new State(
new int[]{
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
1,1,1,1,1
}, 12, false);

// Consider all final states the same; there is
// no ant position.
static final State FINAL_STATE = new State(
new int[]{
1,1,1,1,1,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0,
0,0,0,0,0
}, -1, true);

// 25 board.
int[] board;

int ant;
boolean carrying;

State(int[] board, int ant, boolean carrying){
this.board = board;
this.ant = ant;
this.carrying = carrying;
}

State(State s){
this(s.board, s.ant, s.carrying);
}

public boolean equals(Object o){
State s = (State) o;
return Arrays.equals(s.board, board) && s.ant == ant && s.carrying == carrying;
}

public int hashCode(){
return Arrays.hashCode(board) + ant;
}

// For debugging mostly.
public String toString(){
StringBuilder ret = new StringBuilder("\n");
for(int i=0; i<5; i++){
for(int j=0; j<5; j++){
int pos = 5*i + j;
if(ant == pos) ret.append("#");
else ret.append(board[pos] >= 1? "+" : "-");
}
ret.append("\n");
}
return ret.toString();
}
}
```

As we run this program, the answer becomes more and more accurate. We only need 2300 or 2500 steps to get the six digits of accuracy we need.

Running the program:

This takes just over a minute to run — not bad at all.

## 3 thoughts on “Project Euler 280 (Revisited)”

1. Anon says:

After reading someone else’s solution, just how dishonored of a dog would I be to redo it and score the point on Project Euler?

I have been a fool to have looked for spoilers. I shall never forgive myself.

Thanks for the articles; good reads!

Like

2. I haven’t had enough time to fully understand your approach but I thought, if we want the max of P(s) would it not be simpler to calculate values of P(s) until P(s) > P(s+1)? and then answer = s?

cheers

Like

1. Yes; but I don’t think we’re trying to calculate the maximum of P(s), rather to approximate the integral of it from 0 to infinity.

Like

format: plain


text:
# Constant Crashes with Blender mostly from Materials [closed]

Windows 7 Pro x64 Blender 2.74 - 2.75rc2

I'm curious if anyone else has had this error with Blender?

Error: EXCEPTION_ACCESS_VIOLATION

Where is the violation coming from?

I've have been having a lot of issues with crashes since 2.73, and recently it has come down to this error alone. It usually happens when I'm selecting the material menu, creating a material, and even deleting meshes with materials.

I did reload to factory defaults, and created all new userprefs, and of course created a new startup file to go with it. Other issues I was having went away after that, but this one crashing issues still happens, and quite a lot.

Here's my startup file if anyone wants to look at it.

I've really cut down on the addons trying to track this down, but it doesn't seem to be related. There is nothing before the error, just a simple:

Error: EXCEPTION_ACCESS_VIOLATION

I'm hoping someone knows what this violation means, so that hopefully I can remedy this issue.


text:
Lemma 86.19.1. Let $X$ be a locally Noetherian formal algebraic space over a complete discrete valuation ring $A$. Then there exists a closed immersion $X' \to X$ of formal algebraic spaces such that $X'$ is flat over $A$ and such that any morphism $Y \to X$ of locally Noetherian formal algebraic spaces with $Y$ flat over $A$ factors through $X'$.

Proof. Let $\pi \in A$ be the uniformizer. Recall that an $A$-module is flat if and only if the $\pi$-power torsion is $0$.

First assume that $X$ is an affine formal algebraic space. Then $X = \text{Spf}(B)$ with $B$ an adic Noetherian $A$-algebra. In this case we set $X' = \text{Spf}(B')$ where $B' = B/\pi \text{-power torsion}$. It is clear that $X'$ is flat over $A$ and that $X' \to X$ is a closed immersion. Let $g : Y \to X$ be a morphism of locally Noetherian formal algebraic spaces with $Y$ flat over $A$. Choose a covering $\{ Y_ j \to Y\}$ as in Formal Spaces, Definition 85.7.1. Then $Y_ j = \text{Spf}(C_ j)$ with $C_ j$ flat over $A$. Hence the morphism $Y_ j \to X$, which correspond to a continuous $R$-algebra map $B \to C_ j$, factors through $X'$ as clearly $B \to C_ j$ kills the $\pi$-power torsion. Since $\{ Y_ j \to Y\}$ is a covering and since $X' \to X$ is a monomorphism, we conclude that $g$ factors through $X'$.

Let $X$ and $\{ X_ i \to X\} _{i \in I}$ be as in Formal Spaces, Definition 85.7.1. For each $i$ let $X'_ i \to X_ i$ be the flat part as constructed above. For $i, j \in I$ the projection $X'_ i \times _ X X_ j \to X'_ i$ is an étale (by assumption) morphism of schemes (by Formal Spaces, Lemma 85.5.11). Hence $X'_ i \times _ X X_ j$ is flat over $A$ as morphisms representable by algebraic spaces and étale are flat (Lemma 86.13.8). Thus the projection $X'_ i \times _ X X_ j \to X_ j$ factors through $X'_ j$ by the universal property. We conclude that

$R_{ij} = X'_ i \times _ X X_ j = X'_ i \times _ X X'_ j = X_ i \times _ X X'_ j$

because the morphisms $X'_ i \to X_ i$ are injections of sheaves. Set $U = \coprod X'_ i$, set $R = \coprod R_{ij}$, and denote $s, t : R \to U$ the two projections. As a sheaf $R = U \times _ X U$ and $s$ and $t$ are étale. Then $(t, s) : R \to U$ defines an étale equivalence relation by our observations above. Thus $X' = U/R$ is an algebraic space by Spaces, Theorem 63.10.5. By construction the diagram

$\xymatrix{ \coprod X'_ i \ar[r] \ar[d] & \coprod X_ i \ar[d] \\ X' \ar[r] & X }$

is cartesian. Since the right vertical arrow is étale surjective and the top horizontal arrow is representable and a closed immersion we conclude that $X' \to X$ is representable by Bootstrap, Lemma 78.5.2. Then we can use Spaces, Lemma 63.5.6 to conclude that $X' \to X$ is a closed immersion.

Finally, suppose that $Y \to X$ is a morphism with $Y$ a locally Noetherian formal algebraic space flat over $A$. Then each $X_ i \times _ X Y$ is étale over $Y$ and therefore flat over $A$ (see above). Then $X_ i \times _ X Y \to X_ i$ factors through $X'_ i$. Hence $Y \to X$ factors through $X'$ because $\{ X_ i \times _ X Y \to Y\}$ is an étale covering. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).


text:
# Sum of Sequence of Squares/Proof using Bernoulli Numbers

## Theorem

$\ds \forall n \in \N: \sum_{i \mathop = 1}^n i^2 = \frac {n \paren {n + 1} \paren {2 n + 1} } 6$

## Proof

 $\ds \sum_{i \mathop = 1}^n i^p$ $=$ $\ds 1^p + 2^p + \cdots + n^p$ $\ds$ $=$ $\ds \frac {n^{p + 1} } {p + 1} + \sum_{k \mathop = 1}^p \frac {B_k \, p^{\underline {k - 1} } \, n^{p - k + 1} } {k!}$

where $B_k$ are the Bernoulli numbers.

Setting $p = 2$:

 $\ds \sum_{i \mathop = 1}^n i^2$ $=$ $\ds 1^2 + 2^2 + \cdots + n^2$ $\ds$ $=$ $\ds \frac {n^{2 + 1} } {2 + 1} + \frac {B_1 \, p^{\underline 0} \, n^2} {1!} + \frac {B_2 \, p^{\underline 1} \, n^1} {2!}$ $\ds$ $=$ $\ds \frac {n^3} 3 + B_1 n^2 + B_2 n$ Definition of Falling Factorial and simplification $\ds$ $=$ $\ds \frac {n^3} 3 + \frac {n^2} 2 + \frac n 6$ Definition of Bernoulli Numbers $\ds$ $=$ $\ds \frac {n \left({n + 1}\right) \left({2 n + 1}\right)} 6$ after algebra

Hence the result.

$\blacksquare$


text:
# Log-linear model vs Multinomial-Dirichlet model for contingency table

Given a 1x3 contingency table of the form

$$[y_1,y_2,y_3]$$

where each $y_i$ represents a count on some random variable $$X\sim Multinomial(n, \pi_1,\pi_2,\pi_3)$$

We can estimate the vector of parameters $[\hat{\pi_1},\hat{\pi_2},\hat{\pi_3}]$ using a Bayesian Multinomial-Dirichlet conjugate model, and then get a sample estimate of the estimand.

$$\pi_1 - \pi_2$$

Could we also get an estimate of the difference of proportions using a glm and avoid MCMC?

Bayesian model taken from here

• Why Dirichlet when you state its a proportion of counts? Multinomial would suffice, no? – Firebug Nov 7 '17 at 18:47
• So maybe I am way over thinking this, but is the mle for $\theta_1 -\theta_2$ the mle for Multinomial($\theta_1$,$\theta_2$,$\theta_3$)? – user2879934 Nov 7 '17 at 18:48
• Basically, I don't get how contingency tables are related to GLMs? this question kind of got away from me – user2879934 Nov 7 '17 at 18:48

## 1 Answer

Yes, you can fit this model using maximum likelihood or as a maximum a-posteriori version and get some estimates. Most regression software would also directly provide you estimates for $\pi_1-\pi_2$ with confidence (or credible) intervals based on the delta method. In contrast to drawing samples from the posterior, you are assuming that a normal approximation to the sampling distribution of the estimates makes sense (possibly after some suitable transformation e.g. to the logit scale). This is not the case when there are very few events. On the other hand, this should be fine, if $x_1$, $x_2$ and $x_3$ are all large, in which case the answers will probably not differ between approaches unless you use quite informative priors in the Bayesian approach.

However, note that you do not really need to do MCMC sampling in the particular case you describe, conjugate updating gives you an analytic posterior for the joint distribution of $\pi_1$, $\pi_2$ and $\pi_3$. You can then either draw independent samples from this distribution and form the difference $\pi_1-\pi_2$ in the samples (no worries about convergence of the MCMC chains). It might even be possible to analytically derive the distribution of the difference $\pi_1-\pi_2$, but I assume that would get rather messy, but numerical integration should be entirely possible.

• I like every part of this answer, but how do GLMs fit in....why is this not a multinomial logistic regression with just an intercept (no covariates) – user2879934 Nov 7 '17 at 18:59
• I guess I was coming from the perspective that a GLM with only an intercept is still a GLM. – Björn Nov 7 '17 at 19:50
• Where is the glm in the answer ? – user2879934 Nov 7 '17 at 19:50


text:
Summer is Coming! Join the Game of Timers Competition to Win Epic Prizes. Registration is Open. Game starts Mon July 1st.

 It is currently 18 Jul 2019, 00:01

GMAT Club Daily Prep

Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

If |x|>3, which of the following must be true?

Author Message
TAGS:

Hide Tags

CEO
Joined: 12 Sep 2015
Posts: 3848
Re: If |x|>3, which of the following must be true?  [#permalink]

Show Tags

06 Feb 2018, 11:44
2
Top Contributor
2
corvinis wrote:
If |x| > 3, which of the following must be true?

I. x > 3

II. x^2 > 9

III. |x - 1| > 2

A. I only
B. II only
C. I and II only
D. II and III only
E. I, II, and III

If |x| > 3, then it must be true that EITHER x > 3 OR x < -3

(1) x > 3
This need not be true, since it's also possible that x < -3.
For example, x COULD equal -5
So, statement I need not be true.
ELIMINATE answer choice A, C and E

(2) x² > 9
This means that EITHER x > 3 OR x < -3
Perfect - this matches our original conclusion that EITHER x > 3 OR x < -3

(3) |x-1| > 2
Let's solve this further.
We get two cases:
case a) x - 1 > 2, which means x > 3 PERFECT
or
case b) x - 1 < -2, which means x < -1
Must it be true that x < -1?
YES.
We already learned that EITHER x > 3 OR x < -3
If x < -3, then we can be certain that x < -1
For example, if I tell you that the temperature is less than -3 degrees Celsius, can we be certain that the temperature is less than -1 degrees? Yes.
So, statement 3 must also be true.

Cheers,
Brent
_________________
Test confidently with gmatprepnow.com
Intern
Joined: 30 Nov 2017
Posts: 39
If |x|>3, which of the following must be true?  [#permalink]

Show Tags

20 Feb 2018, 23:32
1
Since it is give that |x| > 3, we can take two values of x: 4 and -4.

Only II and III are true.

Is this really a 700 level question?
Director
Joined: 17 Dec 2012
Posts: 630
Location: India
If |x|>3, which of the following must be true?  [#permalink]

Show Tags

07 Mar 2018, 16:47
corvinis wrote:
If |x| > 3, which of the following must be true?

I. x > 3

II. x^2 > 9

III. |x - 1| > 2

A. I only
B. II only
C. I and II only
D. II and III only
E. I, II, and III

I can't understand how the official answer can be right. For me is B. Please respond and I'll provide official explanation! Thanks

Main Idea: We need to use the normal expressions corresponding to the modulus expression given and solve for x and compare with the choices given for truth of the choices.

Details: By topic specific problem solving aid , which is :

- For converting the modulus to the normal form, one would be just remove the modulus and the other would be to remove the modulus and add a negative sign before the expression. For example |x-3| can correspond to (x-3) or –(x-3).
, we have

X >3 or x<-3

Checking the choices we see:

(i) Need not be true
(ii) must be true
(iii) implies x-1>2 => x>3 or –(x-1) >2 => x<-1. This is consistent with what is given. Hence true
Hence D.
_________________
Srinivasan Vaidyaraman
Sravna Test Prep
http://www.sravnatestprep.com

Holistic and Systematic Approach
Retired Moderator
Joined: 11 Aug 2016
Posts: 375
Re: If |x|>3, which of the following must be true?  [#permalink]

Show Tags

26 Sep 2018, 11:15
corvinis wrote:
If |x| > 3, which of the following must be true?

I. x > 3
II. x^2 > 9
III. |x - 1| > 2

A. I only
B. II only
C. I and II only
D. II and III only
E. I, II, and III

The key to correctly answering such questions is that the inequations/equations that we are evaluating, the answer range should be a Super Set of the given range.
_________________
~R.
If my post was of any help to you, You can thank me in the form of Kudos!!
Applying to ISB ? Check out the ISB Application Kit.
Director
Joined: 14 Feb 2017
Posts: 702
Location: Australia
Concentration: Technology, Strategy
GMAT 1: 560 Q41 V26
GMAT 2: 550 Q43 V23
GMAT 3: 650 Q47 V33
GPA: 2.61
WE: Management Consulting (Consulting)
Re: If |x|>3, which of the following must be true?  [#permalink]

Show Tags

03 Dec 2018, 16:25
SravnaTestPrep wrote:
corvinis wrote:
If |x| > 3, which of the following must be true?

I. x > 3

II. x^2 > 9

III. |x - 1| > 2

A. I only
B. II only
C. I and II only
D. II and III only
E. I, II, and III

I can't understand how the official answer can be right. For me is B. Please respond and I'll provide official explanation! Thanks

Main Idea: We need to use the normal expressions corresponding to the modulus expression given and solve for x and compare with the choices given for truth of the choices.

Details: By topic specific problem solving aid , which is :

- For converting the modulus to the normal form, one would be just remove the modulus and the other would be to remove the modulus and add a negative sign before the expression. For example |x-3| can correspond to (x-3) or –(x-3).
, we have

X >3 or x<-3

Checking the choices we see:

(i) Need not be true
(ii) must be true
(iii) implies x-1>2 => x>3 or –(x-1) >2 => x<-1. This is consistent with what is given. Hence true
Hence D.

Damn. I didn't apply the constraint of the stem to the questions, looking at it this way really helps. Thanks.

I blindly plugged in numbers that would satisfy |x|>3 without sticking to the constraint that$$x>3$$ and $$x<-3$$
_________________
Goal: Q49, V41

+1 Kudos if you like my post pls!
Manager
Joined: 02 Jan 2017
Posts: 60
Re: If |x|>3, which of the following must be true?  [#permalink]

Show Tags

04 Apr 2019, 03:33
GMATPrepNow wrote:
corvinis wrote:
If |x| > 3, which of the following must be true?

I. x > 3

II. x^2 > 9

III. |x - 1| > 2

A. I only
B. II only
C. I and II only
D. II and III only
E. I, II, and III

If |x| > 3, then it must be true that EITHER x > 3 OR x < -3

(1) x > 3
This need not be true, since it's also possible that x < -3.
For example, x COULD equal -5
So, statement I need not be true.
ELIMINATE answer choice A, C and E

(2) x² > 9
This means that EITHER x > 3 OR x < -3
Perfect - this matches our original conclusion that EITHER x > 3 OR x < -3

(3) |x-1| > 2
Let's solve this further.
We get two cases:
case a) x - 1 > 2, which means x > 3 PERFECT
or
case b) x - 1 < -2, which means x < -1
Must it be true that x < -1?
YES.
We already learned that EITHER x > 3 OR x < -3
If x < -3, then we can be certain that x < -1
For example, if I tell you that the temperature is less than -3 degrees Celsius, can we be certain that the temperature is less than -1 degrees? Yes.
So, statement 3 must also be true.

Cheers,
Brent

This is the most brilliant explanation
Re: If |x|>3, which of the following must be true?   [#permalink] 04 Apr 2019, 03:33

Go to page   Previous    1   2   3   [ 46 posts ]

Display posts from previous: Sort by


text:
Physics307L F09:People/Callow/EdiffractionSum

Electron Diffraction Summary

SJK 22:08, 14 November 2009 (EST)
22:08, 14 November 2009 (EST)
Very nice job on this lab. I know you're doing the Millikan for your formal (I'm stoked to read what you do with that), but it would have been fun to see if you got better answers with the new bulb for e-diffraction that we now have.

Link to lab manual used

Link to lab notebook

Purpose of the lab

The purpose of this lab is to verify the de Broglie hypothesis $\displaystyle {\lambda}=\frac{h}{p}$ by diffracting electrons through a thin sheet of graphite and comparing a calculated value of the slits created by the graphite and the accepted value of these.

Summary of data

From the calculations in my lab notebook I found the size of the slits created by graphite to be .268(5)nm and .148(1)nm. The accepted values are .213nm and .123nm. So based on my sdem for each value, my experiment doesn't agree with the accepted values (the accepted values are much further than 3 sdems away). In the lab notebook near the bottom there is a list of possible reasons for my error.

SJK 22:05, 14 November 2009 (EST)
22:05, 14 November 2009 (EST)
Good comparison to the accepted value, using statistical reasoning with your SEM. I agree, huge systematic error is evident, and I commented more on your primary notebook page.

Other than what is listed I couldn't think of any reason other than an error in my calculations somewhere, but nothing from my calculations looks like it would change the answer by only 20% if I did the units incorrectly. The sdem for each individual measurement tended to be huge though, so my data just might not be very good.

What I learned

Find formulas first instead of trusting an approximation in the manual will actually make sense with my problem. Even though not making the assumption the manual does would mean my best estimates are even worse as mentioned in my lab notebook on finding the lattice spacing, because this assumption was not true I should have used the exact values.

This is the second experiment I have done involving an electron gun and an accelerating voltage in my formulas (the other being e/m). Both had large error. In the future if dealing with similar equipment it would be nice to find a better approximate of the accelerating voltage. Because of the much higher voltage in this experiment and that my data just looks bad, I don't feel nearly as comfortable naming this the cause of all my troubles though.

There was a lot of opportunity in this lab to practice error propagation and found everything involving went much quicker than previous experiments. Hopefully that means I'm getting better at it. SJK 22:07, 14 November 2009 (EST)
22:07, 14 November 2009 (EST)
That's great! Hard work is paying off!
One final thing I'm hoping I learned from this lab is that if I have multiple tools, and one isn't working how I want it to, just switch. I would have hoped I learned this from the maple trouble in previous labs but nope. Googledocs gave me a lot of trouble when trying to plot my data. It took about an two hours before I finally just put it in matlab after finding googledocs is just not very good for plotting data. (or well, compared to matlab) SJK 22:07, 14 November 2009 (EST)
22:07, 14 November 2009 (EST)
Sorry you wasted time, but a good lesson to learn.


text:
Recognitions:
Staff Emeritus

## consistency of the speed of light

 Quote by Aether All measurements are so far consistent with both SR and Lorentz ether theory (with the possible exception of the example from 1989 that you gave), but you are implying that all measurements select SR over Lorentz ether theory.
The job of making experimental predictions should be the responsibility of the Lorentz Ether theorists.

Unfortunately, they appear to be a very diffuse group, who while they all use the same name, don't actually all believe the same thing.

If, as in one subsection of the LET group claims, there is no difference between LET and relativity, then it is not a different theory than relativity.

If, as in another subsection of the LET group claims, there is a difference between LET and relativity, it is (or should be) up to the LET theorists to pin down what experimental predictions the theory makes, so the theory can be tested.

Part of the problem is that I don't think LET actually has any qualified theorists who write refereed papers that one can point to as "the" LET theory, rather it has only a muddle of individuals who have somehow given the same name to their differing ideas.

Recognitions:
Gold Member
 Quote by ZapperZ It is not! There are two extra terms in M-S theory regarding the ratio between $$c(\theta , v)/c$$. The Lipa et al. results have put severe limits on the value of those two extra terms! To claim no one has gone looking for it is false. Zz.
"Summarizing these results we may say that the following statement is in perfect agreement with all experimental evidence: A preferred system of reference, the ether system, exists." - Mansouri & Sexl I

"All experiments can be explained either on the basis of special relativity or by an ether theory incorporating time dilation. This demonstrates again the impossiblity of an "experimentum crucis" deciding between ether theories and the special theory of relativity." - Mansouri & Sexl - II

"First-order tests cannot be used to distinguish between special relativity and ether theories, as has sometimes been stated. No such "experimentum crucis" is possible in principle, since the two classes of theories can be transformed into one another by a change in conventions about clock synchronization..." - Mansouri & Sexl - II

"According to these authors this experiment [similar to the Michelson-Morley experiment] is able to decide between the special theory of relativity and an ether theory incorporating Lorentz contraction and time dilation. As we have shown quite generally in the first and second parts of this paper such a distinction is impossible in principle." - Mansouri & Sexl III

 Quote by pervect The job of making experimental predictions should be the responsibility of the Lorentz Ether theorists. Unfortunately, they appear to be a very diffuse group, who while they all use the same name, don't actually all believe the same thing. If, as in one subsection of the LET group claims, there is no difference between LET and relativity, then it is not a different theory than relativity. If, as in another subsection of the LET group claims, there is a difference between LET and relativity, it is (or should be) up to the LET theorists to pin down what experimental predictions the theory makes, so the theory can be tested. Part of the problem is that I don't think LET actually has any qualified theorists who write refereed papers that one can point to as "the" LET theory, rather it has only a muddle of individuals who have somehow given the same name to their differing ideas.
Very well said. I agree.
 Recognitions: Gold Member I have scanned-in the three Mansouri & Sexl papers. If anyone is interested but doesn't have easy access to a library with the journal, let me know and I'll give you a web address where you can go to download the file (it is about 143MB); right click on the link, and save. It is in MS Word .doc format, and it comes from my working copy so please excuse that it has been heavilly highlighted and is somewhat marked up and wrinkled.

Mentor
Blog Entries: 28
 Quote by Aether "Summarizing these results we may say that the following statement is in perfect agreement with all experimental evidence: A preferred system of reference, the ether system, exists." - Mansouri & Sexl I "All experiments can be explained either on the basis of special relativity or by an ether theory incorporating time dilation. This demonstrates again the impossiblity of an "experimentum crucis" deciding between ether theories and the special theory of relativity." - Mansouri & Sexl - II "First-order tests cannot be used to distinguish between special relativity and ether theories, as has sometimes been stated. No such "experimentum crucis" is possible in principle, since the two classes of theories can be transformed into one another by a change in conventions about clock synchronization..." - Mansouri & Sexl - II "According to these authors this experiment [similar to the Michelson-Morley experiment] is able to decide between the special theory of relativity and an ether theory incorporating Lorentz contraction and time dilation. As we have shown quite generally in the first and second parts of this paper such a distinction is impossible in principle." - Mansouri & Sexl III
Then I suggest you or them write a rebuttal to the Lipa et al. paper in PRL, and a number of other papers that I cited. The Lipa paper has been out since 2003 and NO ONE has challenged either their interpretation or results. It takes nothing to whine about it on here. Put your name and reputation on the line and do it officially if you think there's any credibility in what you believe in.

Zz.

Recognitions:
Gold Member
 Quote by ZapperZ Then I suggest you or them write a rebuttal to the Lipa et al. paper in PRL, and a number of other papers that I cited. The Lipa paper has been out since 2003 and NO ONE has challenged either their interpretation or results. It takes nothing to whine about it on here. Put your name and reputation on the line and do it officially if you think there's any credibility in what you believe in. Zz.
Zz, as I understand this, those two terms could be exactly what is predicted by SR and that still wouldn't select out SR over LET because the two theories transform into each other by a change in conventions about clock synchronization. Please stop referencing what I "believe in", and deal with the fact that SR and LET are empirically equivalent.

Lipa et al. references M-S without complaint, but they also reference two more recent (2001 & 2002) papers from Kostelecky & Mewes (KM) that are supposed to have an even more general transformation than M-S. I'll go to the library today and get the KM papers; if they are as thorough as M-S, then I'll be happy to start using them in their place.

Recognitions:
Staff Emeritus
 Quote by Aether Zz, as I understand this, those two terms could be exactly what is predicted by SR and that still wouldn't select out SR over LET because the two theories transform into each other by a change in conventions about clock synchronization. Please stop referencing what I "believe in", and deal with the fact that SR and LET are empirically equivalent.
"LET" is a name for a theory which is unfortunately not very well defined, as far as I can tell. If you've got references that have a definitive defintion of what the theory actually is, please do post. Note that I took a quick look at the link you did post, however it displayed scanned text on my screen running up and down, making it extremly hard to read. (I use 602 Text to read .doc format files, I don't know if that makes any difference or not). So I doubt I'll be reading it unless I find a way to make it run right-left.

While it is possible that one or more of the two papers you cite make an outright error, the more probable state of affairs is that they each have different defintions of exactly what "LET" really means (what the fundamental assumptions of the theory are).

I think more care needs to be taken to make sure that the authors are *really* talking about the same theory.

If we take your defintion of LET as "a theory that is mathematically equivalent to SR", then it really isn't very clear why you find LET interesting at all. If you find it easier to understand the theory in its new formulation, great, but the general tone of your question doesn't seem to be that of an enlightened person who is trying to explain a simpler way of doing something. Rather it seems like you are experiencing doubts about something, but the only thing that I can see to doubt is the details of the formulation of LET.

Recognitions:
Gold Member
 Quote by pervect "LET" is a name for a theory which is unfortunately not very well defined, as far as I can tell. If you've got references that have a definitive defintion of what the theory actually is, please do post. Note that I took a quick look at the link you did post, however it displayed scanned text on my screen running up and down, making it extremly hard to read. (I use 602 Text to read .doc format files, I don't know if that makes any difference or not). So I doubt I'll be reading it unless I find a way to make it run right-left.
The images are scanned photos of each page of the paper, so a text editor is not going to work. Is there a better format, like pdf that would be easier for you to view?

 Quote by pervect While it is possible that one or more of the two papers you cite make an outright error, the more probable state of affairs is that they each have different defintions of exactly what "LET" really means (what the fundamental assumptions of the theory are). I think more care needs to be taken to make sure that the authors are *really* talking about the same theory. If we take your defintion of LET as "a theory that is mathematically equivalent to SR", then it really isn't very clear why you find LET interesting at all. If you find it easier to understand the theory in its new formulation, great, but the general tone of your question doesn't seem to be that of an enlightened person who is trying to explain a simpler way of doing something. Rather it seems like you are experiencing doubts about something, but the only thing that I can see to doubt is the details of the formulation of LET.
Until there is a confirmed detection of a locally preferred frame, then LET and SR are empirically equivalent; if there is ever such a detection, then LET takes charge. I would probably not care if that were the end of the story, however SR is not the end of the relativity story, not by a long shot. It is a starting point for everything else; a local approximation to reality. There are big problems on the largest scales with dark matter, dark energy, and on the smallest scales with the unification of QM, EM, and gravity, and more. That's what I'm really interested in, but applying SR can be something like trying to climb a greased flagpole (that's something that we sometimes try to do here in the US), take VSL as an example; SR forbids it by definition. It is flat wrong to claim that experiments constrain the speed of light to be forever constant; so I'm looking for the most efficient ways to argue that, and to model that.

It is not likely that there are other than a few typographical errors in M-S. This is what Kostelecky & Mewes, Phys. Rev. D, 66, 056005-4 (2002) have to say about M-S: "In this simple example, the transformation $$T^\mu_\nu$$ leaves invariant the rods and clocks, while $$\Lambda^\mu_\nu$$ leaves invariant the speed of light. Both are equally valid. In the frames related by $$T^\mu_\nu$$, observers agree on rod lengths and clock rates but disagree on the velocity of light. Moreover, the velocity of light is no longer isotropic as measured by these rods and clocks. In contrast, observers related by Lorentz transformations agree that light propagates isotropically with speed 1 but may disagree on rod lengths and clock rates. The description is a matter of coordinate choice, and one can move freely from one to the other using $$T^\mu_\nu$$, $$\Lambda^\mu_\nu$$, and their inverses."

Recognitions:
Staff Emeritus
 Quote by Aether The images are scanned photos of each page of the paper, so a text editor is not going to work. Is there a better format, like pdf that would be easier for you to view?
I think pdf would work much better.

 Until there is a confirmed detection of a locally preferred frame, then LET and SR are empirically equivalent; if there is ever such a detection, then LET takes charge. I would probably not care if that were the end of the story, however SR is not the end of the relativity story, not by a long shot. It is a starting point for everything else; a local approximation to reality. There are big problems on the largest scales with dark matter, dark energy, and on the smallest scales with the unification of QM, EM, and gravity, and more. That's what I'm really interested in, but applying SR can be something like trying to climb a greased flagpole (that's something that we sometimes try to do here in the US), take VSL as an example; SR forbids it by definition. It is flat wrong to claim that experiments constrain the speed of light to be forever constant; so I'm looking for the most efficient ways to argue that, and to model that.
Opinions vary - I find that trying to apply non-SR theories is like trying to "climb a greased flagpole". Metaphorically, anyway, I've never actually tried to do that :-)

In my opinion, if LET wants to accomplish something, it has to at least suggest some experiments which might allow one to detect some sort of preferred frame. If it is just another formulation of SR, it's probably not going to catch on, unless it is simpler to teach (but I suspect that the current formalism is much simpler). It may have a small niche for those who can't adjust their personal philosphies to deal with SR.

 It is not likely that there are other than a few typographical errors in M-S. This is what Kostelecky & Mewes, Phys. Rev. D, 66, 056005-4 (2002) have to say about M-S: "In this simple example, the transformation $$T^\mu_\nu$$ leaves invariant the rods and clocks, while $$\Lambda^\mu_\nu$$ leaves invariant the speed of light. Both are equally valid. In the frames related by $$T^\mu_\nu$$, observers agree on rod lengths and clock rates but disagree on the velocity of light. Moreover, the velocity of light is no longer isotropic as measured by these rods and clocks. In contrast, observers related by Lorentz transformations agree that light propagates isotropically with speed 1 but may disagree on rod lengths and clock rates. The description is a matter of coordinate choice, and one can move freely from one to the other using $$T^\mu_\nu$$, $$\Lambda^\mu_\nu$$, and their inverses."
Well here's my take on isotropy via a physical example, giving some examples about what is involved in making such a coordinate choice.

Let us suppose that we decide that it is perfectly OK to use an arbitrary clock synchronization to determine speeds, and that we decide to synchronize our clocks by noontime, when the sun is directly overhead. (This is a continuous version of the "time zones" used in the US).

Now, let's compare airplanes flying east-west and west-east with our new clock synchronization methods. We find that airplines flying west travel much faster than the same airpanes flying east, even after we correct for the prevailing winds (which are significant, but I want to ignore this issue).

When we measure the speed of light, we find that it actually arrives before it left with this defintion of synchronization going west - making it have a negative speed (ouch). And it (light) is very pokey going east, travelling verrry slowly.

We also find that the physical expression of momentum depends on the direction one is moving.

With our old definiton of speed, in stil air we could say that the airplanes were going 600 mph east, and 600 mph west, and when they collided, they fell straight down to the ground with no net average velocity.

WIth our new definition of speed, the speeds of identical airplanes flying in still air east-west and west-east are *not* the same. Let's make this concrete, and say that the airplines are going something like 200 mph east, and 1000 mph west in our new system of measurement.

But these airplanes still fall straight down to the ground when they collide (well, that's idealized, but their pieces don't have any net average velocity, and if we could build the airplanes strong enough so that they didn't break apart, we would observe them falling straight down).

Now if we look at two identical airplines colliding with the same velocity, using our new system of synchroniation we find that when they have the same mass and speed, they do not have the same momentum, and that airplanes moving "at the same speed" (with our NEW defijntion of speed) in opposite directions don't fall straight down when they collide.

THe point of this exercise is that clock synchronizations don't really make new physics, which is exactly what the authors you quote are saying.

[add] By this I mean that there are no different experimental predictions. Clearly, Newton's laws have a different appearance when we adopt a non-isotropic clock synchronization method. But the behavior of the actual colliding masses (airplanes in this example) is unchanged.

Furthermore, working with clocks synchronized in an anisotropic manner yields anisotropic behavior of physical bodies (like airplanes) as well as anisotropic behavior of light. The clock sychronization that makes light act isotropically is the same clock synchronization that makes airplanes and other physical bodies act isotropically (i.e. come to rest when equal masses at equal velocities coming from opposite directions have an inelastic collision).
 With all these posts no one has stated the reason that SR was needed in the first place. Also how could a forum not include posts from people who don't agree with einstein. This is truly intellectual censorship. No wonder we have had to endure 100 years of relativity, this is what all of the colleges also do, so there are no new ideas. First I'll answer my first question; Why was relativity needed at all? For that we need to go back to the Michaelson Morley experiment. All of great minds at that time, believed that the earth traveled through space, in a so called aether. This aether carried light waves at the speed of light in space. So if the earth was moving in relation to this aether, then the observed speed of light on the earth would be c + v, where c is the constant speed of light in space, and v is the speed of the observer, in this case the earth as it moves through so called aether. obser-c = c + v. Of course we know that they got a null result. No one could believe it. The greatest minds could not accept this. Lets see what this leads to, if you get a null result, what exactly is null? It is the velocity of the observer. This leads to this equation; v = constant of 0. Which means that no matter the velocity of the observer, relative to light his speed is 0. Since the observer is always a constant 0 velocity, then you need time and space to become variables. Which means you need relativity. Time and space had always been considered constant, and rightly so. I have much more to say but I'm not sure this is the right forum since it appears to be censored. mike

Recognitions:
Staff Emeritus
 Quote by Didyoueatpaintchips With all these posts no one has stated the reason that SR was needed in the first place.
You'll find lots of posts on that topic if you look, but that wasn't the question. The short answer is "The negative results of the Michelson-Morley experiments".

 Also how could a forum not include posts from people who don't agree with einstein. This is truly intellectual censorship. No wonder we have had to endure 100 years of relativity, this is what all of the colleges also do, so there are no new ideas.
Yep, we do have some forum guidelines here, which you've apparently read, though you've decided to disregard them. Please feel free to post your astounding intellectual ideas about why relativity is wrong to an unmoderated forum like, for example, usenet sci.physics.relativity, where "anything goes" and frequently does.

 First I'll answer my first question; Why was relativity needed at all? For that we need to go back to the Michaelson Morley experiment.
Oh, I see you already knew. Then why the heck did you try and hijack thre thread to ask the answer to a question that you already knew, and disregard the forum guidelines to boot?

Recognitions:
 Quote by Aether The conclusions of each of the papers can't be stretched any farther than to say that SR is empirically equivalent to Lorentz ether theory (LET). What they fail to do is to select LET over SR, but you are claiming that they somehow select SR over LET and that is not true either.
I've been looking at your doc which I turned into a readable version here:
(33 MB) Mansouri & Sexl I'll leave it here for 12 hours.

Aether,

Mansouri and Sexl make a statement that our world can be equally well
described by a transformation other then the Lorentz Transformation.
This is just as true as the statement that our world can be equally well
described by, say, for instance it's Fourier Transform. Although this is
mathematically correct, I is certainly not how we perceive our world.

We perceive non-simultaneity

Regards, Hans.
 Recognitions: Science Advisor I use images here to proof the non simultaneity of SR rather than math. I can't make it any simpler. A remarkable amount of physics can be extracted from the simple rule that the wave front is always at right angles with the physical velocity, regardless of the reference frame. The left half of the image below shows a fast particle chasing a slower particle with equal mass. The fast particle has a shorter deBroglie wavelength. The *phase* speed of the faster particle is slower (as given by $c^2/v$ ) While the *phase* speed of the slower particle is higher. At the right half we see the same scene from a reference frame moving upwards. The extra motion has a larger influence on the slower moving particle. Its relative motion changes downwards more than the faster particle. As one can see, the combination of Special Relativity and Quantum Mechanics makes sure that the wavefronts are exactly at right angles with the physical speed, exactly as one would intuitively expect. It is only Special Relativity which can rotate wavefronts, and it does so for both light and matter waves. A Galilean transformation keeps the wavefronts always directed in the same direction! The mechanism through which Special Relativity manages this is again via the non-simultaneity of time. Regards, Hans Attached Thumbnails
 Recognitions: Gold Member Science Advisor Readers of this thread might find this article: Breaking Lorentz symmetry of interest. It is from Physics World, the magazine of the Institute of Physics, the professional body for physicists in Britain. It mentions Mansouri-Sexl and puts their work into a wider context.

Recognitions:
Gold Member
 Quote by pervect I think pdf would work much better.)
Can you read Hans' version? If not, I'll post a pdf. I made a .pdf first, but it was very large so I wen't for a .doc; it wasn't any smaller though.

 Quote by pervect Opinions vary - I find that trying to apply non-SR theories is like trying to "climb a greased flagpole". Metaphorically, anyway, I've never actually tried to do that :-) In my opinion, if LET wants to accomplish something, it has to at least suggest some experiments which might allow one to detect some sort of preferred frame. If it is just another formulation of SR, it's probably not going to catch on, unless it is simpler to teach (but I suspect that the current formalism is much simpler). It may have a small niche for those who can't adjust their personal philosphies to deal with SR.
Suppose that LET turns out only to be useful as a waypoint (for some) on the philosophical journey to SR. Even so, what is the justification for tolerating false (however well intentioned) claims that the constancy of the speed of light is an empirically determined fact? Why not just state up front that partiality to SR is simply a matter of coordinate choice, and not an empirical necessity?

Mentor
Blog Entries: 28
 Quote by Didyoueatpaintchips With all these posts no one has stated the reason that SR was needed in the first place. Also how could a forum not include posts from people who don't agree with einstein. This is truly intellectual censorship. No wonder we have had to endure 100 years of relativity, this is what all of the colleges also do, so there are no new ideas.
This is utterly silly. I can show you one, two, three, etc. examples of "new ideas" that came out of "colleges". When was the last time you read PRL? Will this be sufficient to show that your statement here is FALSE?

 It is the velocity of the observer. This leads to this equation; v = constant of 0. Which means that no matter the velocity of the observer, relative to light his speed is 0. Since the observer is always a constant 0 velocity, then you need time and space to become variables.
Say what? Relative to light, the observer's speed is ZERO? Do you know what you just said? Relative to me, my computer monitor has a speed of zero. We are both moving at the same speed then. You have just said the observer is moving at the same speed as light!

And this is your argument on why we needed SR? Oy vey! And to think colleges "censor" things like this! How dare they!

Zz.

Recognitions:
Gold Member
I have a .pdf of Hans' reformatted version of the Mansouri&Sexl papers (8MB) that I can make available on request.

 Quote by DrGreg Readers of this thread might find this article: Breaking Lorentz symmetry of interest. It is from Physics World, the magazine of the Institute of Physics, the professional body for physicists in Britain. It mentions Mansouri-Sexl and puts their work into a wider context.
Great article, thanks!

 Similar discussions for: consistency of the speed of light Thread Forum Replies General Physics 25 Special & General Relativity 13 Special & General Relativity 25 Special & General Relativity 10 Special & General Relativity 0


text:
# What is the percent by mass of the solute of a solution made by dissolving 29 grams of sodium lithium chloride in water which has a density of the solution of 1.00 grams/ml, to a final volume of 202 ml solution?

Jul 21, 2018

14%

#### Explanation:

The percent by mass formula is expressed as:

%(m/m) = ("mass of solute")/("mass of solution")xx100%

From the question we have:
mass of solute = 29 g
volume of solution = 202 mL
density of solution = 1.00 g/mL

From the volume and density, we can find the mass of solution using this formula:

$\text{density" = "mass"/"volume}$

Rearranging the formula to find mass:

$\text{mass of solution" = "density" xx "volume" = 1.00 " g/mL" xx 202 " mL" = 202 " g}$

Plugging in the values into percent by mass formula:

%(m/m) = ("mass of solute")/("mass of solution")xx100% = (29 " g")/(202 " g")xx100%=14 %


text:
# Linear algebra projection

Linear regression is commonly used to fit a line to a collection of data. The method of least squares can be viewed as finding the projection of a vector. Introduction to Linear Algebra. 4th ed. Wellesley, MA: Wellesley-Cambridge Press, February 2009 that's the projection, P, of b onto the line, where's orthogonality. Could you clarify the connection between your projection matrix and the definition of "linear projection" in the link provided in the question. MATH 304 Linear Algebra Lecture 26: Orthogonal projection. Least squares problems. Orthogonality Deﬁnition 1 Then the orthogonal projection of x onto Π is p and. Linear algebra is the branch of mathematics concerning vector spaces and linear mappings between such spaces. It includes the study of lines, planes, and. Projection (linear algebra) - definition of Projection (linear algebra) by The Free Dictionary.

Projection matrix linear algebra pdf Institute of Space Science, National Central University. Chung-Li.linear algebra. Wed like to write this projection in terms of a. Introduction to projections | Matrix transformations. Another example of a projection matrix | Linear Algebra | Khan Academy - Duration: 21:36. Linear Algebra Keith E. Emmert Outline Inner Product Spaces Orthogonal Projection Gram-Schmidt Least Squares Inner Product Spaces Orthogonal Projection. Linear Algebra; Projection onto a Subspace; All Subjects. Vector Algebra. then the projection of v onto S is the sum of the projections of v onto the individual. Linear Algebra (Khan Academy). Lecture 112 - Linear Alg; Projection Is Closest Vector In Subspace. Lecture 113 - Linear Algebra; Least Squares Approximation. Linear Algebra orthogonal basis and orthogonal projection. and many parts of linear algebra from my. orthogonal basis and orthogonal projection. Mean Temperature on a Steel Plate, The Projection Matrix lecture notes, linear functions, linear algebra review, orthonormal vectors and QR factorization.

## Linear algebra projection

Solutions Final Examination Linear Algebra 1a. Find the projection of -1 2 6 onto the span of the orthogonal vectors 3-1 2 and 1-1-2. SOLUTION. Since the vectors are. Vector Projection Calculator calculates the scalar projection as well as vector projection of one vector on another. I am currently studying linear transformations in order to refresh my Linear Algebra knowledge ^2$, the matrix of a projection can never be invertible. Example of a transformation matrix for a projection onto a subspace. Example of a transformation matrix for a projection onto a subspace Watch the next lesson: https://www.khanacademy.org/math/linear-algebra. Linear Algebra: Graduate Level Problems and Solutions Igor Yanovsky 1. Linear Algebra Igor Yanovsky a projection of V is a linear operator E on V. Several of the linear algebra routines listed above are able to compute results for several matrices at once, if they are stacked into the same array. Projection Matrices and Least Squares Linear Algebra. MIT Course The Geometry of Linear Equations. §A.2 VECTORS §A.1. Motivation Matrix notation was invented1 primarily to express linear algebra relations in compact form. Com-pactness enhances visualization and. Linear algebra projections? Sorta 2 questions in1. I figured out part 1, but i'll. Linear Algebra Projection, Reflection Question? Answer Questions. Linear Algebra Problems Math 504 – 505 Jerry L. Kazdan Note: A number of new problems were added in September 2016. However, to make this collection more. Linear algebra Matrix transformations Expressing a projection on to a line as a matrix vector prod Introduction to projections. • The Fundamental Theorem of Linear Algebra. The following theorem The vector w is called the orthogonal projection of v onto W, or the best approximation to v from W. • A natural question is: what is the relationship between the projection operation defined above, and the operation of orthogonal projection onto a line. • In linear algebra and functional analysis, a projection is a linear transformation P from a vector space to itself such that P 2 = P. That is, whenever P is applied. • 4 2. REVIEW OF LINEAR ALGEBRA SOME COMMENTS Whenmatrices aretherightsize, wecanaddandsubtractthem. As long as matrices have the same size, this works. • The projection onto the space$S$is a linear. Because projections are a type of linear. A lot of misconceptions students have about linear algebra stem from. Understanding vector projection. up vote 3 down vote favorite Browse other questions tagged linear-algebra analytic-geometry or ask your own question. asked. Please give me a directions how to solve this: find an orthogonal projection of a point T$(-4,5)$onto a line$\frac{x}{3}+\frac{y}{-5}=1. Linear Algebra (Projection) Jul 18, 2009 #1. DanielFaraday. I apologize for. Linear Algebra Plane Projection (Replies: 15) Projections in Linear Algebra. Linear algebra tutorial with online interactive programs. Menu. Home. We can find vector projection of a vector onto other vector based on the inner product of. MATH 304 Linear Algebra Lecture 24: Orthogonal complement. Orthogonal projection. Euclidean structure. The required point is the projection p of v = (3,4) on the. Linear Transformation. A linear transformation between two vector spaces and is a map such that the following hold: 1. for any vectors and in , and. Linear algebra implies two-dimensional reasoning, however Matrices used to define linear transformations. Functions and linear transformations.


text:
# Constaint to a rolling object

1. Jan 4, 2009

### KFC

1. The problem statement, all variables and given/known data
A cylinder, radius R, mass M and moment of inertia I, is rolling on a horizontal surface without slipping and a constant force F is exerted on the center of the cylinder horizontally to the right. Try to find the friction by solving the Lagrangian equation.

2. The attempt at a solution
Since the object is rolling without slip, there must be a friction force exerted at the contact point to the left.

When we go to the Lagrangian mechanics, let's call the center of the cylinder (x, y) and the angle made by a specific point on the edge of the cylinder to the vertical line passing through center $$\theta$$. Since the object is moving on the horizontal level, no potential. The constraint for no-slipping action is

$$f = R\theta - x =0$$

The Lagrangian is

$$L = \frac{M}{2}\dot{x}^2 + \frac{I}{2}\dot{\theta}^2$$

The Lagrangian equation is

$$\frac{d}{dt}\frac{\partial L}{\partial\dot{x}} = \lambda \frac{\partial f}{\partial x} = -\lambda$$

and

$$\frac{d}{dt}\frac{\partial L}{\partial\dot{\theta}} = \lambda \frac{\partial f}{\partial \theta} = R\lambda$$

where $$\lambda$$ is the Lagrange undetermined multiplier. From these equations, I get $$\lambda=F$$, but how do I relate undetermined multiplier to friction?

If we start from newton's law, it is very easy to solve for the friction, which is obvious written in terms of F. But from my solution above, seems cannot get the same form. What's going on with my solution?