text:
# Let $u$ be a harmonic function in $\mathbb{R}^n$ with $\int_\mathbb{R} |u|^p < \infty$. Then $u \equiv 0$.

This post Let $u$ harmonic. Then $\int_{\mathbb R^d}|u|^2<\infty \implies u=0$ answers this question in the case when $$p=2$$ using the Cauchy-Schwarz Inequality and an application of the Mean-Value Property. Since Cauchy-Schwarz only works for $$p=2$$, I was wondering if there is a generalization for $$p \geq 2$$. I tried it using Holder's Inequality, but I was not able to make that work.

• Holder would seem to give it directly for $1 < p < \infty.$ Where did you have a problem applying Holder to it? – Brian Moehring Nov 15 at 1:05
• Here is my specific problem: When I try to apply Holder, I can't seem to get $|u|^p$ inside the integral by itself, so I can't apply the assumption $\int_{\mathbb{R}^n}|u|^p < \infty$. Since $||u||_1 \leq ||u||_p||u||_q$ by Holder, I always get two integrals --- $(\int_{\mathbb{R}^n} |u|^p)^{1/p}$ and $(\int_{\mathbb{R}^n} |u|^q)^{1/q}$ --- and I don't know how to work with the integral involving the conjugate exponent $q$. – phantom_dino Nov 15 at 1:21
• The statement of Holder should be $\|fg\|_1 \leq \|f\|_p \|g\|_q.$ If you understand what was done in the Cauchy-Schwarz inequality in the post you linked, they set $$f = u, \qquad g = \mathbf{1}_{B(x,r)}$$ Do the same thing with Holder. – Brian Moehring Nov 15 at 1:26
• Okay, I forgot to normalize $g=1_{B(x,r)}$, so $\frac{1}{|B(r,x)|^{1/q}}||1_{B(x,r)}||^{1/q}=1$ and the answer falls right out. Thanks for the help! – phantom_dino Nov 15 at 1:35

Hint: Apply Hölder for $$u$$ and $$1$$ over $$B(x,r)$$.


text:
# scan -- apply a function to each element in a list or sequence

## Synopsis

• Usage:
scan(L, f)
scan(L, L', f)
scan(n, f)
• Inputs:

## Description

scan(L, f) applies the function f to each element of the list L. The function values are discarded.

 i1 : scan({a, 4, "George", 2^100}, print) a 4 George 1267650600228229401496703205376 i2 : scan("foo", print) f o o

scan(n, f) applies the function f to each element of the list 0, 1, ..., n-1

 i3 : scan(4, print) 0 1 2 3 i4 : v = {a,b,c}; scan(#v, i -> print(i,v#i)) (0, a) (1, b) (2, c)

The keyword break can be used to terminate the scan prematurely, and optionally to specify a return value for the expression. Here we use it to locate the first even number in a list.

 i6 : scan({3,5,7,11,44,55,77}, i -> if even i then break i) o6 = 44

• apply -- apply a function to each element
• accumulate -- apply a binary operator repeatedly
• fold -- apply a binary operator repeatedly
• lists and sequences -- a detailed overview of lists and sequences in Macaulay2

## Ways to use scan :

• "scan(BasicList,BasicList,Function)"
• "scan(BasicList,Function)"
• "scan(String,Function)"
• "scan(ZZ,Function)"

## For the programmer

The object scan is .

format: plain


text:
PHPKonf 2020 Online

# system

(PHP 4, PHP 5, PHP 7)

systemExecute an external program and display the output

### Description

system ( string $command [, int &$return_var ] ) : string

system() is just like the C version of the function in that it executes the given command and outputs the result.

The system() call also tries to automatically flush the web server's output buffer after each line of output if PHP is running as a server module.

If you need to execute a command and have all the data from the command passed directly back without any interference, use the passthru() function.

### Parameters

command

The command that will be executed.

return_var

If the return_var argument is present, then the return status of the executed command will be written to this variable.

### Return Values

Returns the last line of the command output on success, and FALSE on failure.

### Examples

Example #1 system() example

 <?phpecho '
';// Outputs all the result of shellcommand "ls", and returns// the last output line into $last_line. Stores the return value// of the shell command in$retval.$last_line = system('ls',$retval);// Printing additional infoecho '

Last line of the output: ' . $last_line . '
Return value: ' .$retval;?>

### Notes

Warning

When allowing user-supplied data to be passed to this function, use escapeshellarg() or escapeshellcmd() to ensure that users cannot trick the system into executing arbitrary commands.

Note:

If a program is started with this function, in order for it to continue running in the background, the output of the program must be redirected to a file or another output stream. Failing to do so will cause PHP to hang until the execution of the program ends.

### User Contributed Notes 19 notes

60
no at mail dot com
8 years ago
 This is for WINDOWS users. I am running apache and I have been trying for hours now to capture the output of a command. I'd tried everything that is written here and then continued searching online with no luck at all. The output of the command was never captured. All I got was an empty array.Finally, I found a comment in a blog by a certain amazing guy that solved my problems. Adding the string ' 2>&1' to the command name finally returned the output!! This works in exec() as well as system() in PHP since it uses stream redirection to redirect the output to the correct place!system("yourCommandName 2>&1",$output) ;  vlad dot sharanhovich at gmail dot com 12 years ago  The double quote problem on Windows platform discussed earlier here in comments still present in PHP 5.2.5. You can't execute system($command) if $command contains more than 2 " chars. system('"echo" A'); works, while system('"echo" "A"'); does not. Search comment, that was a solution posted to overhaul this issue via temporary .bat file.  morris_hirsch at hotmail dot com 17 years ago  another reason to use shell_exec instead of system is when the result is multiple lines such as grep or ls <?php// this correctly sets answer string to all lines found//$answer = shell_exec ("grep 'set of color names' *.php ");//echo "answer = $answer";// this passes all lines to output (they show on page)// and sets answer string to the final line$sys = system ("grep 'set of color names' *.php "); echo "sys =(($sys))";?>here is view/source resulting from system callsetprefs.php:// The standard set of color names is:setprefs.php:// Most browsers accept a wider set of color namessilly.php: //$answer = shell_exec ("grep 'set of color names' *.php ");silly.php: $sys = system ("grep 'set of color names' *.php ");sys =((silly.php:$sys = system ("grep 'set of color names' *.php ");))and here is view source from using shell_exec insteadanswer = setprefs.php:// The standard set of color names is:setprefs.php:// Most browsers accept a wider set of color namessilly.php:  $answer = shell_exec ("grep 'set of color names' *.php ");silly.php://$sys = system ("grep 'set of color names' *.php ");
ccurtis at aet-usa dot com
21 years ago
 If no headers have been printed, calling the system() function will flush the headers to the client and insert a newline; no further headers or cookies will be transferred to the browser.  In version 3.0.7, you will not be warned that the Header() function failed, but will be warned if trying to set a cookie.  If you want to continue to send headers after the function call, use exec() instead.
mortoray at ecircle-ag dot com
16 years ago
 Do not use "system" if you use the "php.ini" option:    zlib.output_compression = OnDoing so will result in the browser receiving garbage (I'm guessing the headers/buffers get confused).Use passthru in this case, it appears to work as intended.
kexianin at diyism dot com
11 years ago
 If you can't see any output or error from system(), shell_exec() etc, you could try this: <?php function my_exec($cmd,$input='')          {$proc=proc_open($cmd, array(0=>array('pipe', 'r'), 1=>array('pipe', 'w'), 2=>array('pipe', 'w')), $pipes); fwrite($pipes[0], $input);fclose($pipes[0]);           $stdout=stream_get_contents($pipes[1]);fclose($pipes[1]);$stderr=stream_get_contents($pipes[2]);fclose($pipes[2]);           $rtn=proc_close($proc);           return array('stdout'=>$stdout, 'stderr'=>$stderr,                        'return'=>$rtn ); } var_export(my_exec('echo -e$(</dev/stdin) | wc -l', 'h\\nel\\nlo')); ?> For example, "echo shell_exec('ls');" will get nothing output, "my_exec('ls');" will get "sh: ls: command not found", "my_exec('/bin/ls');" will maybe get "sh: /bin/ls: Permission denied", and the permission may be caused by selinux.
Daniel Morris (danielxmorris.com)
12 years ago
 How to produce a system beep with PHP.<?php        function beep ($int_beeps = 1) { for ($i = 0; $i <$int_beeps; $i++):$string_beeps .= "\x07"; endfor;            isset ($_SERVER['SERVER_PROTOCOL']) ? false : print$string_beeps;         }?>This will not do anything when running through a browser, if running through a shell it will produce an audible beep $int_beeps times. This should work on Windows, Unix, etc.  eric_REMOVE at movementmovement_REMOVE dot com 16 years ago  It's important to note that if you are running a series of system() commands in a loop, you need to include the second argument in order for them to run synchonously.ie)// this will execute process.php asynchronously; not waiting for completion before executing the next one.$array = array('apple', 'banana', 'pear');foreach($array as$i){system("php process.php \"fruit=$i\"");}// this will execute process.php 3 times, waiting for the prior command to complete before starting a new one$array = array('apple', 'banana', 'pear');foreach($array as$i){system("php process.php \"fruit=$i\"",$status);}
dan at thecsl dot org
14 years ago
 You probably want to check your system calls for errors. The convention is to return 0  for "no error" which is the same as FALSE which can be confusing. You need to do something like:<?php  $cmd = "/usr/bin/pngtopnm$png_file > $pnm_file"; system($cmd,$return_value); ($return_value == 0) or die("returned an error: $cmd");?>  Anonoymous 1 year ago  Windows commands requiring a GUI.Alot of the info on this topic is from the 2010-2012 time frame and referring to XP, and basically don't work. I am using apache/php/mysql in windows 7.When requiring a system command in windows with a GUI - such as a labview executable, notepad, etc..., others have mentioned the psexec command from sysinternals, since cmd /c wont work, but the specific use was not real clearly defined. Here is what worked for me on windows 7: system('C:/nttools/2019/psexec \\\\10.100.100.101 -i -u administrator -p password -accepteula -nobanner C:\\htdocs\\test\\test.bat');The path to the psexec executable is with forward slashes, the remote PC network location (which was actually the local PC, not remote) was \\ip_address with an extra backslash for each backslash so that required the 4 \'s.The path for the command to be executed by psexec required backslashes, which also requires double backslashes.The -i option is for an interactive program, and is required for it to properly run, otherwise it show up in the taskmanager but not be visable or execute properly if given command line arguments.The -accepteula -nobanner is to suppress the sysinternals message box about their license.My command to execute is really long with multiple command line inputs with many surrounded in double quotes, so I thought it would be easiest to put that in a batch file and just call the bat file. Works great, remote users loading the webpage causes the executable to pop up on the web server, do its analysis and disappear. Labview can read native excel files with active-x functions and write to a mysql data base to store results etc, so thats a pretty powerful combination of functions.  d dot kraft at szo dot de 17 years ago  For PHP running inside a Webserver:When calling a process viasystem("your_process &");to make it running in background, note that this process is killed when the webserver is restarted.  timgolding_10 at hotmail dot com 13 years ago  An example of using the system to call the file command on a linux server. This script detects whether a user posted file is a jpeg, gif or png<?PHP$accepted_types=array("JPEG" , "GIF", "PNG");     // The temporary filename of the file in which the uploaded file was stored on the server. if(!empty($_FILES["uploadedfile"])) {$uploaddir = $_SERVER['DOCUMENT_ROOT']."/images/";$uploaddir.=basename( $_FILES['uploadedfile']['name']); //verfiy file using linux FILE command$last_line = system('file '.escapeshellarg($_FILES['uploadedfile']['tmp_name']),$retval); //get the file extension returned through magic database $splitvals=explode(' image data' ,$last_line); $vals=explode(':',$splitvals[0]); $vals[1]=str_replace(' ','',$vals[1]); if (in_array($vals[1],$accepted_types)) {    echo $vals[1].' was accepted
'; if(!file_exists($uploaddir)){            //Copy the file to some permanent location            if(move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploaddir))             {              echo $uploaddir." was uploaded!
"; } else { echo "There was a problem when uploding the new file, please contact admin about this."; } } else echo 'This file already exists in DB please rename file before uploading';}}else echo$_FILES['uploadedfile']['error'].'
';?>
vdweij at hotmail dot com
15 years ago
 It is possible to only capture the error stream (STERR). Here it goes...(some_command par1 par2 > /dev/null) 3>&1 1>&2 2>&3-First STDOUT is redirected to /dev/null.-By using parenthesis it is possible to gain control over STERR and STOUT again.-Then switch STERR with STOUT. The switch is using the standard variable switch method -- 3 variables (buckets) are required to swap 2 variables with each other. (you have 2 variables and you need to switch the contents - you must bring in a 3rd temporary variable to hold the contents of one value so you can properly swap them).This link gave me this information:http://www.cpqlinux.com/redirect.html
Jim Belton
17 years ago
 To run a full screen program from a PHP CLI script, redirect input from and output to /dev/tty.  For example:system("timeconfig > /dev/tty < /dev/tty");System will wait for the program to finish before continuing.
cnoelker at softpearls dot de
17 years ago
 Hi,some tips for using a system()-call for batch files on a windows computer:* Write the path to the executable with double back-slashes, like so:   C:\\path\\to\\prog.exe* If you are refering to other pathes, e.g. as a parameter, one back-slash works fine.* Do not use SET for declaring parameters - this does not work! Example:   SET PATH="C:\path\to\lib"   echo path is %PATH%This works fine when started from the comand line, but when called from PHP, the variable is just empty.
nospam at php dot net
20 years ago
 If you are trying to parse a CGI script to your webserver which needs arguments, take a look to the virtual() function .. it took me long before i found out it existed... It's used like this: <?php virtual("/cgi-bin/lastuser.cgi?argument"); ?> And that works excellent now for me
-1
grytolle at gmail dot com
11 years ago
 This is a work-around that makes the program run in it's own directory instead of the script's. example usage: <?php runAsynchronously("c:\games\jazz2\jazz2.exe","-connect 1.2.3.4"); ?> <?php function runAsynchronously($path,$arguments) {     $WshShell = new COM("WScript.Shell");$oShellLink = $WshShell->CreateShortcut("temp.lnk");$oShellLink->TargetPath = $path;$oShellLink->Arguments = $arguments;$oShellLink->WorkingDirectory = dirname($path);$oShellLink->WindowStyle = 1;     $oShellLink->Save();$oExec = $WshShell->Run("temp.lnk", 7, false); unset($WshShell,$oShellLink,$oExec);     unlink("temp.lnk"); } ?>
-1
lc at _REMOVE__THIS_lc dot yi dot org
17 years ago
 Re: cpmorris at hotmail dot com and WINNT.I just spent some time learning to use the php system function.  I managed to get long file names to work for me.  It seems you need to take the same approach that batch files, WSH, and most other programming languages do under WinNT/2K/XP.  Putting double quotes around the Path+Filename seems to work.  So, something like this should have worked for you:"c:\program files\apache group\apache2\bin\htpasswd"Note that if you have parameters, they go OUTSIDE of the last quote.  Oh, and don't forget to escape the slashes and quotes!  I don't know what htpasswd's params are, but let us pretend:$cmd="\"c:\\program files\\apache group\\apache2\\bin\\htpasswd\" username password";$str=system(\$cmd);Hope this helps someone!Leonardhttp:\\www.lc.yi.org
-4
Alastair Irvine
2 years ago
 Note that system() returns FALSE on failure, but this does NOT happen when the command returned a non-zero exit code.  system() won't even fail if the command isn't found.  (bash returns exit code 127 in this case.)  I assume system() only returns FALSE when something seriously bad happens, like not being able to run your shell.


text:
# Find all solutions of equation $x^2 \equiv 2$ in $\mathbb Z/7\mathbb Z$

Find all solutions of equation $x^2 \equiv 2$ in $\Bbb Z_{7}$

I'm not sure how to do this generally so I just powered through the first $10$-$15$ possible values for $[2]$ in $\mod 7$ and I found that the only possible values are $x=3$ and $x=4$.

$3^2=9$ which is $2 \mod 7$

$4^2=16$ which is $2 \mod 7$

all the other possible numbers that I went through are not perfect squares so they couldn't be $x$.

So how would I go about doing this without guessing a testing?

• 10 - 15 possible values ? There are only 7 possible values of x, try them and find 3 and 4 – Tom Collinge Feb 23 '14 at 15:16
• There are only $7$ numbers to test ($5$ is you don't count the trivial $0$ and $1$). Also, you really calculate two of them at a time when you calculate because of $(-x)^2 = x^2$. So you only need to do three calculations and some thinking (see @Hagen's answer below) – Arthur Feb 23 '14 at 15:17
• Would it be easier for you to solve $x^2\equiv9\pmod7$? – Mike Feb 23 '14 at 15:19
• To make life easier for yourself, when working modulo $2n+1$, the possible remainders are $0,\pm1,\ldots,\pm n$. – Lucian Feb 23 '14 at 15:26

Notice that $2=3^2$ and then $$x^2=3^2\iff (x-3)(x+3)=0$$ and since $\Bbb Z_7$ is a field ($7$ is prime) then $x=\pm 3$.

Instead of probing different represantatives of $[2]$ until you fall asleep, just compute $x^2$ for $0\le x<7$ and check if the result is $\equiv 2\pmod 7$. (More smartly: try $-3\le x\le 3$)

Strangely. When I decided equation:

$$x^2=7y+2$$

When I decided equation:

$$x=7k+4$$

$$y=7k^2+8k+2$$

$$...$$

$$x=7k-3$$

$$y=7k^2-6k+1$$

$$...$$

$$x=14k+4$$

$$y=28k^2+16k+2$$

$$...$$

$$x=14k-3$$

$$y=28k^2-12k+1$$

$k$ - any integer. It's not by the module to be considered and the equation to solve.


text:
--- Title: How to Store a Permutation Compactly breaks: false --- $$\def\Fp{\mathbb{F}_p} \def\deq{\mathrel{\mathop:}=} \def\range#1{[{#1}]} \def\alg#1{\textsf{#1}} \def\rank{\textsf{rank}} \def\msb{\textsf{msb}} \def\bit{\textsf{bit}} \def\mib#1{\color{blue}{\mathbf{{#1}}}} \def\mir#1{\color{red}{\mathbf{{#1}}}}$$ # How to Store a Permutation Compactly ### Bram Cohen and Dan Boneh --- In this note we describe a compact way to store a permutation, while supporting a fast way to evaluate and invert the permutation. This question comes up naturally when optimizing the software underlying the [Chia proof-of-space](https://docs.chia.net/docs/03consensus/proof-of-space) blockchain. [Chia](https://chia.net) replaces Nakamoto's energy hungry proof-of-work consensus with an eco-friendly [proof-of-space](https://en.wikipedia.org/wiki/Proof_of_space). We end the note with an open problem that we don't know how to solve. ## How to store a permutation compactly A permutation on the set $\range{n} \deq \{0,1,2,\ldots,n-1\}$ is a one-to-one function from $\range{n}$ to $\range{n}$. The group of all $n!$ permutations on $\range{n}$ is denoted by $S_n$. Here is an example permutation in $S_{16}$ that maps $0 \to 9,\ \ 1 \to 14,\ \ 2 \to 12,\ \ 3 \to 2$, etc.: $$$$\pi_1 \deq \left(\begin{array}{*{16}c} 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ 9 & 14 & 12 & 2 & 7 & 10 & 13 & 3 & 1 & 15 & 0 & 6 & 4 & 11 & 5 & 8 \end{array} \right)$$ \tag{1}\label{eq:exmpl}$$ We say that $D$ is a data structure for storing a permutation if $D$ supports the following interface: *  $\alg{process}(\pi) \to d_\pi\,$: process the given permutation $\pi \in S_n$ and output its compact representation $d_\pi$, *  $\alg{eval}(d_\pi,x) \to y\,$: on input $d_\pi$ and $x \in \range{n}$, output $y = \pi(x)$. We require that $\alg{eval}(\cdot,\cdot)$ be fast, meaning that its running should be at most $O(\log n)$. Algorithm $\alg{process}(\cdot)$ can run in time polynomial in $n$. Our goal is to design a data structure for storing a permutation where the worst case size of $d_\pi$, measured in bits, is as small as possible. By worst case we mean worst case over all $\pi \in S_n$. For extra bonus points we also want the data structure to support fast inversion: *  $\alg{invert}(d_\pi, y) \to x\,$: on input $d_\pi$ and $y \in \range{n}$, output $x = \pi^{-1}(y)$. This algorithm should similarly run in time at most $O(\log n)$. ## The trivial solution Suppose $n$ is a power of 2. The trivial data structure for storing a permutation $\pi \in S_n$ simply lists the elements of the permutation in order. That is, * $\alg{process}(\pi)$ outputs $d_\pi \deq \bigl[\pi(0),\ \pi(1),\ \ldots,\ \pi(n-1)\bigr]$, and * $\alg{eval}(d_\pi, x)$ outputs $d_\pi[x]$ for $x \in \range{n}$. For example, for the permutation $\pi_1$ in $\eqref{eq:exmpl}$ above we have $$d_{\pi_1} \deq [1010\; 1100\; 1101\; 1001\; 0111\; 0010\; 1110\; 0011\; 1011\; 1111\; 0000\; 0110\; 0100\; 0001\; 0101\; 1000].$$ This trivial data structure has the following properties: * the length of $d_\pi$ is always $n \log_2 n$ bits, and * $\alg{eval}(\cdot,\cdot)$ runs in constant time. This looks quite good. So, are we done? Well, not quite. Since the number of permutation in $S_n$ is $n!$, the number of bits needed to represent a permutation in the worst case is at least $${\cal P}(n) \deq \lceil \log_2(n!) \rceil.$$ By [Stirling's approximation](https://en.wikipedia.org/wiki/Stirling%27s_approximation), and the fact that $\log_2 e$ is about $1.443$, we know that $${\cal P}(n) = \lceil \log_{2}(n!)\rceil = n\log_{2} n - n \log_{2} e + \Theta(\log _{2}n) \approx n\log_{2} n - \fbox{1.443\, n}.$$ This means that we should be able to reduce the space needed to store a premutation by about 1.443 bits per entry over the trivial data structure. **The optimally compressed representation.** One can represent a permutation $\pi$ in $S_n$ as an integer $d_\pi$ in $\{1, \ldots, n!\}$, and this will take at most ${\cal P}(n)$ bits. While this is more compact than the trivial data structure, we lose the ability to quickly evaluate and invert the permutation. So, to summarize:
 The challenge is to construct a data structure for storing a permutation that takes less space than the trivial data stucture, specifically 1.44 n fewer bits, while retaining the ability to quickly evaluate the permutation.
 ## Who cares? Is saving 1.44 bits per entry worth discussing? Yes! There is an immediate application. In a Proof-of-Space based blockchain the monetary rewards for those providing proofs is proportional to the amount of space they have. Therefore, compressing the files used to create a Proof-of-Space will lead to increased rewards without the need to buy additional storage. It is a good day when a clever algorithm can increase revenues without increasing cost. The [Chia Proof-of-Space](https://docs.chia.net/docs/03consensus/proof-of-space) uses a domain of size $n = 2^{32}$. A reduction of $1.44 n$ bits in storage results in a $1.44 n / (n \log_2 n) = 1.44/32 \approx 4.5\%$ increase in rewards, at no additional cost. However, due to the specifics of the Chia Proof-of-Space, one needs to compress a slightly more complicated object than a permutation. Adapting the compression technique presented here to Chia can, in principle, increase revenues by about 0.48\% in the limit. ## A compact data structure for storing a permutation Now back to our question. From here on we will assume that $n$ is a power of two, so that $n = 2^k$ for some positive integer $k$. Recall that we define ${\cal P}(n) \deq \lceil \log_2(n!) \rceil$. Our starting point is the classic [Beneš network](https://en.wikipedia.org/wiki/Clos_network#Bene%C5%A1_network_(m_=_n_=_2)) (1965). A Beneš network with $2$ inputs is a simple switch that has two inputs and two outputs. The switch has two settings: in its "zero" setting the outputs are the same as the inputs; in its "one" setting the outputs are swapped. This is illustrated in the following figure:
 A Beneš network with $n = 2^k$ inputs is defined recursively using the following figure:  It is a simple exercise to show that for every permutation $\pi$ in $S_n$ there is a setting of the switches in the Beneš network that implements the permutation $\pi$. For example, for $n=16$, here are the switch settings for the permutation $\pi_1$ from $\eqref{eq:exmpl}$. The dotted path shows how the input `4' is mapped to the output '7'. The purpose of the green switches will become clear in a minute.  Once all the switches are set, evaluating $\pi(x)$ for an input $x \in \range{n}$ takes $(2 \log_2 n)-1$ steps. For a given input $x \in \range{n}$, we follow the path from $x$ to an output by traversing one switch at a time. This path contains exactly $(2 \log_2 n) - 1$ switches. Inverting the permutation is similarly done in $(2 \log_2 n)-1$ steps by processing the switches in the reverse order. How much space do we need to store all the switch settings? The number of switches in an $n$-input Beneš network is exactly $$\text{# of switches} = n \log_2 n - \frac{n}{2}.$$ This lets us represent any permutation in $S_n$ using that many bits, which is a savings of 0.5 bits per entry over the trivial solution. A good start, but we want to do better. [Waksman](https://dl.acm.org/doi/abs/10.1145/321439.321449) (1968) observed that the top-left-most switch of a Beneš network can always be set to zero while still retaining the network's ability to express every permutation $\pi$ in $S_n$. This switch is shown in green in our recursive description of the Beneš network. We can apply this observation recursively to all the constituent Beneš networks and set all the green switches in our example network to zero. Since these switches are fixed, we do not need to store their settings, and as a result we save a total of $n/2 - 1$ bits. Hence, this observation reduces the number of bits to exactly $$\text{# of bits} = n \log_2 n - n + 1.$$ Good progress, but we are still not at $n \log_2 n - 1.443\, n$. [Munroa, Raman, Ramanc, and Rao](https://www.sciencedirect.com/science/article/pii/S0304397512002253) (2012) suggest a way to further compress a Beneš network. Let $q = 2^\ell$ be a small power of two, say $\ell \leq 8$. We prematurely terminate the recursive structure of the Beneš network at a permutation of size $q$, and then encode this permutation (on a domain of size $q$) using the *optimally compressed representation*. Here is the network for $\pi_1$ when we terminate the recursion at a permutation of size 4:  Here we replaced the three inner layers of the Beneš network with four permutations in $S_4$. Each permutation can be represented as an integer $d$ where $d \in \range{24}$. Evaluating one of these $S_4$ permutations takes constant time. More generally, suppose we terminate the recursion at a permutation of size $q = 2^\ell$. This eliminates the inner most $2\ell + 1$ layers of the network. Then the number of bits needed to store the entire network is: \begin{align} \underbrace{n (\log_2 n - \log_2 q)}_{\begin{array}{c}\text{# switches excluding the} \\ \text{2\ell+1 inner layers} \end{array}} & - \underbrace{(n/q)+1}_{\begin{array}{c}\text{# Waksman} \\ \text{bits} \end{array}} + \underbrace{(n/q) \cdot \cal{P}(q)}_{\begin{array}{c}\text{size of the single} \\ \text{q-permutation layer} \end{array}} = \\[8px] & = n \log_2 n - n \Bigl(\log_2 q + (1/q) - \lceil \log_2(q!) \rceil / q \Bigr) + 1. \tag{2}\label{eq:calc} \end{align} Concretely, we get * for $q = 2$ the data structure uses about $\bigl[n \log_2 n - n\bigr]$ bits.    (a Beneš-Waksman network) * for $q = 4$ the data structure uses about $\bigl[n \log_2 n - n\bigr]$ bits.    (as in the figure above) * for $q = 8$ the data structure uses about $\bigl[n \log_2 n - 1.125 n\bigr]$ bits. * for $q = 16$ the data structure uses about $\bigl[n \log_2 n - 1.25 n\bigr]$ bits. * for $q = 32$ the data structure uses about $\bigl[n \log_2 n - 1.34 n\bigr]$ bits. * For $q = 256$ the data structure uses about $\bigl[n \log_2 n - 1.43 n\bigr]$ bits. This converges to ${\cal P}(n) \approx n \log_2 n - 1.443 n$ bits, which is exactly what we want. In practice using $q = 32$ is sufficient. We note that one can store a small batch of $S_q$ permutations more compactly than storing them seperately. This lets us remove the ceiling function in the $\lceil \log_2(q!) \rceil$ term in $\eqref{eq:calc}$ and get some more space savings.
 **Evaluation time.** We can speed up the evaluation procedure by processing multiple layers at a time. To do so, observe that the group of twelve blue switches in the figure below are sufficient to process the first three layers for the inputs $\{0,1,\ldots,7\}$.  The twelve yellow switches are sufficient to process the first three layers for the inputs $\{8,\ldots,15\}$. Thus, we can store the twelve bits for the blue switches in one block on disk, and the twelve bits for the yellow switches in another block on disk. Now, for an input $x \in \range{16}$, we can process the first three layers with a single disk access. For permutations in $S_n$ where $n=2^{32}$ --- the case of interest to us --- the Beneš network contains $63$ layers. Using $q = 32$ we get to remove the 11 inner layers, and replace them with permutations in $S_{32}$. This leaves 53 layers to process: 26 switching layers, a permutation in $S_{32}$, and 26 more switching layers. The plan is to process eight layers at a time. In this case, the group of "blue" switches contains $2^7 \times 8 = 1024$ switches, which means storing 1024 bits, or 128 bytes, in one block on disk. Evaluating the permutation at a given input $x \in \range{2^{32}}$ can now be done by reading only *seven* disk blocks: * we process the first 24 layers, eight layers at a time, by reading three disk blocks; * we process the next two layers, the permutation in $S_{32}$, and the next two layers after that, using a single disk access; * finally, we process the remaining 24 layers, eight layers at a time, by reading three more disk blocks. This is a total of seven disk blocks that need to be read. Interestingly, evaluating the inverse premutation at a given input $y \in \range{2^{32}}$ is done exactly the same way, just in the reverse order. ## Conclusion This completes our story. We explained how a compressed Beneš network lets us store a permutation $\pi$ in $S_n$ using an optimal number of bits. Evaluating $\pi(x)$ and $\pi^{-1}(y)$ can be done in about $2\log_2 n$ steps. The algorithm has some locality that lets us reduce the number of disk reads. **An open problem.** Design a data structure with similar performance to the one presented here *and* better locality. In particular, evaluating a permutation in $S_n$ for $n=2^{32}$ should require reading only a single disk block (4KB). This will match the performance of the trivial solution, but with less space. ## Related work [Bernstein](https://cr.yp.to/papers/controlbits-20200923.pdf) (2020) describes Waksman's observation and its history in Section 6. We thank Dan Bernstein for pointing us to this, and for other helpful comments. [Barbay and Navarro](https://arxiv.org/pdf/0902.1038.pdf) show how to compress specific classes of permutations in $S_n$, while retaining the ability to quickly evalaute the premutation and its inverse. For example, consider the class of *local* permutations where there is a known bound $b \ll n$ such that $\bigl|\pi(x)-x\bigr| \leq b$ for all $x \in \range{n}$.


text:
# Height Map¶

Height map is a grid of points which are triangulated to form a surface. Since it is axis-aligned, collision checking is very efficient and it is a recommended way to create a terrain.

You can get the following two properties from a heightMap instance

• height: getHeight()

• normal vector: getNormal()


text:
library(tidyverse)
## ── Attaching packages ──────────────────────────────────────────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✔ ggplot2 3.2.1     ✔ purrr   0.3.3
## ✔ tibble  2.1.3     ✔ dplyr   0.8.3
## ✔ tidyr   1.0.0     ✔ stringr 1.4.0
## ✔ readr   1.3.1     ✔ forcats 0.4.0
## ── Conflicts ─────────────────────────────────────────────────────────────────────────────────────── tidyverse_conflicts() ──
## ✖ dplyr::lag()    masks stats::lag()
library(knitr)

options(scipen=4)

We’ll begin by doing all the same data processing as in previous lectures

# Load data from MASS into a tibble
# Rename variables
# Recode categorical variables
birthwt <- as_tibble(MASS::birthwt) %>%
rename(birthwt.below.2500 = low,
mother.age = age,
mother.weight = lwt,
mother.smokes = smoke,
previous.prem.labor = ptl,
hypertension = ht,
uterine.irr = ui,
physician.visits = ftv,
birthwt.grams = bwt)  %>%
mutate(race = recode_factor(race, 1 = "white", 2 = "black", 3 = "other")) %>%
mutate_at(c("mother.smokes", "hypertension", "uterine.irr", "birthwt.below.2500"),
~ recode_factor(.x, 0 = "no", 1 = "yes"))

## Assessing significance of factors and interactions in regression

### Factors in linear regression

#### Interpreting coefficients of factor variables

In the case of quantitative predictors, we’re more or less comfortable with the interpretation of the linear model coefficient as a “slope” or a “unit increase in outcome per unit increase in the covariate”. This isn’t the right interpretation for factor variables. In particular, the notion of a slope or unit change no longer makes sense when talking about a categorical variable. E.g., what does it even mean to say “unit increase in major” when studying the effect of college major on future earnings?

To understand what the coefficients really mean, let’s go back to the birthwt data and try regressing birthweight on mother’s race and mother’s age.

# Fit regression model
birthwt.lm <- lm(birthwt.grams ~ race + mother.age, data = birthwt)

# Regression model summary
summary(birthwt.lm)
##
## Call:
## lm(formula = birthwt.grams ~ race + mother.age, data = birthwt)
##
## Residuals:
##      Min       1Q   Median       3Q      Max
## -2131.57  -488.02    -1.16   521.87  1757.07
##
## Coefficients:
##             Estimate Std. Error t value Pr(>|t|)
## (Intercept) 2949.979    255.352  11.553   <2e-16 ***
## raceblack   -365.715    160.636  -2.277   0.0240 *
## raceother   -285.466    115.531  -2.471   0.0144 *
## mother.age     6.288     10.073   0.624   0.5332
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 715.7 on 185 degrees of freedom
## Multiple R-squared:  0.05217,    Adjusted R-squared:  0.0368
## F-statistic: 3.394 on 3 and 185 DF,  p-value: 0.01909

Note that there are two coefficients estimated for the race variable (raceother and racewhite). What’s happening here?

When you put a factor variable into a regression, you’re allowing a different intercept at every level of the factor. In the present example, you’re saying that you want to model birthwt.grams as

Baby’s birthweight = Intercept(based on mother’s race) + $$\beta$$ * mother’s age

We can rewrite this more succinctly as: $y = \text{Intercept}_{race} + \beta \times \text{age}$

Essentially you’re saying that your data is broken down into 3 racial groups, and you want to model your data as having the same slope governing how birthweight changes with mother’s age, but potentially different intercepts. Here’s a picture of what’s happening.

# Calculate race-specific intercepts
intercepts <- c(coef(birthwt.lm)["(Intercept)"],
coef(birthwt.lm)["(Intercept)"] + coef(birthwt.lm)["raceother"],
coef(birthwt.lm)["(Intercept)"] + coef(birthwt.lm)["racewhite"])

lines.df <- data.frame(intercepts = intercepts,
slopes = rep(coef(birthwt.lm)["mother.age"], 3),
race = levels(birthwt\$race))

qplot(x = mother.age, y = birthwt.grams, color = race, data = birthwt) +
geom_abline(aes(intercept = intercepts,
slope = slopes,
color = race), data = lines.df)
## Warning: Removed 1 rows containing missing values (geom_abline).

How do we interpret the 2 race coefficients? For categorical variables, the interpretation is relative to the given baseline. The baseline is just whatever level comes first (here, “black”). E.g., the estimate of raceother means that the estimated intercept is -285.4657796 higher among “other” race mothers compared to black mothers. Similarly, the estimated intercept is NA higher for white mothers than black mothers.

Another way of putting it: Among mothers of the same age, babies of white mothers are born on average weighing NAg more than babies of black mothers.

##### Why is one of the levels missing in the regression?

As you’ve already noticed, there is no coefficient called “raceblack” in the estimated model. This is because this coefficient gets absorbed into the overall (Intercept) term.

Let’s peek under the hood. Using the model.matrix() function on our linear model object, we can get the data matrix that underlies our regression. Here are the first 20 rows.

head(model.matrix(birthwt.lm), 20)
##    (Intercept) raceblack raceother mother.age
## 1            1         1         0         19
## 2            1         0         1         33
## 3            1         0         0         20
## 4            1         0         0         21
## 5            1         0         0         18
## 6            1         0         1         21
## 7            1         0         0         22
## 8            1         0         1         17
## 9            1         0         0         29
## 10           1         0         0         26
## 11           1         0         1         19
## 12           1         0         1         19
## 13           1         0         1         22
## 14           1         0         1         30
## 15           1         0         0         18
## 16           1         0         0         18
## 17           1         1         0         15
## 18           1         0         0         25
## 19           1         0         1         20
## 20           1         0         0         28

Even though we think of the regression birthwt.grams ~ race + mother.age as being a regression on two variables (and an intercept), it’s actually a regression on 3 variables (and an intercept). This is because the race variable gets represented as two dummy variables: one for race == other and the other for race == white.

Why isn’t there a column for representing the indicator of race == black? This gets back to our colinearity issue. By definition, we have that

raceblack + raceother + racewhite = 1 = (Intercept)

This is because for every observation, one and only one of the race dummy variables will equal 1. Thus the group of 4 variables {raceblack, raceother, racewhite, (Intercept)} is perfectly colinear, and we can’t include all 4 of them in the model. The default behavior in R is to remove the dummy corresponding to the first level of the factor (here, raceblack), and to keep the rest.

#### Interaction terms

Let’s go back to the regression line plot we generated above.

qplot(x = mother.age, y = birthwt.grams, color = race, data = birthwt) +
geom_abline(aes(intercept = intercepts,
slope = slopes,
color = race), data = lines.df)
## Warning: Removed 1 rows containing missing values (geom_abline).

We have seen similar plots before by using the geom_smooth or stat_smooth commands in ggplot. Compare the plot above to the following.

qplot(x = mother.age, y = birthwt.grams, color = race, data = birthwt) +
stat_smooth(method = "lm", se = FALSE, fullrange = TRUE)


text:
STNB2019 (33è any)

Serre's constant of elliptic curves over the rationals

Ponents

Enrique González-Jiménez

Resum

Let E be an elliptic curve without complex multiplication defined over the rationals. The purpose of this talk is to define a positive integer A(E), that we call the Serre’s constant associated to E, that gives necessary conditions to conclude that $ρ_{E,m}$ , the mod m Galois representation associated to E, is non-surjective. In particular, if there exists a prime factor p of m satisfying $val_p (m) > val_p (A(E))$ then $ρ_{E,m}$ is non-surjective. We determine all the Serre’s constants of elliptic curves without complex multiplication over the rationals that occur infinitely often. Moreover, we give all the possible combination of mod p Galois representations that occur for infinitely many non-isomorphic classes of non-CM elliptic curves over $\mathbb{Q}$, and the known cases that appear only finitely. We obtain similar results for the possible combination of maximal nonsurjective subgroups of $GL_2 (\mathbb{Z}_p )$. Finally, we conjecture all the possibilities of these combinations and in particular all the possibilities of these Serre’s constant. This is joint work with Harris B. Daniels.

Compte
Llengües:


text:
# Math Help - Limits, absolute values, and inequalities with variables in the denominator

1. ## Limits, absolute values, and inequalities with variables in the denominator

Here is the original problem
$

$
$\lim_{x\to-1^-}\frac {5} {(x+1)^3}= \infty
$

So you do
$\frac {5} {(x+3)} whenever $-1-\delta

Then you need to solve for x+1 to move on to the next step, but I don't know how...
The book says you should get $\sqrt [3] {5/|N|}$... but I can't figure out how to get the absolute value.

2. Better would be to write $\frac 5{(x+1)^3}<-N$ ( $N$ positive) when $-1-\delta because $\lim_{x\to-1^-}\frac 5{(x+1)^3}=-\infty$.

3. Originally Posted by halbard
Better would be to write $\frac 5{(x+1)^3}<-N$ ( $N$ positive) when $-1-\delta because $\lim_{x\to-1^-}\frac 5{(x+1)^3}=-\infty$.
OK... but that still doesn't answer my question

4. Originally Posted by Chokfull
Here is the original problem
[FONT=monospace] $

$
$\lim_{x\to-1^-}\frac {5} {(x+1)^3}= \infty
$
The orginal problem is wrong.
$\lim_{x\to-1^-}\frac {5} {(x+1)^3}= {\color{red}-}\infty
$

Suppose that $N \in \mathbb{Z}^ +$ then $\sqrt[3]{{\frac{{ - 5}}{N}}} - 1 < x < - 1\, \Rightarrow \,\frac{5}{{\left( {x + 1} \right)^3 }} < - N$.

5. Originally Posted by Plato
The orginal problem is wrong.
$\lim_{x\to-1^-}\frac {5} {(x+1)^3}= {\color{red}-}\infty
$

Suppose that $N \in \mathbb{Z}^ +$ then $\sqrt[3]{{\frac{{ - 5}}{N}}} - 1 < x < - 1\, \Rightarrow \,\frac{5}{{\left( {x + 1} \right)^3 }} < - N$.
I think that the problem may have been to prove that this limit is false... that or it was a typo by me or the book... or you are mistaken.
Anyways, does that Z mean positive? if it does, you are wrong--N has to be negative.

6. I'm trying to use the book's method to solve this problem.... The part I need help with is the absolute value in the denominator, I thought there was a rule for inequalities in which you can't multiply each side by the denominator, but I couldn't find it.

7. $\lim_{x\to{a}}f(x)=\infty\Rightarrow$ that for each number $\delta$ such that $|x-a|<\delta$, $\exists$ a number $M$ for which $M.

You can see that the definition is satisfied.However, f(x) goes to NEGATIVE infinity. If you would like to prove it you could choose some arbitraily small number $M$, solve the inequality $M>f(x)$ , then use that value of x (to the left of -1) in the inequality $|x-a|<\delta=\text{slightly larger than the actual value}$ (where a is -1), and show that however close x comes to a, f(x) will still be less than M.

8. Originally Posted by Plato
The orginal problem is wrong.
$x\rightarrow{-1^-},\forall{x}\epsilon(-\infty,-1),\Rightarrow(x+1)^3<0\Rightarrow{f(x)<0}$

You are correct sir.

9. $\frac{5}{(x+1)^{3}}\rightarrow
-\infty$
as $x\rightarrow -1^{-}$ if $|x+1|<\delta$ whenever $\frac{5}{(x+1)^{3}}<-N, N>0$ which yields
after solving the absolute value that $\frac{5}{(x+1)^{3}}<\frac{-5}{\delta^{3}}$ so we can write $\frac{-5}{\delta^{3}}=-N$ which directly implies the result.


text:
location:  Publications → journals → CMB
Abstract view

# A Generalization of a Theorem of Boyd and Lawton

Published:2012-07-16
Printed: Dec 2013
• Zahraa Issa,
Département de mathématiques et de statistique, Université de Montréal, Montreal, QC H3C 3J7
• Matilde Lalín,
Département de mathématiques et de statistique, Université de Montréal, Montreal, QC H3C 3J7
 Format: LaTeX MathJax PDF

## Abstract

The Mahler measure of a nonzero $n$-variable polynomial $P$ is the integral of $\log|P|$ on the unit $n$-torus. A result of Boyd and Lawton says that the Mahler measure of a multivariate polynomial is the limit of Mahler measures of univariate polynomials. We prove the analogous result for different extensions of Mahler measure such as generalized Mahler measure (integrating the maximum of $\log|P|$ for possibly different $P$'s), multiple Mahler measure (involving products of $\log|P|$ for possibly different $P$'s), and higher Mahler measure (involving $\log^k|P|$).
 Keywords: Mahler measure, polynomial
 MSC Classifications: 11R06 - PV-numbers and generalizations; other special algebraic numbers; Mahler measure 11R09 - Polynomials (irreducibility, etc.)

 top of page | contact us | privacy | site map |


text:
# Victor Loves Eight

If there are $$x$$ integers between $$0$$ and $$10^{8}$$ having the digit sum equal to $$8$$, find the largest prime factor of $$x$$.

×


text:
# colour.utilities.ColourWarning¶

class colour.utilities.ColourWarning[source]

Bases: Warning

This is the base class of Colour warnings. It is a subclass of Warning class.

__weakref__

list of weak references to the object (if defined)


text:
+0

# Number Theory

0
82
1

What is the remainder when 2013^(2013^2) is divided by 13?

May 27, 2021

#1
+602
+1

Notice that $2013\equiv 11\equiv -2\pmod{13}$.

So $2013^{2013^2}\equiv (-2)^{2013^2}\equiv -2^{2013^2}\pmod{13}$ since $2013^2$ is odd.

Notice that $\gcd(2,13)=1$ and $13$ is prime, so we can invoke fermat's little theorem, i.e. $2^{12}\equiv 1\pmod{13}$.

Notice that $2013\equiv 9\pmod{12}\implies 2013^2\equiv 9^2=81\equiv 9\pmod{12}$.

Hence $-2^{2013^2}\equiv -2^9\pmod{13}$. Note $2^9\equiv 512\equiv 5\pmod{13}$, hence the answer is $-5\equiv \boxed{8}\pmod{13}$.

May 27, 2021


text:
Find the eigenvalues and eigenvectors of the matrix:

$\begin{bmatrix} -12 & 7 \\ -14 & 9 \end{bmatrix}$

Click for answer

Click for Latex code


text:
# Gravitational potential

1. Feb 22, 2005

### einstone

What is the gravitational potential produced by a chargeless particle confined in a box if the particle is in a stationary state ( for the nonce,in the lowest energy state)?
Thanking you,
Einstone.

2. Feb 22, 2005

### dextercioby

$$V=-\frac{Gm}{r}$$,if the particle in the origin of a system of coordinates.

Daniel.

P.S.Why...?What's the "box" catch...?

3. Feb 23, 2005

### einstone

Oh, I owe you an apology. It was remiss of me to have said 'a particle'
insted of a 'microparticle' in the question. I reckon the choice of a box would produce the simplest possible wavefunctions.
Thanking you,
Einstone.

4. Feb 23, 2005

### dextercioby

What do wavefunctions have to do with the gravitational potential created by the same particle (and not by another body)...?

Daniel.

5. Feb 23, 2005

### einstone

How is the potential at a point inside the box determined? It should depend
upon the wavefunction.
I'm, with great respect,
Einstone.

6. Feb 23, 2005

### dextercioby

Surprise.Usually,the potential is GIVEN...The wavefunction's is computed knowing the potential and usually not viceversa.That's because you cannot know wavefunctions through other method,than solving Schrödinger's eq.which assumes knowing the potential...

Daniel.

7. Feb 23, 2005

### ZapperZ

Staff Emeritus
Er.. if this "wavefunction" that you are talking about is the solution to the Schrodinger equation, then you have put the tail in front of the donkey. It is the wavefuction that is dependent on the potential, NOT the other way around. You don't find the solution to the differential equation and THEN write down the differential equation. And if you look at the Schrodinger equation that you have to solve, the "V" in there IS exactly the potential. Only after you know what V is, do you get the wavefunction.

Zz.

8. Feb 24, 2005

### einstone

Thank you for the replies.
Does the particle interact with its own gravitational field ( which is
present even in absence of any other potential)? If not, what is the gravitational field produced by it?
So daffy of me to have forgotten about the gravitation & thought that the particle was free! Then I went on to find the wavefunction & calculate the potential.

9. Feb 24, 2005

### dextercioby

Of course,in the CLASSICAL theory of GR,just in CED,particles can interact with their own gravity field.

In the Newtonian theory,i've already told you what the potential is.

Daniel.

10. Feb 24, 2005

### hellfire

As already mentioned, you can describe a particle inside a gravitational potential making use of the Schrödinger equation. However, if you want to describe the gravitational field or gravitational potential generated by quantum particle you have no proper equations nor a theory to do that. In chapter 14 of R. Wald's "General Relativity", a simple argument is given why this cannot work with the current physics (a "quantum" particle and "classical" gravitation): The (classical) gravitational field should spread according to the particles' wavefunction. The instantaneous wavefunction collapse would lead to a superluminal propagation of the changes of the field. To describe this properly a quantum field theory for gravitation (or quantum gravity) would be needed in which the superposition principle would be also valid for the gravitational field.

Last edited: Feb 24, 2005
11. Feb 24, 2005

### einstone

:surprised Good Heavens! Never mind the equations, but is there not even a consistent theory? I thought I'd solve the problem & generalise it step by step to include Relativistic Gravitation ,then Dirac's equation & ...!
How, then, do all the theories give correct answers?

12. Feb 24, 2005

### dextercioby

Only as partial theories.If u wanna mix gravity & Dirac fields,end up with Sugra N=1,okay,but you can do that:
1.In the free falling frame.
2.The field theory is not renormalizable under quantization,...

But of course,both Dirac & GR are perfectly valid theories,on THEIR OWN...

Daniel.

13. Mar 1, 2005

### ChrisAvery

I Love This Forum! I learn more from this site than from any classroom!


text:
• ### Design, status and perspective of the Mu2e crystal calorimeter(1801.03159)

April 18, 2018 hep-ex, physics.ins-det
The Mu2e experiment at Fermilab will search for the charged lepton flavor violating process of neutrino-less $\mu \to e$ coherent conversion in the field of an aluminum nucleus. Mu2e will reach a single event sensitivity of about $2.5\cdot 10^{-17}$ that corresponds to four orders of magnitude improvements with respect to the current best limit. The detector system consists of a straw tube tracker and a crystal calorimeter made of undoped CsI coupled with Silicon Photomultipliers. The calorimeter was designed to be operable in a harsh environment where about 10 krad/year will be delivered in the hottest region and work in presence of 1 T magnetic field. The calorimeter role is to perform $\mu$/e separation to suppress cosmic muons mimiking the signal, while providing a high level trigger and a seeding the track search in the tracker. In this paper we present the calorimeter design and the latest R$\&$D results.
• ### Quality Assurance on Un-Doped CsI Crystals for the Mu2e Experiment(1802.08247)

Feb. 22, 2018 hep-ex, physics.ins-det
The Mu2e experiment is constructing a calorimeter consisting of 1,348 undoped CsI crystals in two disks. Each crystal has a dimension of 34 x 34 x 200 mm, and is readout by a large area silicon PMT array. A series of technical specifications was defined according to physics requirements. Preproduction CsI crystals were procured from three firms: Amcrys, Saint-Gobain and Shanghai Institute of Ceramics. We report the quality assurance on crystal's scintillation properties and their radiation hardness against ionization dose and neutrons. With a fast decay time of 30 ns and a light output of more than 100 p.e./MeV measured with a bi-alkali PMT, undoped CsI crystals provide a cost-effective solution for the Mu2e experiment.
• ### The Mu2e undoped CsI crystal calorimeter(1801.02237)

Feb. 22, 2018 physics.ins-det
The Mu2e experiment at Fermilab will search for Charged Lepton Flavor Violating conversion of a muon to an electron in an atomic field. The Mu2e detector is composed of a tracker, an electromagnetic calorimeter and an external system, surrounding the solenoid, to veto cosmic rays. The calorimeter plays an important role to provide: a) excellent particle identification capabilities; b) a fast trigger filter; c) an easier tracker track reconstruction. Two disks, located downstream of the tracker, contain 674 pure CsI crystals each. Each crystal is read out by two arrays of UV-extended SiPMs. The choice of the crystals and SiPMs has been finalized after a thorough test campaign. A first small scale prototype consisting of 51 crystals and 102 SiPM arrays has been exposed to an electron beam at the BTF (Beam Test Facility) in Frascati. Although the readout electronics were not the final, results show that the current design is able to meet the timing and energy resolution required by the Mu2e experiment.
• ### Expression of Interest for Evolution of the Mu2e Experiment(1802.02599)

Feb. 7, 2018 hep-ex, physics.ins-det
We propose an evolution of the Mu2e experiment, called Mu2e-II, that would leverage advances in detector technology and utilize the increased proton intensity provided by the Fermilab PIP-II upgrade to improve the sensitivity for neutrinoless muon-to-electron conversion by one order of magnitude beyond the Mu2e experiment, providing the deepest probe of charged lepton flavor violation in the foreseeable future. Mu2e-II will use as much of the Mu2e infrastructure as possible, providing, where required, improvements to the Mu2e apparatus to accommodate the increased beam intensity and cope with the accompanying increase in backgrounds.
• ### Measurements of $\pi^\pm$, K$^\pm$, p and $\bar{\textrm{p}}$ spectra in proton-proton interactions at 20, 31, 40, 80 and 158 GeV/c with the NA61/SHINE spectrometer at the CERN SPS(1705.02467)

Sept. 27, 2017 nucl-ex
Measurements of inclusive spectra and mean multiplicities of $\pi^\pm$, K$^\pm$, p and $\bar{\textrm{p}}$ produced in inelastic p+p interactions at incident projectile momenta of 20, 31, 40, 80 and 158 GeV/c ($\sqrt{s} =$ 6.3, 7.7, 8.8, 12.3 and 17.3 GeV, respectively) were performed at the CERN Super Proton Synchrotron using the large acceptance NA61/SHINE hadron spectrometer. Spectra are presented as function of rapidity and transverse momentum and are compared to predictions of current models. The measurements serve as the baseline in the NA61/SHINE study of the properties of the onset of deconfinement and search for the critical point of strongly interacting matter.
• ### Measurement of Meson Resonance Production in $\pi^{-} +$C Interactions at SPS energies(1705.08206)

May 23, 2017 nucl-ex, astro-ph.HE
We present measurements of $\rho^0$, $\omega$ and K$^{*0}$ spectra in $\pi^{-} +$C production interactions at 158 GeV/c and $\rho^0$ spectra at 350 GeV/c using the NA61/SHINE spectrometer at the CERN SPS. Spectra are presented as a function of the Feynman's variable $x_\text{F}$ in the range $0 < x_\text{F} < 1$ and $0 < x_\text{F} < 0.5$ for 158 GeV/c and 350 GeV/c respectively. Furthermore, we show comparisons with previous measurements and predictions of several hadronic interaction models. These measurements are essential for a better understanding of hadronic shower development and for improving the modeling of cosmic ray air showers.
• ### Measurement of the energy and time resolution of a undoped CsI + MPPC array for the Mu2e experiment(1702.03720)

Feb. 13, 2017 hep-ex, physics.ins-det
This paper describes the measurements of energy and time response and resolution of a 3 x 3 array made of undoped CsI crystals coupled to large area Hamamatsu Multi Pixel Photon Counters. The measurements have been performed using the electron beam of the Beam Test Facility in Frascati (Rome, Italy) in the energy range 80-120 MeV. The measured energy resolution, estimated with the FWHM, at 100 MeV is 16.4%. This resolution is dominated by the energy leakage due to the small dimensions of the prototype. The time is reconstructed by fitting the leading edge of the digitized signals and applying a digital constant fraction discrimination technique. A time resolution of about 110 ps at 100 MeV is achieved.
• ### Two-particle correlations in azimuthal angle and pseudorapidity in inelastic p+p interactions at the CERN Super Proton Synchrotron(1610.00482)

Feb. 7, 2017 nucl-ex
Results on two-particle $\Delta\eta\Delta\phi$ correlations in inelastic p+p interactions at 20, 31, 40, 80, and 158~GeV/c are presented. The measurements were performed using the large acceptance NA61/SHINE hadron spectrometer at the CERN Super Proton Synchrotron. The data show structures which can be attributed mainly to effects of resonance decays, momentum conservation, and quantum statistics. The results are compared with the EPOS and UrQMD models.
• ### The calorimeter of the Mu2e experiment at Fermilab(1701.07975)

Jan. 27, 2017 physics.ins-det
The Mu2e experiment at Fermilab looks for Charged Lepton Flavor Violation (CLFV) improving by 4 orders of magnitude the current experimental sensitivity for the muon to electron conversion in a muonic atom. A positive signal could not be explained in the framework of the current Standard Model of particle interactions and therefore would be a clear indication of new physics. In 3 years of data taking, Mu2e is expected to observe less than one background event mimicking the electron coming from muon conversion. Achieving such a level of background suppression requires a deep knowledge of the experimental apparatus: a straw tube tracker, measuring the electron momentum and time, a cosmic ray veto system rejecting most of cosmic ray background and a pure CsI crystal calorimeter, that will measure time of flight, energy and impact position of the converted electron. The calorimeter has to operate in a harsh radiation environment, in a 10-4 Torr vacuum and inside a 1 T magnetic field. The results of the first qualification tests of the calorimeter components are reported together with the energy and time performances expected from the simulation and measured in beam tests of a small scale prototype.
• ### Measurements of $\pi^{\pm}$ differential yields from the surface of the T2K replica target for incoming 31 GeV/c protons with the NA61/SHINE spectrometer at the CERN SPS(1603.06774)

Nov. 29, 2016 hep-ex, physics.ins-det
Measurements of particle emission from a replica of the T2K 90 cm-long carbon target were performed in the NA61/SHINE experiment at CERN SPS, using data collected during a high-statistics run in 2009. An efficient use of the long-target measurements for neutrino flux predictions in T2K requires dedicated reconstruction and analysis techniques. Fully-corrected differential yields of $\pi^\pm$-mesons from the surface of the T2K replica target for incoming 31 GeV/c protons are presented. A possible strategy to implement these results into the T2K neutrino beam predictions is discussed and the propagation of the uncertainties of these results to the final neutrino flux is performed.
• ### Multiplicity and transverse momentum fluctuations in inelastic proton-proton interactions at the CERN Super Proton Synchrotron(1510.00163)

Aug. 30, 2016 hep-ex, nucl-ex
Measurements of multiplicity and transverse momentum fluctuations of charged particles were performed in inelastic p+p interactions at 20, 31, 40, 80 and 158 GeV/c beam momentum. Results for the scaled variance of the multiplicity distribution and for three strongly intensive measures of multiplicity and transverse momentum fluctuations \$\Delta[P_{T},N]\$, \$\Sigma[P_{T},N]\$ and \$\Phi_{p_T}\$ are presented. For the first time the results on fluctuations are fully corrected for experimental biases. The results on multiplicity and transverse momentum fluctuations significantly deviate from expectations for the independent particle production. They also depend on charges of selected hadrons. The string-resonance Monte Carlo models EPOS and UrQMD do not describe the data. The scaled variance of multiplicity fluctuations is significantly higher in inelastic p+p interactions than in central Pb+Pb collisions measured by NA49 at the same energy per nucleon. This is in qualitative disagreement with the predictions of the Wounded Nucleon Model. Within the statistical framework the enhanced multiplicity fluctuations in inelastic p+p interactions can be interpreted as due to event-by-event fluctuations of the fireball energy and/or volume.
• ### Design and status of the Mu2e electromagnetic calorimeter(1608.02652)

Aug. 8, 2016 hep-ex, physics.ins-det
The Mu2e experiment at Fermilab aims at measuring the neutrinoless conversion of a negative muon into an electron and reach a single event sensitivity of 2.5x10^{-17} after three years of data taking. The monoenergetic electron produced in the final state, is detected by a high precision tracker and a crystal calorimeter, all embedded in a large superconducting solenoid (SD) surrounded by a cosmic ray veto system. The calorimeter is complementary to the tracker, allowing an independent trigger and powerful particle identification, while seeding the track reconstruction and contributing to remove background tracks mimicking the signal. In order to match these requirements, the calorimeter should have an energy resolution of O(5)% and a time resolution better than 500 ps at 100 MeV. The baseline solution is a calorimeter composed of two disks of BaF2 crystals read by UV extended, solar blind, Avalanche Photodiode (APDs), which are under development from a JPL, Caltech, RMD consortium. In this paper, the calorimeter design, the R&D studies carried out so far and the status of engineering are described. A backup alternative setup consisting of a pure CsI crystal matrix read by UV extended Hamamatsu MPPC's is also presented.
• ### Design, status and test of the Mu2e crystal calorimeter(1606.05448)

July 1, 2016 hep-ex, physics.ins-det
The Mu2e experiment at Fermilab searches for the charged-lepton flavor violating neutrino-less conversion of a negative muon into an electron in the field of a aluminum nucleus. The dynamic of such a process is well modeled by a two-body decay, resulting in a monoenergetic electron with an energy slightly below the muon rest mass (104.967 MeV). The calorimeter of this experiment plays an important role to provide excellent particle identification capabilities and an online trigger filter while aiding the track reconstruction capabilities. The baseline calorimeter configuration consists of two disks each made with about 700 undoped CsI crystals read out by two large area UV-extended Silicon Photomultipliers. These crystals match the requirements for stability of response, high resolution and radiation hardness. In this paper we present the final calorimeter design.
• ### Energy and time resolution for a LYSO matrix prototype of the Mu2e experiment(1605.09419)

May 30, 2016 hep-ex, physics.ins-det
We have measured the performances of a LYSO crystal matrix prototype tested with electron and photon beams in the energy range 60$-$450 MeV. This study has been carried out to determine the achievable energy and time resolutions for the calorimeter of the Mu2e experiment.
• ### Production of $\Lambda$ hyperons in inelastic p+p interactions at 158 GeV/$c$(1510.03720)

April 25, 2016 hep-ex, nucl-ex
Inclusive production of $\Lambda$-hyperons was measured with the large acceptance NA61/SHINE spectrometer at the CERN SPS in inelastic p+p interactions at beam momentum of 158~\GeVc. Spectra of transverse momentum and transverse mass as well as distributions of rapidity and x$_{_F}$ are presented. The mean multiplicity was estimated to be $0.120\,\pm0.006\;(stat.)\,\pm 0.010\;(sys.)$. The results are compared with previous measurements and predictions of the EPOS, UrQMD and FRITIOF models.
• ### Measurements of $\pi^\pm$, $K^\pm$, $K^0_S$, $\Lambda$ and proton production in proton-carbon interactions at 31 GeV/$c$ with the NA61/SHINE spectrometer at the CERN SPS(1510.02703)

Feb. 24, 2016 hep-ex, nucl-ex
Measurements of hadron production in p+C interactions at 31 GeV/c are performed using the NA61/ SHINE spectrometer at the CERN SPS. The analysis is based on the full set of data collected in 2009 using a graphite target with a thickness of 4% of a nuclear interaction length. Inelastic and production cross sections as well as spectra of $\pi^\pm$, $K^\pm$, p, $K^0_S$ and $\Lambda$ are measured with high precision. These measurements are essential for improved calculations of the initial neutrino fluxes in the T2K long-baseline neutrino oscillation experiment in Japan. A comparison of the NA61/SHINE measurements with predictions of several hadroproduction models is presented.
• ### Measurement of time resolution of the Mu2e LYSO calorimeter prototype(1509.04468)

Jan. 11, 2016 hep-ex, physics.ins-det
In this paper we present the time resolution measurements of the Lutetium-Yttrium Oxyorthosilicate (LYSO) calorimeter prototype for the Mu2e experiment. The measurements have been performed using the $e^-$ beam of the Beam Test Facility (BTF) in Frascati, Italy in the energy range from 100 to 400 MeV. The calorimeter prototype consisted of twenty five 30x30x130 mm$^3$, LYSO crystals read out by 10x10 mm$^2$ Hamamatsu Avalanche Photodiodes (APDs). The energy dependence of the measured time resolution can be parametrized as $\sigma_{t}(E)=a/\sqrt{E/\mathrm{GeV}} \oplus b$, with the stochastic and constant terms $a=(51\pm1)$ ps and $b=(10\pm4)$ ps, respectively. This corresponds to the time resolution of ($162\pm4$) ps at 100 MeV.
• ### Measurement of negatively charged pion spectra in inelastic p+p interactions at $p_{lab}$ = 20, 31, 40, 80 and 158 GeV/c(1310.2417)

Feb. 26, 2014 hep-ex, nucl-ex
We present experimental results on inclusive spectra and mean multiplicities of negatively charged pions produced in inelastic p+p interactions at incident projectile momenta of 20, 31, 40, 80 and 158 GeV/c ($\sqrt{s} =$ 6.3, 7.7, 8.8, 12.3 and 17.3 GeV, respectively). The measurements were performed using the large acceptance NA61/SHINE hadron spectrometer at the CERN Super Proton Synchrotron. Two-dimensional spectra are determined in terms of rapidity and transverse momentum. Their properties such as the width of rapidity distributions and the inverse slope parameter of transverse mass spectra are extracted and their collision energy dependences are presented. The results on inelastic p+p interactions are compared with the corresponding data on central Pb+Pb collisions measured by the NA49 experiment at the CERN SPS. The results presented in this paper are part of the NA61/SHINE ion program devoted to the study of the properties of the onset of deconfinement and search for the critical point of strongly interacting matter. They are required for interpretation of results on nucleus-nucleus and proton-nucleus collisions.
• ### Measurements of Production Properties of K0S mesons and Lambda hyperons in Proton-Carbon Interactions at 31 GeV/c(1309.1997)

Sept. 8, 2013 nucl-ex, physics.acc-ph
Spectra of K0S mesons and Lambda hyperons were measured in p+C interactions at 31 GeV/c with the large acceptance NA61/SHINE spectrometer at the CERN SPS. The data were collected with an isotropic graphite target with a thickness of 4% of a nuclear interaction length. Interaction cross sections, charged pion spectra, and charged kaon spectra were previously measured using the same data set. Results on K0S and Lambda production in p+C interactions serve as reference for the understanding of the enhancement of strangeness production in nucleus-nucleus collisions. Moreover, they provide important input for the improvement of neutrino flux predictions for the T2K long baseline neutrino oscillation experiment in Japan. Inclusive production cross sections for K0S and Lambda are presented as a function of laboratory momentum in intervals of the laboratory polar angle covering the range from 0 up to 240 mrad. The results are compared with predictions of several hadron production models. The K0S mean multiplicity in production processes <n_K0S> and the inclusive cross section for K0S production were measured and amount to 0.127 +- 0.005 (stat) +- 0.022 (sys) and 29.0 +- 1.6 (stat) +- 5.0 (sys) mb, respectively.
• Mu2e at Fermilab will search for charged lepton flavor violation via the coherent conversion process mu- N --> e- N with a sensitivity approximately four orders of magnitude better than the current world's best limits for this process. The experiment's sensitivity offers discovery potential over a wide array of new physics models and probes mass scales well beyond the reach of the LHC. We describe herein the conceptual design of the proposed Mu2e experiment. This document was created in partial fulfillment of the requirements necessary to obtain DOE CD-1 approval, which was granted July 11, 2012.
• ### Pion emission from the T2K replica target: method, results and application(1207.2114)

Nov. 28, 2012 hep-ex, nucl-ex
The T2K long-baseline neutrino oscillation experiment in Japan needs precise predictions of the initial neutrino flux. The highest precision can be reached based on detailed measurements of hadron emission from the same target as used by T2K exposed to a proton beam of the same kinetic energy of 30 GeV. The corresponding data were recorded in 2007-2010 by the NA61/SHINE experiment at the CERN SPS using a replica of the T2K graphite target. In this paper details of the experiment, data taking, data analysis method and results from the 2007 pilot run are presented. Furthermore, the application of the NA61/SHINE measurements to the predictions of the T2K initial neutrino flux is described and discussed.
• ### Measurement of Production Properties of Positively Charged Kaons in Proton-Carbon Interactions at 31 GeV/c(1112.0150)

Dec. 1, 2011 hep-ex
Spectra of positively charged kaons in p+C interactions at 31 GeV/c were measured with the NA61/SHINE spectrometer at the CERN SPS. The analysis is based on the full set of data collected in 2007 with a graphite target with a thickness of 4% of a nuclear interaction length. Interaction cross sections and charged pion spectra were already measured using the same set of data. These new measurements in combination with the published ones are required to improve predictions of the neutrino flux for the T2K long baseline neutrino oscillation experiment in Japan. In particular, the knowledge of kaon production is crucial for precisely predicting the intrinsic electron neutrino component and the high energy tail of the T2K beam. The results are presented as a function of laboratory momentum in 2 intervals of the laboratory polar angle covering the range from 20 up to 240 mrad. The kaon spectra are compared with predictions of several hadron production models. Using the published pion results and the new kaon data, the K+/\pi+ ratios are computed.


text:
# TiKz dash dash plus plus

Unfortunately due to the way search engines work, this information isn't that easy to find.

Sometimes examples draw using --, sometimes -- +, sometimes -- ++.

I don't get the meaning!

For example, for this command:

\draw[fill=gray!50] (1,1) -- + (0:.5) arc (0:60:1) -- cycle;

What is the -- + there?

What does it mean if I change that to -- ?

-
I've added a reference to the manual for further reading. –  Loop Space Aug 6 '12 at 19:14
Which is here –  bobobobo Aug 9 '12 at 16:26

The pluses modify the following coordinate making it relative to the previous saved coordinate. The difference between a single and a double plus is whether or not the saved coordinate is updated.

Thus:

\draw (1,1) -- ++(1,0) -- ++(0,1);

the second coordinate is actually (1,1) + (1,0) = (2,1) and the third is (2,1) + (0,1) = (2,2).

\draw (1,1) -- +(1,0) -- ++(0,1);

the second coordinate is actually (1,1) + (1,0) = (2,1) but the second coordinate is not saved so the third is relative to the first and thus is (1,1) + (0,1) = (1,2).

There's a slight change for bezier curves. If you do \draw (1,1) .. controls +(1,0) and +(0,1) .. ++(2,2) then the second control point is computed relative to the end point (which is very useful) and thus the controls are (1,1) + (1,0) for the first and (2,2) + (1,1) + (0,1) for the second (as the end point is itself relative to the initial position since the control points were specified with a single plus).

(Forgot to add the reference to the manual: to learn more, see Section 13.4 in the PGF manual (PGF2.10 version, might be a different section in other versions))

-


text:
# ggNNC

0th

Percentile

##### Visualising Numbers Needed for Change

These functions can be used to visualise Numbers Needed for Change. erDataSeq is a helper function to generate an Event Rate Data Sequence, and it uses convert.threshold.to.er and convert.er.to.threshold to convert thresholds to event rates and vice versa.

Keywords
utilities
##### Usage
erDataSeq(er = NULL, threshold = NULL,
mean = NULL, sd = NULL,
eventIfHigher = TRUE,
pRange = c(1e-06, 0.99999),
xStep = 0.01)ggNNC(cerDataSeq, d = NULL, eventDesirable = TRUE,
r = 1, xlab = "Continuous outcome",
plotTitle = c("Numbers Needed for Change = ", ""),
theme = theme_bw(), lineSize = 1,
cerColor = "#EBF2F8", eerColor = "#172F47",
cerLineColor = "#888888", eerLineColor = "#000000",
dArrowColor = "#000000", cerAlpha = 0.66,
eerAlpha = 0.66, xLim = NULL,
xLimAutoDensityTolerance = 0.001,
showLegend = TRUE, verticalLineColor = "#172F47",
desirableColor = "#00FF00", desirableAlpha = 0.2,
undesirableColor = "#FF0000", undesirableAlpha = 0.2,
desirableTextColor = "#009900",
undesirableTextColor = "#990000",
dArrowDistance = 0.04 * max(cerDataSeq$density), dLabelDistance = 0.08 * max(cerDataSeq$density))

convert.threshold.to.er(threshold, mean, sd,
eventIfHigher = TRUE,
pdist = pnorm)convert.er.to.threshold(er, mean, sd,
eventIfHigher = TRUE,
qdist = qnorm)
##### Arguments
er

Event rate to visualise (or convert).

threshold

If the event rate is not available, a threshold value can be specified instead, which is then used in conjunction with the mean (mean) and standard deviation (sd) and assuming a normal distribution to compute the event rate.

mean

The mean of the control group distribution.

sd

The standard deviation (of the control distribution, but assumed to be the same for both distributions).

eventIfHigher

Whether scores above or below the threshold are considered 'an event'.

pRange

The range of probabilities for which to so the distribution.

xStep

Precision of the drawn distribution; higher values mean lower precision/granularity/resolution.

cerDataSeq

The cerDataSeq object.

d

The value of Cohen's d.

eventDesirable

Whether an event is desirable or undesirable.

r

The correlation between the determinant and behavior (for mediated NNC's).

xlab

The label to display for the X axis.

plotTitle

The title of the plot; either one character value, this value if used; if two, they are considered a prefix and suffix to be pre/appended to the NNC value.

theme

The theme to use for the plot.

lineSize

The thickness of the lines in the plot.

cerColor

The color to use for the event rate portion of the control group distribution.

eerColor

The color to use for the event rate portion of the experimental group distribution.

cerLineColor

The line color to use for the control group distribution.

eerLineColor

The line color to use for the experimental group distribution.

dArrowColor

The color of the arrow to show the effect size.

cerAlpha

The alpha value (transparency) to use for the control group distribution.

eerAlpha

The alpha value (transparency) to use for the control group distribution.

xLim

This can be used to manually specify the limits for the X axis; if NULL, sensible limits will be derived using xLimAutoDensityTolerance.

xLimAutoDensityTolerance

If xLim is NULL, the limits will be set where the density falls below this proportion of its maximum value.

showLegend

Whether to show the legend (only if showing two distributions).

verticalLineColor

The color of the vertical line used to indicate the threshold.

desirableColor

The color for the desirable portion of the X axis.

desirableAlpha

The alpha for the desirable portion of the X axis.

undesirableColor

The color for the undesirable portion of the X axis.

undesirableAlpha

The color for the undesirable portion of the X axis.

desirableTextColor

The color for the text to indicate the desirable portion of the X axis.

undesirableTextColor

The color for the text to indicate the undesirable portion of the X axis.

dArrowDistance

The distance of the effect size arrow from the top of the distributions.

dLabelDistance

The distance of the effect size label from the top of the distributions.

pdist, qdist

Distributions to use when converting thresholds to event rates and vice versa; defaults to the normal distribution.

##### Details

These functions are used by nnc to show the distributions, and event rates. They probably won't be used much on their own.

##### Value

erDataSeq returns a data sequence; ggNNC a ggplot.

##### References

Gruijters, S. L. K., & Peters, G.-J. Y. (2017). Introducing the Numbers Needed for Change (NNC): A practical measure of effect size for intervention research.

nnc

##### Aliases
• ggNNC
• erDataSeq
• convert.threshold.to.er
• convert.er.to.threshold
##### Examples
# NOT RUN {
### Show distribution for an event rate value of 125
ggNNC(erDataSeq(threshold=125, mean=90, sd=30));

### If the event occurs under the threshold instead of
### above it
ggNNC(erDataSeq(threshold=125, mean=90, sd=30,
eventIfHigher = FALSE));

### ... And for undesirable events (note how
### desirability is an argument for ggNNC, whereas
### whether an event occurs 'above' or 'below' the
### threshold is an argument for erDataSeq):
ggNNC(erDataSeq(threshold=125, mean=90, sd=30,
eventIfHigher = FALSE),
eventDesirable = FALSE);

### Show event rate for both experimental and
### control conditions, and show the numbers
### needed for change
ggNNC(erDataSeq(threshold=125, mean=90, sd=30), d=.5);

### Illustration of how even with very large effect
### sizes, if the control event rate is very high,
### you'll still need a high number of NNC
ggNNC(erDataSeq(er=.9), d=1);

# }

Documentation reproduced from package userfriendlyscience, version 0.6-1, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.


text: dc.contributor.advisor Levander, Alan R. Blanch, Joakim Oscar 2009-06-04T00:04:41Z 2009-06-04T00:04:41Z 1995 Blanch, Joakim Oscar. "Modeling, inversion and imaging of seismic data in viscous media." (1995) Master’s Thesis, Rice University. https://hdl.handle.net/1911/13927. https://hdl.handle.net/1911/13927 Real Earth media is anelastic, which affects both kinematics and dynamics of propagating waves. Waves are attenuated and dispersed. If anelastic effects are neglected, inversion and migration can yield erroneous results. The anelastic effects, on propagating waves, in real rocks can be well described by a viscoelastic model. Hence, viscoelastic wave propagation simulation is a well suited base for a realistic inversion algorithm derived through the adjoint state technique. We have developed a finite-difference simulator to model wave propagation in viscoelastic media. The viscoelastic scheme is only slightly more expensive than analogous elastic schemes. This thesis also presents a method for modeling of constant Q as a function of frequency based on an explicit closed formula for calculation of the parameter fields. The $\tau$-p (intercept time-slowness) domain permits economical modeling and inversion of 3-D wave propagation in layered media. 118 p. application/pdf eng GeophysicsMathematics Modeling, inversion and imaging of seismic data in viscous media Thesis Text Earth Science Natural Sciences Rice University Masters Master of Arts


text:
[This article was first published on Freakonometrics - Tag - R-english, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

This summer, we have been told that some financial series broke some records (here, in French)

For instance, the French CAC40 had negative return for 11 consecutive days (which has never been seen, so far).

> library(tseries)
> x<-get.hist.quote("^FCHI")
> Y=x$Close > Z=diff(log(Y)) > RUN=rle(as.character(Z>=0))$lengths
> n=length(RUN)
> LOSS=RUN[seq(2,n,by=2)]
> GAIN=RUN[seq(1,n,by=2)]
> TG=sort(table(GIN))
> TG[as.character(1:13)]
GAIN
1    2    3    4    5    6    7    8    9 <NA> <NA> <NA>   13
645  336  170   72   63   21    7    3    4   NA   NA   NA    1

> TL=sort(table(LOSS))
> TL[as.character(1:15)]
LOSS
1    2    3    4    5    6    7    8    9 <NA>   11 <NA> <NA>
664  337  186   68   42   14    5    3    1   NA    1   NA   NA

> TR=sort(table(RUN))
> TR[as.character(1:15)]
RUN
1    2    3    4    5    6    7    8    9 <NA>   11 <NA>   13
1309  673  356  140  105   35   12    6    5   NA    1   NA    1
Indeed 11 consecutive days of negative returns is a record. But one should keep in mind the fact that the real records for runs is 13 consecutive days with positive returns…
But what does that mean ? Can we still assume time independence of log-returns (since today, a lot of financial models are still based on that assumption) ?
Actually. if financial series were time-independence, such a probability, indeed, should be rather small. At least on 11 or 10 runs. Something like
(assuming that each day, the probability to observe a negative return is 50%). But maybe not over 25 years (6250 trading days): the probability to observe a sub-sequence of 10 consecutive negative value (with daily probability of one half) over 6250 observations will be much larger. My guess is that is would be
where at the numerator we have the number of favourable cases over the total number of cases. At the numerator, the first number the number of cases where the first 10 (at least) are negative, then for the second one, we count the number of cases where the first is positive, then the next 10 (at least) are negative (and then the second is positive and then the next 10 are negative, the third is positive etc). For those interested by more details (and a more general formula on runs), an answer can be found here.
But note that the probability is quite large… So it is not that unlikely to observe such a sequence over 25 years.
A classical idea when looking at time series is to look at the autocorrelation function of the returns,

which might suggest that there is no correlation with past returns. But it should be possible to do more advanced tests.
On the CAC40 series, we can run an independence run test on the latest 100 consecutive days, and look at the p-value,
> library(lawstat)
> u=as.vector(Z[(n-100):n])
> runs.test(u,plot=TRUE)

Runs Test - Two sided

data:  u
Standardized Runs Statistic = -0.4991, p-value = 0.6177

The B‘s here are returns lower than the median (almost null, so they might be considered as negative returns). With such a high p-value, we accept the null hypothesis, i.e. time independence.
If we consider a moving-time window

we can see that we accept the assumption of independence most the the time.
Actually, here, the time window is 100 days (+/- 50 days). But it is possible to consider 200 days,

or even 400 days,

So, except if we focus on 2006, it looks like we should reject the idea of time dependence in financial markets.
It is also possible to look more carefully at the distribution of runs, and to compare it with the case of independent samples (here we consider monte carlo generation of sequences having the same size),
> m=length(Z)
> ns=100000
> HIST=matrix(NA,ns,15)
> for(j in 1:ns){
+ XX=sample(c("A","B"),size=m,replace=TRUE)
+ RUNX=rle(as.character(XX))\$lengths
+ S=sort(table(RUNX))
+ HIST[j,]=S[as.character(1:15)]
+ }
> meana=function(x){sum(x[is.na(x)==FALSE])/length(x)}
> cbind(TR[as.character(1:15)],apply(HIST,2,meana),
+       round(m/(2^(1+1:15))))

[,1]       [,2] [,3]
1    1309 1305.12304 1305
2     673  652.46513  652
3     356  326.21119  326
4     140  163.05101  163
5     105   81.52366   82
6      35   40.74539   41
7      12   20.38198   20
8       6   10.16383   10
9       5    5.09871    5
10     NA    2.56239    3
11      1    1.26939    1
12     NA    0.63731    1
13      1    0.31815    0
14     NA    0.15812    0
15     NA    0.08013    0
The first column above is the empirical frequency of runs of length 1,2,3, etc. The second one is the average frequencies obtained on random simulation of independent sample. The third one is the theoretical frequency based on a (geometric distribution with mean 1).

Here again, it looks like our time series behave like an independent sample. Here is also a nice paper by Mark Schilling on the longest run of heads.
So it is not that odd to observe such a series of losses on financial markets….

To leave a comment for the author, please follow the link and comment on their blog: Freakonometrics - Tag - R-english.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

# Never miss an update! Subscribe to R-bloggers to receive e-mails with the latest R posts.(You will not see this message again.)

Click here to close (This popup will not appear again)


text:
# Definitions of conditional independence

How are conditional independence defined for various cases?

For one case, given two random variables $X$ and $Y$, and a subsigma algebra $\mathcal G$ of the underlying sigma algebra $\mathcal F$, or another random variable $Z$.

What is the definition of the conditional independence between $X$ and $Y$ given $\mathcal G$ or $Z$?

Is it related to the independence between $E(X\mid \mathcal G)$ and $E(Y \mid \mathcal G)$, and independence between $P(X\in A\mid \mathcal G)$ and $P(Y\in A\mid \mathcal G)$, for any $A \in \mathcal F$? I am trying to see if there is some relation between conditional independence and independence?

Thanks and regards!

-

The random variables $X$ and $Y$ are independent conditionally on $\mathcal G$ if and only if, for every measurable $A$ and $B$, one has $\mathbb P((X,Y)\in A\times B\mid\mathcal G)=\mathbb P(X\in A\mid\mathcal G)\cdot\mathbb P(Y\in B\mid\mathcal G)$ almost surely.
Some random variables are independent conditionally on the random variable $Z$ if and only if they are independent conditionally on $\sigma(Z)$.
Thanks! Is it related to the independence between $E(X\mid \mathcal G)$ and $E(Y \mid \mathcal G)$, and the independence between $P(X\in A\mid \mathcal G)$ and $P(Y\in B\mid \mathcal G)$, for any $A, B \in \mathcal F$? –  Tim Mar 3 '13 at 18:13
By "almost surely" do you mean relative to $\mathcal{G}$ or to the underlying $\sigma$-algebra? –  Evan Aad Mar 10 '13 at 20:31
Almost surely refers to $\mathbb P$, hence to the underlying sigma-algebra $\mathcal F$. In the present case however, since the LHS and the RHS are both $\mathcal G$-measurable, they coincide except on a null event in $\mathcal F$ if and only if they coincide except on a null event in $\mathcal G$. –  Did Mar 10 '13 at 21:28


text:
Refraction Of Light Video Lessons

Concept

# Problem: Problem 8: A flat slab of material (nm =  2.1) is d = 0.35 m thick. A beam of light in air (na = 1) is incident on the material with an angle θa = 55° with respect to the surface's normal. Part (a) Numerically, what is the displacement, D, of the beam when it exits the slab?

###### FREE Expert Solution

The displacement of the beam is expressed as:

$\overline{){\mathbf{D}}{\mathbf{=}}{\mathbf{h}}{\mathbf{s}}{\mathbf{i}}{\mathbf{n}}{\mathbf{\alpha }}}$

100% (30 ratings)
###### Problem Details

Problem 8: A flat slab of material (nm =  2.1) is d = 0.35 m thick. A beam of light in air (na = 1) is incident on the material with an angle θa = 55° with respect to the surface's normal.

Part (a) Numerically, what is the displacement, D, of the beam when it exits the slab?


text:
1. Groups - Quotient groups

Let G be a group, A be a group of all elements in G that have a finite order.

Prove that the quotient group G/A contains no elements of finite order.

Hmmm... If I assume that there is a gA in G/A for which there exists a natural n so that |gA|=n , then I get that : gA+...gA=gA (n times)

How do I continue ? Am I doing this right?

Thanks!

Let G be a group, A be a group of all elements in G that have a finite order.

Prove that the quotient group G/A contains no elements of finite order.

Hmmm... If I assume that there is a gA in G/A for which there exists a natural n so that |gA|=n , then I get that : gA+...gA=gA (n times)

How do I continue ? Am I doing this right?

Thanks!
If $n(gA)=0A$ (i.e. $gA$ has order $n$) then this means that $ng \in A$ (why?). The contradiction now follows.

(To write it in non-abelian notation, 'If $(gH)^n=1H$ (i.e. $gA$ has order $n$) then this means that $g^n \in H$')

3. I see... although I don't really understand why ng is in A - is it because : (ng)A=(e)A=A, or is it because A is the neutral in G/A

It's a little complicated... Literally, Abstract Algebra...

I see... although I don't really understand why ng is in A - is it because : (ng)A=(e)A=A, or is it because A is the neutral in G/A

It's a little complicated... Literally, Abstract Algebra...
The identity element of $G/A$ is $eA$ or $0+A$, a coset. This coset corresponds precisely to the subgroup $A$ (the elements are the same).

Now, if $g+A$ has finite order then there exists an $n$ such that $n(g+A) = ng+A = 0+A$. Thus, $(ng)-0 \in A \Rightarrow ng \in A$.

(The bit where you go  $(ng)-0 \in A$' holds because $a+A = b+A \Leftrightarrow a-b \in A$)

In multiplicative notation, if $gH$ has finite order then there exists an $n$ such that $(gH)^n = (g^n)H = 1H$. Thus, $g^n1^{-1} \in H \Rightarrow g^n \in H$.

(The bit where you go  $g^n1^{-1} \in H$' holds because $gH = hH \Leftrightarrow gh^{-1} \in H$)

5. I see... Thank you

So the contradiction is a consequence of the idea that ng is in A?

I mean, if ng is in A, then there exists an m for which (ng)^m=1, means that mng=1, but I don't see the contradiction here :O

I see... Thank you

So the contradiction is a consequence of the idea that ng is in A?

I mean, if ng is in A, then there exists an m for which (ng)^m=1, means that mng=1, but I don't see the contradiction here :O
What has just been proven is that if $g+A$ has finite order then $g \in A$. Therefore, $g+A=0+A$. Apply this to what you are trying to prove.

7. Hmmm.. I still can't see the contradiction. Besides, how did you get to g+A, while we were discussing gn+A?

Hmmm.. I still can't see the contradiction. Besides, how did you get to g+A, while we were discussing gn+A?
If $g+A$ has finite order, $n$, then $gn \in A$ and so $gn$ has finite order (by the definition of $A$) and so there exists an $m$ such that $g(mn)=0$. Thus, $g$ has order $mn$, which is finite. Therefore, $g \in A$ by the definition of $A$...and so $g+A=0+A$.

9. I guess I'm a having some trouble figuring this out :P
I understand why what you've just said is correct, except that I don't understand why g+A=0+A, or how this leads to a contradiction.

I guess I'm a having some trouble figuring this out :P
I understand why what you've just said is correct, except that I don't understand why g+A=0+A, or how this leads to a contradiction.

g+A=0+A as g is contained in A. It is contained in A because g must have finite order, and A is the group of all elements of finite order.

11. Originally Posted by Swlabr
g+A=0+A as g is contained in A. It is contained in A because g must have finite order, and A is the group of all elements of finite order.
Fine. Then everything is perfect. Where is the contradiction ?

Fine. Then everything is perfect. Where is the contradiction ?
Emm...I was assuming $g+A \neq 0+A$, but I suppose you don't have to.

Let G be a group, A be a group of all elements in G that have a finite order.

Prove that the quotient group G/A contains no elements of finite order.

Hmmm... If I assume that there is a gA in G/A for which there exists a natural n so that |gA|=n , then I get that : gA+...gA=gA (n times)

How do I continue ? Am I doing this right?

Thanks!
I'd just like to remark that the set of all elements of $G$ which have finite order is not in general a subgroup of $G$; for example, take the free product of two finite groups.

In an abelian group, however, it is always a subgroup.

14. It's a little awkward, but I still don't understand it

Bruno, what do you mean by the free product of two finite groups? AxB or AB?

15. What do you not understand? Bruno's comment, or the proof?

Let S be the set of all elements of finite order in a group. Then it is possible to multiply two elements together to get an element of infinite order (for example, you can find 2x2 matrices which are of finite order multiplicatively, but when multiplied together they will form a matrix of infinite multiplicative order). This means that S is not necessarily a subgroup of your group. However, if S is a group, it will be normal, as conjugation preserves the order of an element (if $g^n=1$ then $(h^{-1}gh)^n = h^{-1}g^nh=1$).

He also pointed out that in an abelian group, this set S will always be a group, as $n(a+b)=1$ where $n= o(a)\cdoto(b)$.

Do not worry about what a free-product is. You will learn that with time.