text:
# Salsa20

Short description: Stream ciphers
General The Salsa quarter-round function. Four parallel copies make a round. Daniel J. Bernstein 2007 (designed 2005)[1] ChaCha Rumba20 eSTREAM portfolio 128 or 256 bits 512 bits ARX 20 3.91 cpb on an Intel Core 2 Duo[2] 2008 cryptanalysis breaks 8 out of 20 rounds to recover the 256-bit secret key in 2251 operations, using 231 keystream pairs.[3]

Salsa20 and the closely related ChaCha are stream ciphers developed by Daniel J. Bernstein. Salsa20, the original cipher, was designed in 2005, then later submitted to the eSTREAM European Union cryptographic validation process by Bernstein. ChaCha is a modification of Salsa20 published in 2008. It uses a new round function that increases diffusion and increases performance on some architectures.[4]

Both ciphers are built on a pseudorandom function based on add-rotate-XOR (ARX) operations — 32-bit addition, bitwise addition (XOR) and rotation operations. The core function maps a 256-bit key, a 64-bit nonce, and a 64-bit counter to a 512-bit block of the key stream (a Salsa version with a 128-bit key also exists). This gives Salsa20 and ChaCha the unusual advantage that the user can efficiently seek to any position in the key stream in constant time. Salsa20 offers speeds of around 4–14 cycles per byte in software on modern x86 processors,[5] and reasonable hardware performance. It is not patented, and Bernstein has written several public domain implementations optimized for common architectures.[6]

## Structure

Internally, the cipher uses bitwise addition ⊕ (exclusive OR), 32-bit addition mod 232 ⊞, and constant-distance rotation operations <<< on an internal state of sixteen 32-bit words. Using only add-rotate-xor operations avoids the possibility of timing attacks in software implementations. The internal state is made of sixteen 32-bit words arranged as a 4×4 matrix.

 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

The initial state is made up of      eight words of key,      two words of stream position,      two words of nonce (essentially additional stream position bits), and      four fixed words:

 "expa" Key Key Key Key "nd 3" Nonce Nonce Pos. Pos. "2-by" Key Key Key Key "te k"

The constant words spell "expand 32-byte k" in ASCII (i.e. the 4 words are "expa", "nd 3", "2-by", and "te k"). This is an example of a nothing-up-my-sleeve number. The core operation in Salsa20 is the quarter-round QR(a, b, c, d) that takes a four-word input and produces a four-word output:

b ^= (a + d) <<< 7;
c ^= (b + a) <<< 9;
d ^= (c + b) <<< 13;
a ^= (d + c) <<< 18;

Odd-numbered rounds apply QR(a, b, c, d) to each of the four columns in the 4×4 matrix, and even-numbered rounds apply it to each of the four rows. Two consecutive rounds (column-round and row-round) together are called a double-round:

// Odd round
QR( 0,  4,  8, 12)	// column 1
QR( 5,  9, 13,  1)	// column 2
QR(10, 14,  2,  6)	// column 3
QR(15,  3,  7, 11)	// column 4
// Even round
QR( 0,  1,  2,  3)	// row 1
QR( 5,  6,  7,  4)	// row 2
QR(10, 11,  8,  9)	// row 3
QR(15, 12, 13, 14)	// row 4

An implementation in C/C++ appears below.

#include <stdint.h>
#define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b))))
#define QR(a, b, c, d)(		\
b ^= ROTL(a + d, 7),	\
c ^= ROTL(b + a, 9),	\
d ^= ROTL(c + b,13),	\
a ^= ROTL(d + c,18))
#define ROUNDS 20

void salsa20_block(uint32_t out[16], uint32_t const in[16])
{
int i;
uint32_t x[16];

for (i = 0; i < 16; ++i)
x[i] = in[i];
// 10 loops × 2 rounds/loop = 20 rounds
for (i = 0; i < ROUNDS; i += 2) {
// Odd round
QR(x[ 0], x[ 4], x[ 8], x[12]);	// column 1
QR(x[ 5], x[ 9], x[13], x[ 1]);	// column 2
QR(x[10], x[14], x[ 2], x[ 6]);	// column 3
QR(x[15], x[ 3], x[ 7], x[11]);	// column 4
// Even round
QR(x[ 0], x[ 1], x[ 2], x[ 3]);	// row 1
QR(x[ 5], x[ 6], x[ 7], x[ 4]);	// row 2
QR(x[10], x[11], x[ 8], x[ 9]);	// row 3
QR(x[15], x[12], x[13], x[14]);	// row 4
}
for (i = 0; i < 16; ++i)
out[i] = x[i] + in[i];
}

In the last line, the mixed array is added, word by word, to the original array to obtain its 64-byte key stream block. This is important because the mixing rounds on their own are invertible. In other words, applying the reverse operations would produce the original 4×4 matrix, including the key. Adding the mixed array to the original makes it impossible to recover the input. (This same technique is widely used in hash functions from MD4 through SHA-2.)

Salsa20 performs 20 rounds of mixing on its input.[1] However, reduced round variants Salsa20/8 and Salsa20/12 using 8 and 12 rounds respectively have also been introduced. These variants were introduced to complement the original Salsa20, not to replace it, and perform even better[note 1] in the eSTREAM benchmarks than Salsa20, though with a correspondingly lower security margin.

### XSalsa20 with 192-bit nonce

In 2008, Bernstein proposed a variant of Salsa20 with 192-bit nonces called XSalsa20.[7][8][9] XSalsa20 is provably secure if Salsa20 is secure, but is more suitable for applications where longer nonces are desired. XSalsa20 feeds the key and the first 128 bits of the nonce into one block of Salsa20 (without the final addition, which may either be omitted, or subtracted after a standard Salsa20 block), and uses 256 bits of the output as the key for standard Salsa20 using the last 64 bits of the nonce and the stream position. Specifically, the 256 bits of output used are those corresponding to the non-secret portions of the input: indexes 0, 5, 10, 15, 6, 7, 8 and 9.

## eSTREAM selection of Salsa20

Salsa20 has been selected as a Phase 3 design for Profile 1 (software) by the eSTREAM project, receiving the highest weighted voting score of any Profile 1 algorithm at the end of Phase 2.[10] Salsa20 had previously been selected as Phase 2 Focus design for Profile 1 (software) and as a Phase 2 design for Profile 2 (hardware) by the eSTREAM project,[11] but was not advanced to Phase 3 for Profile 2 because eSTREAM felt that it was probably not a good candidate for extremely resource constrained hardware environments.[12]

## Cryptanalysis of Salsa20

(As of 2015), there are no published attacks on Salsa20/12 or the full Salsa20/20; the best attack known[3] breaks 8 of the 12 or 20 rounds.

In 2005, Paul Crowley reported an attack on Salsa20/5 with an estimated time complexity of 2165, and won Bernstein's US\$1000 prize for "most interesting Salsa20 cryptanalysis".[13] This attack, and all subsequent attacks are based on truncated differential cryptanalysis. In 2006, Fischer, Meier, Berbain, Biasse, and Robshaw reported an attack on Salsa20/6 with estimated time complexity of 2177, and a related-key attack on Salsa20/7 with estimated time complexity of 2217.[14]

In 2007, Tsunoo et al. announced a cryptanalysis of Salsa20 which breaks 8 out of 20 rounds to recover the 256-bit secret key in 2255 operations, using 211.37 keystream pairs.[15] However, this attack does not seem to be competitive with the brute force attack.

In 2008, Aumasson, Fischer, Khazaei, Meier, and Rechberger reported a cryptanalytic attack against Salsa20/7 with a time complexity of 2153, and they reported the first attack against Salsa20/8 with an estimated time complexity of 2251. This attack makes use of the new concept of probabilistic neutral key bits for probabilistic detection of a truncated differential. The attack can be adapted to break Salsa20/7 with a 128-bit key.[3]

In 2012, the attack by Aumasson et al. was improved by Shi et al. against Salsa20/7 (128-bit key) to a time complexity of 2109 and Salsa20/8 (256-bit key) to 2250.[16]

In 2013, Mouha and Preneel published a proof[17] that 15 rounds of Salsa20 was 128-bit secure against differential cryptanalysis. (Specifically, it has no differential characteristic with higher probability than 2−130, so differential cryptanalysis would be more difficult than 128-bit key exhaustion.)

## ChaCha variant

General The ChaCha quarter-round function. Four parallel copies make a round. Daniel J. Bernstein 2008 Salsa20 Rumba20 128 or 256 bits 512 bits ARX 20 3.95 cpb on an Intel Core 2 Duo[4]:2

In 2008, Bernstein published the closely related ChaCha family of ciphers, which aim to increase the diffusion per round while achieving the same or slightly better performance.[18] The Aumasson et al. paper also attacks ChaCha, achieving one round fewer: for 256 bits ChaCha6 with complexity 2139 and ChaCha7 with complexity 2248. 128 bits ChaCha6 within 2107, but claims that the attack fails to break 128 bits ChaCha7.[3]

Like Salsa20, ChaCha's initial state includes a 128-bit constant, a 256-bit key, a 64-bit counter, and a 64-bit nonce (in the original version; as described later, a version of ChaCha from RFC 7539 is slightly different), arranged as a 4×4 matrix of 32-bit words.[18] But ChaCha re-arranges some of the words in the initial state:

 "expa" "nd 3" "2-by" "te k" Key Key Key Key Key Key Key Key Counter Counter Nonce Nonce

The constant is the same as Salsa20 ("expand 32-byte k"). ChaCha replaces the Salsa20 quarter-round QR(a, b, c, d) with

a += b; d ^= a; d <<<= 16;
c += d; b ^= c; b <<<= 12;
a += b; d ^= a; d <<<= 8;
c += d; b ^= c; b <<<= 7;

Notice that this version updates each word twice, while Salsa20's quarter round updates each word only once. In addition, the ChaCha quarter-round diffuses changes more quickly. On average, after changing 1 input bit the Salsa20 quarter-round will change 8 output bits while ChaCha will change 12.5 output bits.[4]

The ChaCha quarter round has the same number of adds, xors, and bit rotates as the Salsa20 quarter-round, but the fact that two of the rotates are multiples of 8 allows for a small optimization on some architectures including x86.[19] Additionally, the input formatting has been rearranged to support an efficient SSE implementation optimization discovered for Salsa20. Rather than alternating rounds down columns and across rows, they are performed down columns and along diagonals.[4]:4 Like Salsa20, ChaCha arranges the sixteen 32-bit words in a 4×4 matrix. If we index the matrix elements from 0 to 15

 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15

Then a double round in ChaCha is:

// Odd round
QR(0, 4,  8, 12)	// 1st column
QR(1, 5,  9, 13)	// 2nd column
QR(2, 6, 10, 14)	// 3rd column
QR(3, 7, 11, 15)	// 4th column
// Even round
QR(0, 5, 10, 15)	// diagonal 1 (main diagonal)
QR(1, 6, 11, 12)	// diagonal 2
QR(2, 7,  8, 13)	// diagonal 3
QR(3, 4,  9, 14)	// diagonal 4

ChaCha20 uses 10 iterations of the double round.[20] An implementation in C/C++ appears below.

#define ROTL(a,b) (((a) << (b)) | ((a) >> (32 - (b))))
#define QR(a, b, c, d) (			\
a += b,  d ^= a,  d = ROTL(d,16),	\
c += d,  b ^= c,  b = ROTL(b,12),	\
a += b,  d ^= a,  d = ROTL(d, 8),	\
c += d,  b ^= c,  b = ROTL(b, 7))
#define ROUNDS 20

void chacha_block(uint32_t out[16], uint32_t const in[16])
{
int i;
uint32_t x[16];

for (i = 0; i < 16; ++i)
x[i] = in[i];
// 10 loops × 2 rounds/loop = 20 rounds
for (i = 0; i < ROUNDS; i += 2) {
// Odd round
QR(x[0], x[4], x[ 8], x[12]); // column 0
QR(x[1], x[5], x[ 9], x[13]); // column 1
QR(x[2], x[6], x[10], x[14]); // column 2
QR(x[3], x[7], x[11], x[15]); // column 3
// Even round
QR(x[0], x[5], x[10], x[15]); // diagonal 1 (main diagonal)
QR(x[1], x[6], x[11], x[12]); // diagonal 2
QR(x[2], x[7], x[ 8], x[13]); // diagonal 3
QR(x[3], x[4], x[ 9], x[14]); // diagonal 4
}
for (i = 0; i < 16; ++i)
out[i] = x[i] + in[i];
}

ChaCha is the basis of the BLAKE hash function, a finalist in the NIST hash function competition, and its faster successors BLAKE2 and BLAKE3. It also defines a variant using sixteen 64-bit words (1024 bits of state), with correspondingly adjusted rotation constants.

### XChaCha

Although not announced by Bernstein, the security proof of XSalsa20 extends straightforwardly to an analogous XChaCha cipher. Use the key and the first 128 bits of the nonce (in input words 12 through 15) to form a ChaCha input block, then perform the block operation (omitting the final addition). Output words 0–3 and 12–15 (those words corresponding to non-key words of the input) then form the key used for ordinary ChaCha (with the last 64 bits of nonce and 64 bits of block counter).[21]

Google had selected ChaCha20 along with Bernstein's Poly1305 message authentication code in SPDY, which was intended as a replacement for TLS over TCP.[22] In the process, they proposed a new authenticated encryption construction combining both algorithms, which is called ChaCha20-Poly1305. ChaCha20 and Poly1305 are now used in the QUIC-protocol, which replaces SPDY and is used by HTTP/3.[23][24]

Shortly after Google's adoption for TLS, both the ChaCha20 and Poly1305 algorithms were also used for a new chacha20-poly1305@openssh.com cipher in OpenSSH.[25][26] Subsequently, this made it possible for OpenSSH to avoid any dependency on OpenSSL, via a compile-time option.[27]

ChaCha20 is also used for the arc4random random number generator in FreeBSD,[28] OpenBSD,[29] and NetBSD[30] operating systems, instead of the broken RC4, and in DragonFly BSD[31] for the CSPRNG subroutine of the kernel.[32][33] Starting from version 4.8, the Linux kernel uses the ChaCha20 algorithm to generate data for the nonblocking /dev/urandom device.[34][35][36]

An implementation reference for ChaCha20 has been published in RFC 7539. The IETF's implementation modified Bernstein's published algorithm by changing 64-bit nonce and 64-bit block counter to 96-bit nonce and 32-bit block counter,[37] The name was not changed when the algorithm was modified, as it is cryptographically insignificant (both form what a cryptographer would recognize as a 128-bit nonce), but the interface change could be a source of confusion for developers. Because of the reduced block counter, the maximum message length that can be safely encrypted by the IETF's variant is 232 blocks of 64 bytes (256 GiB). For applications where this is not enough, such as file or disk encryption, RFC 7539 proposes using the original algorithm with 64-bit nonce.

Use of ChaCha20 in IKE and IPsec have been proposed for standardization in RFC 7634. Proposed standardization of its use in TLS is published as RFC 7905.

ChaCha20 usually offers better performance than the more prevalent Advanced Encryption Standard (AES) algorithm on systems where the CPU does not feature AES acceleration (such as the AES instruction set for x86 processors). As a result, ChaCha20 is sometimes preferred over AES in certain use cases involving mobile devices, which mostly use ARM-based CPUs.[38][39]

In 2018, RFC 7539 was obsoleted by RFC 8439.[40]

ChaCha20 is the exclusive algorithm used by the WireGuard VPN system, as of protocol version 1.[41]

• Speck – an add-rotate-xor cipher developed by the NSA
• ChaCha20-Poly1305 – an AEAD scheme combining ChaCha20 with the Poly1305 MAC

## Notes

1. Since the majority of the work consists of performing the repeated rounds, the number of rounds is inversely proportional to the performance. That is, halving the number of rounds roughly doubles the performance. Reduced-round variants are thus appreciably faster.

## References

1. Daniel J. Bernstein (2007-12-24). The Salsa20 family of stream ciphers.
2. Daniel J. Bernstein (2013-05-16). "Salsa 20 speed; Salsa20 software".
3. Jean-Philippe Aumasson, Simon Fischer, Shahram Khazaei, Willi Meier, and Christian Rechberger (2008-03-14). New Features of Latin Dances.
4. Bernstein, Daniel (28 January 2008), ChaCha, a variant of Salsa20, retrieved 2018-06-03
5. Daniel J. Bernstein (2013-05-16). "Snuffle 2005: the Salsa20 encryption function".
6. "Salsa20: Software speed". 2007-05-11.
7. Daniel J. Bernstein. "Extending the Salsa20 nonce (updated in 2011)".
8. Daniel J. Bernstein. "Extending the Salsa20 nonce (original version)".
9. "The eSTREAM Project: End of Phase 2". eSTREAM. 2008-04-29.
10. Hongjun Wu (2007-03-30). "eSTREAM PHASE 3: End of Phase 1". eSTREAM.
11. Paul Crowley (2006-02-09). "Truncated differential cryptanalysis of five rounds of Salsa20".
12. Simon Fischer, Willi Meier, Côme Berbain, Jean-François Biasse , M. J. B. Robshaw (2006). "Non-randomness in eSTREAM Candidates Salsa20 and TSC-4". Progress in Cryptology - INDOCRYPT 2006. Lecture Notes in Computer Science. 4329. 2–16. doi:10.1007/11941378_2. ISBN 978-3-540-49767-7.
13. Yukiyasu Tsunoo, Teruo Saito, Hiroyasu Kubo, Tomoyasu Suzaki and Hiroki Nakashima (2007-01-02). Differential Cryptanalysis of Salsa20/8.
14. Zhenqing Shi, Bin Zhang, Dengguo Feng, Wenling Wu (2012). "Improved Key Recovery Attacks on Reduced-Round Salsa20 and ChaCha". Information Security and Cryptology – ICISC 2012. Lecture Notes in Computer Science. 7839. 337–351. doi:10.1007/978-3-642-37682-5_24. ISBN 978-3-642-37681-8.
15. Nicky Mouha; Bart Preneel (2013). Towards Finding Optimal Differential Characteristics for ARX: Application to Salsa20.
16. Daniel J. Bernstein (2008-04-25). "The ChaCha family of stream ciphers".
17. Neves, Samuel (2009-10-07), Faster ChaCha implementations for Intel processors, retrieved 2016-09-07, "two of these constants are multiples of 8; this allows for a 1 instruction rotation in Core2 and later Intel CPUs using the pshufb instruction"
18. Y. Nir (Check Point), A. Langley (Google Inc.) (May 2015). ChaCha20 and Poly1305 for IETF Protocols: RFC 7539.
19. Arciszewski, Scott (10 January 2020) (in en). XChaCha: eXtended-nonce ChaCha and AEAD_XChaCha20_Poly1305.
20. Thomson, Martin; Turner, Sean (May 2021) (in en). RFC 9001. Retrieved 2021-07-13.
21. Bishop, Mike (2 February 2021) (in en). draft: IETF QUIC HTTP. Retrieved 2021-07-13.
22. Miller, Damien (2016-05-03). "ssh/PROTOCOL.chacha20poly1305".
23. Murenin, Constantine A. (2013-12-11). "OpenSSH Has a New Cipher — Chacha20-poly1305 — from D.J. Bernstein". in Unknown Lamer. Slashdot.
24. Murenin, Constantine A. (2014-04-30). "OpenSSH No Longer Has To Depend On OpenSSL". in Soulskill. Slashdot.
25. "Revision 317015". 2017-04-16. "Replace the RC4 algorithm for generating in-kernel secure random numbers with Chacha20"
26. guenther (Philip Guenther), ed (2015-09-13). "libc/crypt/arc4random.c". "ChaCha based random number generator for OpenBSD."
27. riastradh (Taylor Campbell), ed (2016-03-25). "libc/gen/arc4random.c". "Legacy arc4random(3) API from OpenBSD reimplemented using the ChaCha20 PRF, with per-thread state."
28. "kern/subr_csprng.c". 2015-11-04. "chacha_encrypt_bytes"
29. "arc4random(3)". NetBSD Manual Pages. 2014-11-16.
30. Corbet, Jonathan. "Replacing /dev/urandom".
31. "Merge tag 'random_for_linus' of git.kernel.org/pub/scm/linux/kernel/git/tytso/random". "random: replace non-blocking pool with a Chacha20-based CRNG"
32. Michael Larabel (2016-07-25). "/dev/random Seeing Improvements For Linux 4.8". Phoronix.
33. "ChaCha20 and Poly1305 for IETF protocols". "Changes from regular ChaCha. The nonce: block sequence number split was changed from 64:64 to 96:32"


text:
Partial Derivatives

theleftside

Hey,

Little confused by something:

if we have u=x+y and v=xy what is the partial derivative w.r.t. u of

y^2=uy-v

I am told it is 2y (dy/du) = u (dy/du) + y

And I can see where these terms come from. What I don't understand is why there is no (dv/du) term, as v and u aren't independent.

Any ideas?

ehild

Homework Helper
The variables x and y have been exchanged with u and v:They are the independent variables, and y is a function of them, y(u,v).
Any function f(u,v) have partial derivatives with respect to u and with respect to v, but the derivatives of u or v with respect to each other is zero.

Sashwat Tanay

Definition: A function f is said to be a function of the independent variables (a, b, c) if specifying a, b, c fully determines f (but not overdetermine: i.e. specification of all the three a, b, c are necessary for the determination of f; non-specification of any one of the a, b, c will leave f undetermined). This is our so called 'CONSTRUCTION'. Also, a, b, c are said to be independent variables.

Now, take y^2 be z. Then z=z(u, v, y) - as per the definition above, and all three, i.e. u, v, y are independent (as per above). Don't go by 'u=x+y and v=xy' to conclude that u and v aren't independent.

Also, I don't think it's correct to write y=y(u,v), since specification of u, v doesn't fully determine y (it's a quadratic equation-hence two roots)
and y is a function of them, y(u,v).
But, y^2=y^2(u, v, y) is correct, since y^2 is fully determined by u, v and y.

ehild

Homework Helper
Definition: A function f is said to be a function of the independent variables (a, b, c) if specifying a, b, c fully determines f (but not overdetermine: i.e. specification of all the three a, b, c are necessary for the determination of f; non-specification of any one of the a, b, c will leave f undetermined). This is our so called 'CONSTRUCTION'. Also, a, b, c are said to be independent variables.

Now, take y^2 be z. Then z=z(u, v, y) - as per the definition above, and all three, i.e. u, v, y are independent (as per above). Don't go by 'u=x+y and v=xy' to conclude that u and v aren't independent.

Also, I don't think it's correct to write y=y(u,v), since specification of u, v doesn't fully determine y (it's a quadratic equation-hence two roots)

But, y^2=y^2(u, v, y) is correct, since y^2 is fully determined by u, v and y.
is it not overdetermined????

Sashwat Tanay

I see. True.
By the way, can we even legitimately talk of partial derivative of y^2=uy-v wrt u? Before doing that, we I think we should decide our independent variables on which y^2 depends.
Also, in
I am told it is 2y (dy/du) = u (dy/du) + y
'dy/du' indicates a total derivative, so y should be fully determined by u. But we see, it's not.

format: plain


text:
$\Delta G^{\circ} = -nFE_{cell}^{\circ}$

dtolentino1E
Posts: 101
Joined: Thu Jul 11, 2019 12:17 am

when we combine half-redox rxn like in Hess's law, why can't we also add together the E as if it was delta H?

Kimberly Koo 2I
Posts: 99
Joined: Sat Aug 17, 2019 12:17 am

This is because delta H is a state function while E is not. So delta H doesn't depend on anything but the initial and final state, which is why we can use Hess's law.

VPatankar_2L
Posts: 104
Joined: Thu Jul 25, 2019 12:17 am
Been upvoted: 1 time

Also, unlike in Hess' law where you could multiply the enthalpy values by the same coefficient that you multiplied the entire reaction by, you can't use the same strategy with cell potential. Standard reduction potential gives the voltage difference between two standard electrodes which is always the same. E* is an intensive property so it does not depend on the number of times the reaction occurs.

Lauren Tanaka 1A
Posts: 109
Joined: Sat Aug 17, 2019 12:18 am

Since E is not a state function you can't apply the same concepts that we used in Hess's Law. E is an intensive property too so no matter how many times the reaction occurs the E will not change.

rabiasumar2E
Posts: 108
Joined: Thu Jul 11, 2019 12:15 am


text:
# How to draw areas between curves of the form $x=f(y)$ and $x=g(y)$?

I want to shade the region between two curves whose equations are of the form $x=f(y)$ and $x=g(y)$, where $f(y)\leq g(y)$ for all $y\in [c,d]$. I heard that pgfplots can be used. Also, the fillbetween library doesn't load in my Mac. Can you help me with this, guys? I want something like this one:

I used GeoGebra to generate the image. Thanks a lot!

• pgfplots has fillbetween facility! – user11232 Jul 17 '14 at 9:44
• Hi. But the fillbetween library doesn't seem to load. I always receive an error message. I also think that it can be used only for shading areas between curves of the form $y=f(x)$ and $y=g(x)$. Thanks for replying quick! – John Patrick Sta Maria Jul 17 '14 at 9:45
• Have you tried any code? If so, can you please add it to the question? It will be helpful for those who try to help you. :) – user11232 Jul 17 '14 at 9:47
• Take a look at tex.stackexchange.com/a/163654/1952 and read feellbetween library section of pgfplots documentation. – Ignasi Jul 17 '14 at 10:22
• Why don't you just use the nice graph you have created with GeoGebra? – Thruston Jul 17 '14 at 20:47

Here is a suggestion using the fillbetween library and soft clip to domain y:

\addplot[thick,name path=P] ({.5*(x-2)^2+.5},{x})node[pos=0.92,above]{x=f(y)};
\addplot[red!80!black!40] fill between [of=P and Q, soft clip={domain y=\C:\D},reverse=true];

Code:

\documentclass[margin=5mm]{standalone}

\usepackage{lmodern}
\usepackage{pgfplots}
\pgfplotsset{compat=1.10}% version 1.10 of pgfplots is needed
\usepgfplotslibrary{fillbetween}

\newcommand\C{}
\newcommand\D{}

\begin{document}
\begin{tikzpicture}
\begin{axis}[
xmin=-.5,xmax=3,
axis lines*=middle,
xtick=\empty,
ytick=\empty,
height=10cm,
samples=200,
]
\def\C{1}
\def\D{3}
\addplot[red!80!black!40] fill between [of=P and Q, soft clip={domain y=\C:\D},reverse=true];
\draw({rel axis cs:0,0}|-{axis cs:0,\C})--({rel axis cs:1,1}|-{axis cs:0,\C});
\draw({rel axis cs:0,0}|-{axis cs:0,\D})--({rel axis cs:1,1}|-{axis cs:0,\D});
\node[above left]at(axis cs:0,\C){c};
\node[above left]at(axis cs:0,\D){d};
\node at (axis cs:1.25,2){R};
\end{axis}
\end{tikzpicture}
\end{document}

• Thank you for your comments! They are overwhelming. In particular, I tried compiling this code in my Mac using TeXshop but I got a lot of error messages and there was no even a single output generated. – John Patrick Sta Maria Jul 20 '14 at 6:34
• Which version of pgfplots do you have? At least Version 1.10 is needed to run the code above. That's why I added \pgfplotsset{compat=1.10}. – esdd Jul 20 '14 at 10:37
• Would you know how to update the pgfplots package? I don't know where to see the current version number. I think the fillbetween library isn't loading. Thanks! – John Patrick Sta Maria Jul 20 '14 at 10:59
• You can find the number of your version in the log file. If you add \listfiles to the preamble of your document a compact list of all loaded files ist printed at the end of the log file. Use the package manager of your TeX distribution to update the package. Version 1.10 of pgfplots is also available on CTAN. – esdd Jul 20 '14 at 15:00
• @JohnPatrickStaMaria Or put \pgfplotsversion in the body of your document somewhere. – percusse Jul 20 '14 at 15:36

Here's something to get you started, which uses the fillbetween library mentioned in the comments:

% arara: pdflatex
% !arara: indent: {overwrite: yes, localSettings: yes}
\documentclass{standalone}

% graphs
\usepackage{pgfplots}
\usepgfplotslibrary{fillbetween}

% arrow style
\tikzset{>=stealth}

\begin{document}

% $x = y^2-4y$, $x = 2y-y^2$

\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
axis line style={<->},
xmin=-5,xmax=5,
ymin=-4,ymax=8,
xtick={-4,-2,...,2,4},
ytick={-2,2,4,6},
minor xtick={-3,-1,...,3},
minor ytick={-3,-1,...,7},
grid=both,
samples=100,
]
\addplot[domain=-1:5,samples=50]({x^2-4*x},{x}) node[pos=.85,anchor=south] {$x=f(y)$};
\addplot[domain=-1.4:3.4,samples=50,ultra thick] ({2*x-x^2},{x}) node[pos=.1,anchor=north] {$x=g(y)$};
\end{axis}
\end{tikzpicture}

\end{document}

You'll see that I had to plot each curve twice - once for the shaded area, and once for the parts of the curves that go beyond the shaded area. You can certainly try plotting each curve just once, but the fill between part struggles (perhaps a guru has an improvement).

Here's another version that doesn't use the fillbetween library - very much the same idea, but perhaps not quite as nice with the result.

% arara: pdflatex
% !arara: indent: {overwrite: yes, localSettings: yes}
\documentclass{standalone}

% graphs
\usepackage{pgfplots}

% arrow style
\tikzset{>=stealth}

\begin{document}

% $x = y^2-4y$, $x = 2y-y^2$

\begin{tikzpicture}
\begin{axis}[
axis x line=middle,
axis y line=middle,
xlabel={$x$},
ylabel={$y$},
axis line style={<->},
xmin=-5,xmax=5,
ymin=-4,ymax=8,
xtick={-4,-2,...,2,4},
ytick={-2,2,4,6},
minor xtick={-3,-1,...,3},
minor ytick={-3,-1,...,7},
grid=both,
samples=100,
axis on top,
]


text:
# Chemistry Calculation Dilutions of Acid

I was presented with the following problem in my lecture and I am confused as to what to do.

You are required to prepare $\pu{250 cm3}$ of $\pu{0.100 mol dm-3}$ HCl by diluting $\pu{0.600 mol dm-3}$ HCl with water.

Calculate the volume of $\pu{0.600 mol dm-3}$ HCl that must be diluted with water.

This was my attempt.

Moles of the $\pu{250 cm3}$ of $\pu{0.100 mol dm-3}$ HCl (target acid)

= $\frac{250}{1000} \times 0.100 = 0.0250$ moles.

Hence

$\frac{\pu{mol}}{\mathrm{conc}} = \mathrm{vol}_{\pu{cm3}} = \frac{0.0250}{0.600} \times 1000 = 41.66... \approx \pu{42.00 cm3}$

I'm not sure if the second step is right.

If I am right (hopefully) can someone please explain why.

Many thanks.


text:
### Answer the following. Which precautions are necessary for proper decomposition of domestic waste?

Question 22.

Which precautions are necessary for proper decomposition of domestic waste?


text:
# Find number of vertices when given number of edges

A Simple Connected Graph G has $M$ vertices and 4 edges, find $M$

Now lets say we didn't have any more info than what's mentioned above. By drawing out a couple of graphs I know that $M$ could possibly be $4$ or $5$. But when working with more than $4$ edges it can become a little difficult drawing the graphs out.

Is there any formula/algorithm that can help to quickly find the number of vertices in a simple connected graph when given the number of edges?

I am specifically talking about the number of edges which can't be made equal to $\frac{n(n-1)}{2}$ and then solved for $n$. E.g. $4$.

Doing so with $4$ gives:

$$n-\frac{1\pm\sqrt{33}}{2}$$

But with 10 edges on the other hand it works.

So for 4 edges, is there any formula/algorithm that would give me the number of vertices?

• Related question: What are all the possible numbers of vertices if it is guaranteed that any simple graph on $N$ edges is connected? – Batominovski Jun 27 '16 at 23:37

Any connected graph with $n$ vertices must have at least $n-1$ edges to connect the vertices. Therefore, $M=4$ or $M=5$ because for $M \geq 6$ we need at least 5 edges.
Now, let's say we have $N$ edges. For $n$ vertices, there needs to be at least $n-1$ edges and, as you said, there are most $\frac{n(n-1)}{2}$ edges, so we need to solve the following inequality for $n$: $$n-1 \le N \le \frac{n(n-1)}{2}$$ This is our "algorithm" for solving for possible $n$ verticies in terms of $N$ edges.


text:
Showing:
Handle Score
@Ibrahim Nash 5725
@akhayrutdinov 5111
@mb1973 4989
@Quandray 4908
@saiujwal13083 4156
@sanjay05 3762
@marius_valentin_dragoi 3511
@sushant_a 3453
@KshamaGupta 3318
@the_coder95 3302
Series GP
Basic Accuracy: 2.56% Submissions: 1313 Points: 1

Given the A and R i,e first term and common ratio of a GP series. Find the Nth term of the series.

Example 1:

Input: A = 2, R = 2, N = 4
Output: 16
Explanation: The GP series is
2, 4, 8, 16, 32,... in which 16
is th 4th term.

Example 2:

Input: A = 4, R = 3, N = 3
Output: 36
Explanation: The GP series is
4, 12, 36, 72,.. in which 36 is
the 3rd term.

You don't need to read or print anything. Your task is to complete the function Nth_term() which takes A, R and N as input parameter ans returns Nth term of the GP series modulo 109 + 7.

Expected Time Complexity: O(log2(N))
Expected Space Complexity: O(1)

Constraints:
1 <= A, R, N <= 1000000


text:
# Matrix factorization

tags
Mathematics

## LU Factorization

resources
Nick Higham’s blog

An LU factorization of a $$n \times n$$ matrix $$A$$ is a factorization $$A = LU$$, where $$L$$ is lower triangular and $$U$$ is upper triangular

### LUP factorization

LU factorization with partial pivoting: $$PA = LU$$ with $$P$$ a permutation matrix.

### LDU factorization

Lower-diagonal upper factorization: $$A = LDU$$ with $$D$$ a diagonal matrix and $$L$$ and $$U$$ are uni-triangular (triangular with diagonal one).

← Back to Notes


text:
Professor Erasmus has spent the last weekend by busily adding up all kinds of numbers. He told me today about his experiences: "On saturday evening, I added up twenty consecutive powers of $2$, and wrote their sum $S$ into my notebook. On sunday afternoon, I added up the first $n$ positive integers, and wrote their sum $T$ into my notebook. On monday morning, I suddenly realized that the sums $S$ and $T$ are equal. Mathematics is full of fascinating surprises!"

Has the professor once again made one of his well-known mathematical blunders, or do such twenty consecutive powers of $2$ indeed exist?

• Professor Erasmus seems a bit like Fermat ("I have found a proof... but the margin is too small to contain it"-esque thing) Sep 17, 2015 at 2:28

The sum of twenty consecutive powers of $2$, starting at $2^k$ is:

$$S=2^k(1+2+4+\cdots+2^{19})=2^k(2^{20}-1)$$

and the sum of the first $n$ positive integers is:

$$T = 1+2+\cdots+n=\frac{n(n+1)}{2}$$

If these two quantities are equal

$$n(n+1)=2^{k+1}(2^{20}-1)$$

so it suffices to take $k=19,n=2^{20}-1=1048575$.

It is possible with lowest power of $2$ of $2^{19}$, and a sum of consecutive integers from $1$ to $1048575$.

If he claims to have done this without a computer, Erasmus has certainly made a mistake.

The first triangular number that is the sum of 20 consecutive powers of 2 is:

$1 + 2 + 3 + \ldots + 1048575 = 2^{19} + 2^{20} + \ldots + 2^{38} = 549755289600$

Erasmus might have computed the sum $S$ on Saturday afternoon. However, consider what he would have gone through on Sunday.

Suppose Erasmus can keep the current integer and the running sum in his head (so he's not slowed by having to write down the numbers). The world record for mental addition of 10-digit numbers is 2:51 to add 10 numbers. That comes out to 1.71 seconds per (random) digit. Now, Erasmus doesn't have quite as hard a job, because his digits aren't random -- but he will have to carry quite a lot more and he has many more digits to work with, 6.22 million. So let's suppose he can do a hundred times better than the world record holder at 17 milliseconds per digit. Unfortunately, it will still take him over a day to reach $T$ -- not a task that could be done in an afternoon.

(Yes, there's a simple shortcut, but Erasmus clearly states, "I added up the first $n$ positive integers," not "I calculated the sum of the first $n$ positive integers.")

Therefore, I think it's safe to say that the professor has bungled it up again.

Incidentally, if he was able to do it in his head in about 5 hours (as generous as I think I can get for "afternoon"), that would put him at 1 addition per 14 milliseconds, significantly faster than such early computers as the Harvard Mark I, Mark II, and Z3. If he had to use paper, he would have gone through several reams of the stuff.

• Your formatting is a little weird... Sep 17, 2015 at 11:14
• @PythonMaster I had a hard time writing it up. If you have a constructive suggestion, feel free to make it. Sep 17, 2015 at 13:40

$$2^x + ... + 2^{x+19} = {n(n+1)\over 2} = 2^x(2^{20}-1)$$

$$n(n+1) = 2^{x+1} (2^{20}-1)$$

So it's definitely possible if $n = 2^{20}-1$ and $x = 19$.


text:
# What is the amplitude, period, and phase shift of f(x) = −4 sin(2x + pi) − 5?

Jun 14, 2015

#### Answer:

$f \left(x\right) = - 4 \sin \left(2 x + \pi\right) - 5$

#### Explanation:

Amplitude: -4

k = 2; Period: $\frac{2 p}{k} = \frac{2 \pi}{2} = \pi$

Phase shift: pi


text:
# Annotation of /trunk/doc/completedevs.tex

Revision 3385 - (hide annotations)
Thu Nov 25 04:41:33 2010 UTC (9 years, 11 months ago) by ahallam
File MIME type: application/x-tex
File size: 588 byte(s)
Updates to cookbook, something is wrong with the sconstruct though
 1 ahallam 3385 2 \chapter{Escript researchers and developers by release} 3 4 \begin{center} 5 \begin{tabular}{r|lr|} 6 & Releases\\ \cline{2-3} 7 Cihan Altinay & 2.0 & Current \\ 8 Artak Amirbekyan & 2.0 & Current \\ 9 Joel Fenwick & 2.0 & Current \\ 10 Lin Gao & 2.0 & Current \\ 11 Lutz Gross & 1.0 & Current \\ 12 Peter Hornby & 1.0 & 2.0 \\ 13 Ken Steube & 1.0 & 2.0 \\ 14 Elspeth Thorne & 1.0 & 2.0 \\ 15 Matt Davies & 1.0 & 2.0 \\ 16 Brett Tully & 2.0 & 2.0 \\ 17 John Smilie & 1.0 & 1.0 \\ 18 Cochrane & 1.0 & 1.0 \\ 19 Rob Woodcock & 1.0 & 2.0 \\ 20 Derek Hawcroft & 1.0 & 2.0 \\ 21 Jon Gui & 2.0 & 2.0 \\ 22 \cline{2-3} 23 \end{tabular} 24 \end{center}


text:
# This agreement is needed when a new shareholder joins a particular company.

Article 8 of the Convention (Bilateral and Multilateral Co-operation) states « The Parties may continue existing or enter into new bilateral or multilateral agreements or other arrangements in order to implement their obligations under this Convention. Such agreements or other arrangements may be based on the elements listed in Appendix VI » (Elements for Bilateral and Multilateral Co-operation). Regarding bilateral and multilateral agreements, the Guidance notes that there are many issues that can be agreed upon in advance by Parties that expect to have transboundary assessments on a regular basis. The Convention provides a legal basis for agreements (Article 2, para. 2, and Article 8). Appendix VI to the Convention contains elements for such agreements. These agreements are not a precondition for the application or ratification of the Convention but should be seen as a way of achieving effective application (agreement). See the most recent Crown Counsel Letter of Understanding #13 (PDF, 1.43MB) . The most recent terms agreed to by the province and the B.C. Government and Service Employees’ Union (BCGEU): Changes to the ETO – What You Need to Know: Information Video This condensed informational video provides a brief overview of the steps required to implement the new hours of work language in the ETO Component Agreement. This video is for training purposes only. ETO Hours of Work Joint Training Video The BCGEU and BCPSA jointly developed training regarding the new hours of work language in the ETO Component Agreement and then delivered this training to ETO staff across the province http://www.aelorae.us/collegeright/bcgeu-17th-master-collective-agreement/. Convertible bonds can include both soft and hard call provisions, where the hard call can expire, but the soft provision often has variable terms. A hard call protection safeguards bondholders from having their bonds called before a certain time has elapsed. For example, the trust indenture on a 10-year bond might state that the bond will remain uncallable for six years. This means that the investor gets to enjoy the interest income that is paid for at least six years before the issuer can decide to retire the bonds from the market. If a bond issue has soft call protection, that provision of the bond goes into effect after the hard call protection has passed agreement. I think that concludes my analysis of the provisions of the agreement. It was my privilege to be one of the Delegation which went from this country to negotiate those Agreements. We represented every party in the State; we worked throughout with the greatest harmony, the greatest loyalty and the greatest trust in one another. The conclusions which we reached were in every case unanimous conclusions. We do not believe that any arrangement made at Ottawa is necessarily a perfect agreement, a flawless plan, which cannot be improved upon. The actual Resolution to which I called attention indicated 1131 that the Conference itself regarded these Agreements as a step forward which should in the future lead to further progress in the same direction, but we believe that the Agreements which we negotiated, and of which we ask your Lordships to approve, do mark a real advance in Empire co-operation and Empire unity, and do, in the words of the Resolution of 1930, afford the best means for maintaining and extending inter-Imperial trade. Flexibility prior written to home and horse sales agreement with payment with the rider of. Value at the goods in by opening a payment agreement. Imperfections or duration of making this should the horse sales agreement plan herein. Lyon real or payment plan templates for the package of the sale is an entrepreneur. Leaves the repayments will go by all sales with the title hostile to. Life sales agreement payment of the name and the purchaser. Rocket lawyer referral service, horse sales agreement with payment schedule is! Gain or a confidentiality agreement instead of a different browser is more. Edit and a commission system work hand in time paying you and horse sales agreement with payment plan? 18001 followed by both parties has reason to pick up with no written by create horse selling (http://randalleaton.com/wordpress/?p=6792). A Loan Agreement is a document between a borrower and lender that details a loan repayment schedule. IN CONSIDERATION OF the Lender loaning certain monies (the « Loan ») to the Borrower, and the Borrower repaying the Loan to the Lender, both parties agree to keep, perform and fulfill the promises and conditions set out in this Agreement: If a lender is a company, and the Loan is being provided to a shareholder of that company, parties should be aware of sections 15(1.2), s. 15(2), s. 80.4(2), s. 110(1)(j) of the Income Tax Act, which stipulates that such a loan may be deemed a benefit and be taxable as income for shareholders view. Because such arrangements pose unique risks in the university setting and are challenging to negotiate, instances where service agreements are made with Harvard as the contracting party are expected to be exceptional, not routine. In any event, there is no reason for you to sign an agreement that violates your institutions policies. There is nothing to gain from it, and much to lose. As you prepare to sign a consulting agreement, consider the following: Klees is general counsel of the University of Virginia Investment Management Company and a lecturer at the University of Virginia School of Law (http://www.ko2w.com/2021/04/14/university-consulting-agreement/). Once potential buyers show interest, schedule a meeting to promote the sale and highlight the value that the business could bring to an investor. After agreeing, you will want to retain the assistance of an attorney to look over offers, contracts, and agreements to ensure that they are in order and to protect your interests. You can make arrangements with the buyer to determine a realistic closing date, discuss terms to the contracts, and reassignment of associated leases and assets (http://www.ironoreofafrica.co.uk/news/business-bill-of-sale-purchase-agreement/). Who the parties are is usually quite straightforward and will be described at the beginning of the NDA. The more difficult question is whether there needs to be any other persons or companies that should be bound by the agreement. For example, are there any subsidiaries or other companies connected to the buyer that should also be covered under the NDA? Does the recipient expect to provide confidential information to outside advisors such as lawyers, accountants, brokers, or investment bankers? If this is the case, then the NDA should make clear how these parties are to be bound. Information security should be a top priority for any business non-disclosure agreement for merger or acquisition. In the square $I\times I$ table, the main diagonal {i = j} represents rater or observer agreement. Let the term ij denotes the probability that Siskel classifies the move in category i and Ebert classifies the same movie in category j. For example, 13 means that Ebert gave « two thumbs up » and Siskel gave « thumbs down ». If the observed agreement is due to chance only, i.e. if the ratings are completely independent, then each diagonal element is a product of the two marginals. Where Pr(a) represents the actual observed agreement, and Pr(e) represents chance agreement.


text:
# STM32F429ZI ADC converting too fast

I am trying to trigger ADC1 to convert (for the moment) one channel of a STM32F429ZI microcontroller (on the Nucleo Board) by TIM2 every second. With the code below I configured 180 MHz core frequency, a timer underflow every second (working), the ADC to convert channel 3 with 480 ADC clock cycles (@22.5 MHz) sample time and 12 bit resolution. So with the abovementioned configuration I would have expected ~22 µs conversion time of the ADC.

To check for the conversion time I need to use Segger SystemView as I don't have an oscilloscope. Contrary to my expectation the ADC interrupt service routine (ISR 34) is called 2.6 µs after the timer interrupt (ISR 44)

Can someone explain why the ADC is converting so fast?

Code:

/*********************************************************************
*                    SEGGER Microcontroller GmbH                     *
*                        The Embedded Experts                        *
**********************************************************************
*                                                                    *
*            (c) 2014 - 2020 SEGGER Microcontroller GmbH             *
*                                                                    *
*           www.segger.com     Support: support@segger.com           *
*                                                                    *
**********************************************************************
*                                                                    *
*                                                                    *
* Redistribution and use in source and binary forms, with or         *
* without modification, are permitted provided that the following    *
* conditions are met:                                                *
*                                                                    *
* - Redistributions of source code must retain the above copyright   *
*   notice, this list of conditions and the following disclaimer.    *
*                                                                    *
* - Neither the name of SEGGER Microcontroller GmbH                  *
*   nor the names of its contributors may be used to endorse or      *
*   promote products derived from this software without specific     *
*   prior written permission.                                        *
*                                                                    *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND             *
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,        *
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF           *
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE           *
* DISCLAIMED.                                                        *
* IN NO EVENT SHALL SEGGER Microcontroller GmbH BE LIABLE FOR        *
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR           *
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT  *
* OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;    *
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF      *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT          *
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE  *
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH   *
* DAMAGE.                                                            *
*                                                                    *
**********************************************************************

File    : main.c
Purpose : Generic application start

*/

#include <stm32f4xx.h>
#include "SEGGER_SYSVIEW.h"

void ClockInit(void)
{
uint32_t timeout = 1000000;

// enable flash prefetch
FLASH->ACR |= FLASH_ACR_PRFTEN;
// set 5 wait states (needed for high PLL frequency)
FLASH->ACR &= ~FLASH_ACR_LATENCY_Msk;
FLASH->ACR |= FLASH_ACR_LATENCY_5WS;
do
{
timeout--;
} while (((FLASH->ACR & FLASH_ACR_LATENCY_Msk) != FLASH_ACR_LATENCY_5WS) && (timeout > 0));

// switch on external clock, bypass HSE with it and wait for clock to be ready
RCC->CR |= (RCC_CR_HSEON | RCC_CR_HSEBYP);
timeout = 1000000;
do
{
timeout--;
} while (((RCC->CR & RCC_CR_HSERDY_Msk) != RCC_CR_HSERDY) && (timeout > 0));

// configure (HSE as clock source, M = 4, N = 180, P = 2), enable and wait for PLL
RCC->PLLCFGR = (RCC_PLLCFGR_PLLSRC_HSE | (4 << RCC_PLLCFGR_PLLM_Pos) | (180 << RCC_PLLCFGR_PLLN_Pos));
RCC->CR |= RCC_CR_PLLON;
timeout = 1000000;
do
{
timeout--;
} while (((RCC->CR & RCC_CR_PLLRDY_Msk) != RCC_CR_PLLRDY) && (timeout > 0));

// configure rest of clock tree
RCC->CFGR &= ~(RCC_CFGR_PPRE2_Msk | RCC_CFGR_PPRE1_Msk | RCC_CFGR_HPRE_Msk);
RCC->CFGR |= (RCC_CFGR_PPRE2_DIV2 | RCC_CFGR_PPRE1_DIV4 | RCC_CFGR_HPRE_DIV1);

// set PLL as clock source and wait until clock is ready
RCC->CFGR &= ~(RCC_CFGR_SW_Msk);
RCC->CFGR |= RCC_CFGR_SW_PLL;
timeout = 1000000;
do
{
timeout--;
} while (((RCC->CFGR & RCC_CFGR_SWS_Msk) != RCC_CFGR_SWS_PLL) && (timeout > 0));

SystemCoreClockUpdate();

// enable GPIOA, ADC1 and TIM2 clocks
RCC->AHB1ENR |= RCC_AHB1ENR_GPIOAEN;
RCC->APB1ENR |= RCC_APB1ENR_TIM2EN;
}

void TimerInit(void)
{
// counter direction down, generate update event only on underflow
TIM2->CR1 |= (TIM_CR1_DIR | TIM_CR1_URS);
// set update event as trigger source
TIM2->CR2 &= ~TIM_CR2_MMS_Msk;
TIM2->CR2 |= TIM_CR2_MMS_1;
// enable update interrupt
TIM2->DIER |= TIM_DIER_UIE;
// set timer and reload value for update generation every 1000 ms
TIM2->ARR = TIM2->CNT = 90000000;
}

void TimerStart(void)
{
TIM2->CR1 |= TIM_CR1_CEN;
}

{
GPIOA->MODER |= GPIO_MODER_MODE3;
// set clock prescaler to 4 -> 22,5 MHz
// enable timer 2 trigger event as start trigger on rising edge and generate EOC interrupt after each conversion
// set 480 cycles sample time for channel 3
// set channel 3 as first (any only) regular channel
// enable EOC interrupt
}

void InterruptInit(void)
{
// Timer 2
NVIC_SetPriority(TIM2_IRQn, 3);
NVIC_ClearPendingIRQ(TIM2_IRQn);
NVIC_EnableIRQ(TIM2_IRQn);
}

void TIM2_IRQHandler(void)
{
SEGGER_SYSVIEW_RecordEnterISR();
NVIC_ClearPendingIRQ(TIM2_IRQn);
TIM2->SR &= ~TIM_SR_UIF;
}

{
uint16_t Value;
SEGGER_SYSVIEW_RecordEnterISR();
}

int main(void)
{
ClockInit();

SEGGER_SYSVIEW_Conf();

TimerInit();


text:
# Which hemisphere am I on?

Inspired by this answer to a question on Puzzling.SE (which contains the old but wrong idea that the Coriolis force determines the direction in which a bathroom vortex rotates, and also an approach using a very short Foucault pendulum), is there a practical experiment that can be performed with household items in a closed room to determine with some accuracy whether one is currently located on the northern or southern hemisphere of the Earth? Assume the room is 2.5 meters, not 15 meters high like most Foucault installations.

• Right now it might be tricky, but you could check the heaters/AC vents to see if hot or cold air is coming in. ;) – Kyle Kanos Oct 25 '14 at 12:35
• They have different electricity sockets and power supplies in different countries, but I guess this isn't what you had in mind! – Rob Jeffries Oct 25 '14 at 12:53
• What's wrong with a short Foucault pendulum? – rob Oct 25 '14 at 13:17
• Is a wireless laptop a household item? – imallett Oct 25 '14 at 23:09

# Method 1: Foucault Pendulum

As user Rob asks, what is wrong with a short Foucault pendulum?

There is a problem, but it can be overcome inexpensively, but with some DIY effort at home. The problem is that, by dint of imperfections in the suspending fibre and bob, no pendulum will swing in a plane even if the Earth were not rotating. Instead, the bob will make an elliptical path each cycle (think of this as two vibration eigenmodes in orthogonal planes being inevitably excited by imperfections and asymmetries). As soon as there is any elliptical as opposed to straight planar motion, the ellipse precesses at a rate proportional to its minor axis. The minor axis is always nonzero owing to imperfections and asymmetries and one cannot eliminate these altogether. Therefore, a short putative Foucault pendulum will precess at a rate set wholly by its imperfections, not by the Earth's rotation. The latter is overwhelmed.

The two papers below propose and demonstrate a simple feedback circuit to impose a counteracting force to null out the elliptical motion and keep the motion planar. Using this feedback circuit, a Foucault pendulum of three metres length whose precession is dominated by the Earth's rotation can be built. Experimental results are presented showing that the device can clearly measure the Earth's rotation.

Reinhard A. Schumacher and Brandon Tarbet, "A Short Foucault Pendulum Free of Ellipsoidal Precession"

H. Richard Crane, "Short Foucault Pendulum: A Way to eliminate the precession due to ellipticity", Am. J. Phys. 49(11) 1981

# Method 2: Magnetic Dip

Build your own Dip Circle and measure the Magnetic Dip (see Wiki Page of this name) in your room. With a compass, you know which way North is, so you can tell the sign of the dip. Dip is negative in the Southern Hemisphere, and positive in the Northern.

• The dip method is by far easier to implement in a house experiment. It becomes inaccurate/indeterminate near the equator - but then so would a Foucault pendulum... – Floris Oct 25 '14 at 14:20
• +1 for the "dip". We have a short Foucault pendulum with a feedback circuit and I can vouch it works perfectly. However, I don't think I'd be able to build one in my kitchen. – Rob Jeffries Oct 25 '14 at 18:06
• @Floris: And so would the true answer anyway ;p – Lightness Races in Orbit Oct 26 '14 at 1:50
• @RobJeffries There is a very homemade looking Foucault pendulum at the amateur astronomy club I take my daughter to and it was indeed made wholly by one of the members (though I don't believe in her kitchen). It has a fibre about 1.5 metres long and, although its precession is definitely dominated by the Earth's rotation (the rate of rotation is clearly within a few percent of $2\pi\times \sin37^o$ per day where $37^o$ is my latitude), I have never tested the device's accuracy properly. – Selene Routley Oct 26 '14 at 7:24
• @Floris as you get arbitrarily close to the equator it becomes arbitrarily difficult to determine which hemisphere you're in, by any method (even by consulting a map, or things like GPS). – user253751 Oct 26 '14 at 9:01


text:
# NAG FL InterfaceThread Unsafe Routines

Most routines in the NAG Library are thread safe, however there are some routines that are not thread safe as they use global variables (such as module variables, common blocks or variables with the SAVE attribute). See Section 1 in FL Interface Multithreading for further information.
 Routine Name Description d02gaf nagf_ode_bvp_fd_nonlin_fixedbcOrdinary differential equations, boundary value problem, finite difference technique with deferred correction, simple nonlinear problem d02gbf nagf_ode_bvp_fd_lin_genOrdinary differential equations, boundary value problem, finite difference technique with deferred correction, general linear problem d02haf nagf_ode_bvp_shoot_bvalOrdinary differential equations, boundary value problem, shooting and matching, boundary values to be determined d02hbf nagf_ode_bvp_shoot_genparOrdinary differential equations, boundary value problem, shooting and matching, general parameters to be determined d02jaf nagf_ode_bvp_coll_nthOrdinary differential equations, boundary value problem, collocation and least squares, single $n$th-order linear equation d02jbf nagf_ode_bvp_coll_sysOrdinary differential equations, boundary value problem, collocation and least squares, system of first-order linear equations d02laf nagf_ode_ivp_2nd_rknSecond-order ordinary differential equations, initial value problem, Runge–Kutta–Nystrom method d02lxf nagf_ode_ivp_2nd_rkn_setupSecond-order ordinary differential equations, initial value problem, setup for d02laf d02lyf nagf_ode_ivp_2nd_rkn_diagSecond-order ordinary differential equations, initial value problem, diagnostics for d02laf d02lzf nagf_ode_ivp_2nd_rkn_interpSecond-order ordinary differential equations, initial value problem, interpolation for d02laf d02mzf nagf_ode_ivp_stiff_interpOrdinary differential equations, initial value problem, interpolation for d02m–n routines (all integration methods), natural interpolant d02nbf nagf_ode_ivp_stiff_exp_fulljacExplicit ordinary differential equations, stiff initial value problem, full Jacobian (comprehensive) d02ncf nagf_ode_ivp_stiff_exp_bandjacExplicit ordinary differential equations, stiff initial value problem, banded Jacobian (comprehensive) d02ndf nagf_ode_ivp_stiff_exp_sparjacExplicit ordinary differential equations, stiff initial value problem, sparse Jacobian (comprehensive) d02ngf nagf_ode_ivp_stiff_imp_fulljacImplicit/algebraic ordinary differential equations, stiff initial value problem, full Jacobian (comprehensive) d02nhf nagf_ode_ivp_stiff_imp_bandjacImplicit/algebraic ordinary differential equations, stiff initial value problem, banded Jacobian (comprehensive) d02njf nagf_ode_ivp_stiff_imp_sparjacImplicit/algebraic ordinary differential equations, stiff initial value problem, sparse Jacobian (comprehensive) d02nmf nagf_ode_ivp_stiff_exp_revcomExplicit ordinary differential equations, stiff initial value problem (reverse communication, comprehensive) d02nnf nagf_ode_ivp_stiff_imp_revcomImplicit/algebraic ordinary differential equations, stiff initial value problem (reverse communication, comprehensive) d02nsf nagf_ode_ivp_stiff_fulljac_setupOrdinary differential equations, initial value problem, for use with d02m–n routines, full Jacobian, linear algebra set up d02ntf nagf_ode_ivp_stiff_bandjac_setupOrdinary differential equations, initial value problem, for use with d02m–n routines, banded Jacobian, linear algebra set up d02nuf nagf_ode_ivp_stiff_sparjac_setupOrdinary differential equations, initial value problem, for use with d02m–n routines, sparse Jacobian, linear algebra set up d02qff nagf_ode_ivp_adams_rootsOrdinary differential equations, initial value problem, Adams' method with root-finding (direct communication, comprehensive) d02qgf nagf_ode_ivp_adams_roots_revcomOrdinary differential equations, initial value problem, Adams' method with root-finding (reverse communication, comprehensive) d02qwf nagf_ode_ivp_adams_setupOrdinary differential equations, initial value problem, setup for d02qff and d02qgf d02qxf nagf_ode_ivp_adams_diagOrdinary differential equations, initial value problem, diagnostics for d02qff and d02qgf d02qyf nagf_ode_ivp_adams_rootdiagOrdinary differential equations, initial value problem, root-finding diagnostics for d02qff and d02qgf d02qzf nagf_ode_ivp_adams_interpOrdinary differential equations, initial value problem, interpolation for d02qff or d02qgf d02raf nagf_ode_bvp_fd_nonlin_genOrdinary differential equations, general nonlinear boundary value problem, finite difference technique with deferred correction, continuation facility d02saf nagf_ode_bvp_shoot_genpar_algeqOrdinary differential equations, boundary value problem, shooting and matching technique, subject to extra algebraic equations, general parameters to be determined d02xkf nagf_ode_ivp_stiff_c1_interpOrdinary differential equations, initial value problem, interpolation for d02m–n routines, ${C}^{1}$ interpolant d02zaf nagf_ode_ivp_stiff_errestOrdinary differential equations, initial value problem, weighted norm of local error estimate for d02m–n routines d03pef nagf_pde_1d_parab_kellerGeneral system of first-order PDEs, method of lines, Keller box discretization, one space variable d03pff nagf_pde_1d_parab_convdiffGeneral system of convection-diffusion PDEs with source terms in conservative form, method of lines, upwind scheme using numerical flux function based on Riemann solver, one space variable d03pkf nagf_pde_1d_parab_dae_kellerGeneral system of first-order PDEs, coupled DAEs, method of lines, Keller box discretization, one space variable d03plf nagf_pde_1d_parab_convdiff_daeGeneral system of convection-diffusion PDEs with source terms in conservative form, coupled DAEs, method of lines, upwind scheme using numerical flux function based on Riemann solver, one space variable d03prf nagf_pde_1d_parab_remesh_kellerGeneral system of first-order PDEs, coupled DAEs, method of lines, Keller box discretization, remeshing, one space variable d03psf nagf_pde_1d_parab_convdiff_remeshGeneral system of convection-diffusion PDEs, coupled DAEs, method of lines, upwind scheme, remeshing, one space variable d03puf nagf_pde_1d_parab_euler_roeRoe's approximate Riemann solver for Euler equations in conservative form, for use with d03pff, d03plf and d03psf d03pvf nagf_pde_1d_parab_euler_osherOsher's approximate Riemann solver for Euler equations in conservative form, for use with d03pff, d03plf and d03psf d03pwf nagf_pde_1d_parab_euler_hllModified HLL Riemann solver for Euler equations in conservative form, for use with d03pff, d03plf and d03psf d03pxf nagf_pde_1d_parab_euler_exactExact Riemann solver for Euler equations in conservative form, for use with d03pff, d03plf and d03psf d03raf nagf_pde_2d_gen_order2_rectangleGeneral system of second-order PDEs, method of lines, finite differences, remeshing, two space variables, rectangular region d03rbf nagf_pde_2d_gen_order2_rectilinearGeneral system of second-order PDEs, method of lines, finite differences, remeshing, two space variables, rectilinear region e01sbf nagf_interp_2d_scat_evalInterpolated values, evaluate interpolant computed by e01saf, two variables g08eaf nagf_nonpar_randtest_runsPerforms the runs up or runs down test for randomness g08ebf nagf_nonpar_randtest_pairsPerforms the pairs (serial) test for randomness g08ecf nagf_nonpar_randtest_tripletsPerforms the triplets test for randomness g08edf nagf_nonpar_randtest_gapsPerforms the gaps test for randomness h02bbf nagf_mip_ilp_denseInteger LP problem (dense) h02bff nagf_mip_ilp_mpsxInterpret MPSX data file defining IP or LP problem, optimize and print solution h02bvf nagf_mip_ilp_printPrint IP or LP solutions with user-specified names for rows and columns h02cbf nagf_mip_iqp_denseInteger QP problem (dense) h02ccf nagf_mip_iqp_dense_optfileRead optional parameter values for h02cbf from external file h02cdf nagf_mip_iqp_dense_optstrSupply optional parameter values to h02cbf h02cef nagf_mip_iqp_sparseInteger LP or QP problem (sparse), using e04nkf/e04nka h02cff nagf_mip_iqp_sparse_optfileRead optional parameter values for h02cef from external file h02cgf nagf_mip_iqp_sparse_optstrSupply optional parameter values to h02cef x04aaf nagf_file_set_unit_errorReturn or set unit number for error messages x04abf nagf_file_set_unit_advisoryReturn or set unit number for advisory messages


text:
# Compare shapeless lists

Let's have a ragged list containing no values, only more lists. For example:

[[[],[[]],[],[]],[],[[],[],[]],[]]

And the list will be finite, meaning that eventually every path terminates in an empty list [].

It's simple enough to determine if two of these are structurally equal. Check each element in order for equality and recurse. However what if we don't care about the order of the lists for equality? What if we only care that they have the same elements?

We can define this shapeless equality like so:

Two lists $$\A\$$, and $$\B\$$ are shapeless equal if for every element in $$\A\$$ there are as many elements in $$\A\$$ shapeless equal to it as there are in $$\B\$$, and vice-versa for the elements of $$\B\$$.

Your task will be to take two ragged lists and determine if they are "shapeless equal" to each other. If they are you should output some consistent value, if they are not you should output some distinct consistent value.

This is so answers will be scored in bytes with fewer bytes being the goal.

## Testcases

[] [] -> 1
[[],[[]]] [[[]],[]] -> 1
[[],[[],[[]]]] [[],[[[]],[]]] -> 1
[[],[[],[[]]]] [[[[]],[]],[]] -> 1
[[]] [] -> 0
[[],[]] [[[]]] -> 0
[[],[]] [[]] -> 0
[[[],[],[]],[[]]] [[[],[]],[[],[]]] -> 0
[[],[],[[]]] [[],[[]],[[]]] -> 0

• Suggested falsy test case: [[],[[]],[[]]] [[],[[],[[]]]]. (All existing test cases would pass a simplified version of my solution where the trailing 0 is not inserted.) Jan 11 at 1:56

# Brachylog, 3 bytes

p↰ᵐ

Try it online!

### Explanation

This takes the first list as the input variable, and the second list as the output variable. The interpreter then prints true. if it is possible to satisfy this predicate with these variables, and false. otherwise.

p     The output is a permutation of the input
↰ᵐ   Recursively call this predicate on each element of the input

# Python 3, 49 bytes

lambda x,y:g(x)==g(y)
g=lambda a:sorted(map(g,a))

Try it online!

# JavaScript (ES6), 41 bytes

Expects (a)(b). Returns a Boolean value.

a=>b=>(g=a=>1+a.map(g).sort()+0)(a)==g(b)

Try it online!

### How?

We can't compare nested arrays in JS by simply coercing them to strings because everything is flatten and empty arrays are turned into empty strings. (Basically, only commas would remain with the arrays we're dealing with in this challenge.)

We could use JSON.stringify:

a=>JSON.stringify(a.map(g).sort())

but this is a bit lengthy.

Instead, we do a custom conversion to a string by prepending a 1 at the beginning of each call and appending a 0 at the end.

For an already sorted array, this effectively replaces opening brackets with 0's and closing brackets with 1's, while leaving commas unchanged.

For instance:

 [[],[[],[[]]]]
"110,110,110000"

• Old Firefox (SpiderMonkey) has an uneval which is a bit shorter than JSON.stringify. Although still longer than current approach.
– tsh
Jan 11 at 1:48
• @tsh Interesting, thanks. I was suspecting either V8 or SpiderMonkey had such a feature but couldn't find it. Jan 11 at 1:50

# Jelly, 7 bytes

ß€Ṣ
Ç€E

A monadic Link accepting a list of the two ragged lists that yields 1 if they are "shapeless equal".

Try it online!

### How?

Recursively sort the containers of any nested lists and compare the results for equality.

ß€Ṣ - Helper Link, recursively sort container lists and their content: List, X
€  - for each element in X:
Ṣ - sort

Ç€E - Link, the main function: List, A
€  - for each of the two lists in A:
Ç   -   call the Helper Link
E - all equal?

# Ruby, 38 bytes

->l,m{g=->a{a.sort.map &g};g[l]==g[m]}

Try it online!

(Stolen from hyper neutrino's python answer)

# Wolfram Language (Mathematica), 16 bytes

SameQ@@Sort//@#&

Try it online!

Input [{A, B}].

# 05AB1E, 11 bytes

"®δ.V{"©.VË

Input as a pair of nested lists.

Explanation:

"..."      # Push the 'recursive' string explained below
©     # Store it in variable ® (without popping)
.V   # Execute it as 05AB1E code
# (using the implicit input-pair in the first call)
Ë  # Check if both lists in the pair are now equal
# (after which the result is output implicitly)

δ         # Map over each inner list:
® .V       #  Do a recursive call by executing string ® as 05AB1E code
{      # Then sort each inner list

# Stax, 14 bytes

ü╙ûÆ╙X○Γfó¡↓↓▄

Run and debug it

Sort arrays till the lowest depth and compare for equality. G might be usable here, but a reusable recursive function feels shorter (recursive will probably prove me wrong). (I proved myself wrong. -1)

# Python3, 78 bytes:

s=sorted
l=len
f=lambda a,b:l(a)==l(b)and all(f(j,k)for j,k in zip(s(a),s(b)))

Try it online!

• You can cut out two bytes by removing the l=len line. It adds 6 to only save 4 later on Jan 11 at 23:09

# Charcoal, 47 bytes

⊞υθ⊞υηＦυＦι⊞υκＷυ«≔⊟υι≔⟦⟧ζＷι⊞ζ⊟ιＷ⁻ζιＦ№ζ⌊κ⊞ι⌊κ»⁼θη

Try it online! Link is to verbose version of code. Not easy due to lack of recursion or sorting primitives. Explanation:

⊞υθ⊞υηＦυＦι⊞υκ

Get all of the lists and sublists from the input.

Ｗυ«≔⊟υι

Process them in reverse order.

≔⟦⟧ζＷι⊞ζ⊟ι

Move the elements of this (sub)list into a temporary list.

Ｗ⁻ζιＦ№ζ⌊κ⊞ι⌊κ

Put them back but in sorted order.

»⁼θη

Now that the input lists have been sorted in-place, we can just compare them directly.

# Retina 0.8.2, 116 bytes

+(?=(((\[)|(?<-3>])|,)+(?(3)^)),(?!\1)(((\[)|(?<-6>])|,)+(?(6)^))(.*))(.*)\[.*(?=\4\7$)\8].*(?=\7$)
$4,$1
^(.+) \1$ Try it online! Link includes test cases. Explanation: +  Repeat until no more lists need exchanging. (?=(((\[)|(?<-3>])|,)+(?(3)^)),(?!\1)(((\[)|(?<-6>])|,)+(?(6)^))(.*))  Look ahead to capture two balanced lists and the tail of the string. (.*)\[.*(?=\4\7$)\8].*(?=\7$)  Check whether the second list should precede the first list. The lookaheads ensure that we only compare the two lists captured above. Note that this could inefficiently swap two lists back and forth before it's finished sorting their sublists, but once all of the sublists are sorted the lists will eventually sort stably. $4,$1  If so then exchange the two lists. ^(.+) \1$

Now that the input lists have been sorted, just compare them directly.

# Pari/GP, 56 bytes

f(a,b)=s=vecsort;#a==#b&&prod(i=1,#a,f(s(a)[i],s(b)[i]))

Try it online!

# Perl 5, 59 bytes

sub f{@_>1?f(pop)eq f(pop):"(@{[sort map{f(\$_)}@{pop()}]}"}

Try it online!


text:
# Symmetry and conservation laws related to baryon number, lepton number and strangeness

According to Noether's theorem, Every continuous symmetry of the action leads to a conservation law. For example, conservation of linear momentum corresponds to translational symmetry, conservation of angular momentum corresponds to rotational symmetry.

My question is on the conservation of baryon number, lepton number and strangeness. What type of symmetry does imply when the above mentioned quantities are conserved in a system?

-
–  Qmechanic Oct 1 '12 at 6:16


text:
Find all School-related info fast with the new School-Specific MBA Forum

 It is currently 25 May 2015, 00:24

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 June
Open Detailed Calendar

760 in GMAT with 5.5 in AWA - Still not sure about MBA!!!

Author Message
Intern
Joined: 01 Nov 2011
Posts: 3
Followers: 0

Kudos [?]: 0 [0], given: 0

760 in GMAT with 5.5 in AWA - Still not sure about MBA!!! [#permalink]  20 Jan 2012, 08:10
Hello to everyone,

I know this question has been raised many times, but I don't know if an MBA would be adequate for my profile and my career goals.

I am an actuary (I studied actuarial science), and have been working mostly in insurance and reinsurance as a treaty underwriter, where I have had constant contact with clients, but which is mostly a middle-office job (2 years full time at a reinsurance company). I have a 4.0 GPA (95%) and was top of my class at the most reputable business school in Mexico (ITAM).

My GMAT scores are as follows:
Overall: 760
Quantitative: 50
Verbal: 41
AWA: 5.5

Not knowing where to take my career (but knowing I don't want to spend my whole life in insurance), I took the GMAT to apply for an MSc Finance in Europe. However, after speaking with some friends and family, I realized that might not be the correct choice, especially if I'm not sure what I want to do in the future.

I like finance a lot, but I'm more inclined towards the capital markets side of finance, I'm not really attracted by IB (money and proffesional success are not my first goals in life). I know I want to have my own company, but I'm not sure if this is the right time yet. I feel I need/want to study further (I really like studying), but I don't know if an MBA is right for me. Even though I believe and MBA could help me strengthen my non-technical (e.g. social) skills, I'm not sure if it would be too non-technical for me.

I don't want to bore you any more, so the questions I have are the following:

1) If I want to change my career, but not really knowing where I want to go, would you believe an MBA could help me redirect my career? I would be applying to enter in September 2013.

2) If I want to eventually start my own company (maybe a couple of years after graduating from an MBA), do you think an MBA would be helpful?

3) Do you think my profile would fit the MBA profile? If so, which MBA's do you think would be right for me? I already lived for 1.5 years in NY, and I don't quite like the northeast USA (except for Boston). I'm more inclined towards the Texas - California region, or even the Chicago region.

I know I was somehow vague, but thank you in advance for any advice you could give me.
 Kaplan Promo Code Knewton GMAT Discount Codes Veritas Prep GMAT Discount Codes
Director
Status: Go Blue!
Joined: 03 Jun 2010
Posts: 685
Location: United States (MO)
Concentration: Nonprofit, General Management
Schools: Michigan (Ross) - Class of 2015
GMAT 1: 740 Q47 V45
GRE 1: 336 Q169 V167
GPA: 3.22
WE: Information Technology (Manufacturing)
Followers: 16

Kudos [?]: 147 [0], given: 249

Re: 760 in GMAT with 5.5 in AWA - Still not sure about MBA!!! [#permalink]  20 Jan 2012, 08:33
Yes, you're in the right place! Career change and entrepreneurship are both great reasons to get the MBA. Your profile will fit right in (you'll find out somewhat quickly that there is no standard profile, people come from all over the place!)

This is an assumption based on your undergrad, but are you Hispanic?

In terms of fit and selection, you have no ceiling. HBS, Stanford, Booth, and MIT sound like good schools based on your geographic preferences. If you can deal with the east coast for two more years, add Wharton and Columbia.

I also know that a PhD in Finance may be a good route. I just met an Alabama finance PhD who started his own PE firm that JV'd with Blackstone and sourced $120 million every month, leveraged it to close$400 million in business every month. Blackstone eventually bought the firm. He did this while working as a professor full-time. Now he's on to some other big idea, sounds like a pretty nice lifestyle!
_________________

ME: PROFILE | CPA: BEC AUD FAR REG | CMA: ONE TWO

bitly bundles: mba rankings | mba programs

GMAT Club Premium Membership - big benefits and savings

Moderator
Joined: 10 May 2010
Posts: 824
Followers: 22

Kudos [?]: 342 [0], given: 192

Re: 760 in GMAT with 5.5 in AWA - Still not sure about MBA!!! [#permalink]  20 Jan 2012, 08:52
Yes PhD finance may be a good route.
_________________

The question is not can you rise up to iconic! The real question is will you ?

Intern
Joined: 01 Nov 2011
Posts: 3
Followers: 0

Kudos [?]: 0 [0], given: 0

Re: 760 in GMAT with 5.5 in AWA - Still not sure about MBA!!! [#permalink]  21 Jan 2012, 12:40
Thank you both for your replies. Indeed the PhD route doesn't sound bad at all. I will take a look at some programs.

I have one additional question. What do you think about the MBA at University of Texas, Austin (McCombs)? It seems that it is not top-tier in the US, but it is well known in Mexico, especially because there are many Mexicans studying there and the networking opportunities are excellent.
Re: 760 in GMAT with 5.5 in AWA - Still not sure about MBA!!!   [#permalink] 21 Jan 2012, 12:40
Similar topics Replies Last post
Similar
Topics:
4 GMAT Debrief : 760 (Q51, V42, IR8, AWA5.5) In 3 Weeks 3 29 Sep 2014, 10:27
GMAT: 760 First Attempt AWA: 5.5 IR: 7 GPA: 2.9 1 04 Jun 2014, 23:13
13 760 (Q50 V41) AWA 5.5 IR 7 15 07 Jan 2013, 13:54
1 760 (Q50 V42) AWA 5.5 - GMAT Club works!! 15 11 Dec 2009, 09:31
First Attempt - 760! It can be done. AWA - 5.5 7 25 Aug 2007, 08:44
Display posts from previous: Sort by

760 in GMAT with 5.5 in AWA - Still not sure about MBA!!!

Moderator: OasisGC

 Powered by phpBB © phpBB Group and phpBB SEO Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


text:
# Lecture 8 - Baby Modelling

In Lecture 5, I asked you to read this system description. Today we will complete analysing it as an example of how to make a system abstraction.

We do this as methodically and mechanically as possible.

#### 3. Metrics

1. Reponse to client requests
2. Delay in redirection
3. Utilization

Consistency

1. Time data is stale
• catalogue item
• shopping cart

Failure

2. Time to complete redirections

#### 4. List Parameters

System Parameters

These describe system propertis that might be expected to affect the performance of the system in dimensions described by the goals of the study

1. network delay
2. frequency of transmission of shopping cart content
3. frequency of server failure
4. downtime on server failure
6. service capacity: how many services a server can provide per second

1. arrival rate of requests of each type

Hybrid Parameters

1. service (response) time, which depends on service capacity and arrival rate of requests

#### 5. Choose Factors

Falls under the heading of experiment design which, for now, remains outside the scope of system abstraction.

Choosing a factor to examine requires you to choose levels at which you want to know how the system performs.

## Modelling

An extreme example of abstraction.

Two methods for modelling a system

1. Stochastic
2. Operational

#### 1a. Study Goals

Get analytic results under as general a set of assumptions as possible. Results will be in the following areas:

1. Response Time
2. Throughput
3. Utilization

#### 1b. System Description

1. A server that processes requests
2. A queue that holds requests currently being processed
3. A client that makes requests.

Note. Request', these notes, and job', textbook, are exactly the same thing for the purposes of this course. Request' better characterizes what the client does and is both a noun and a verb, which is handy when writing and speaking; job' better describes the actual thing that is requested and has a narrower range of meanings in English, which can reduce misunderstanding.

YES!

#### 2. Services Provided

Handling requests.

• A request is completely abstract: we are uninterested in what is requested.
• The only specified property of a request is the consumption of a set amount of resources during processing

#### 3. Metrics

1. Statistics of response times, such as
• average response time - R
• median
• minimum
• maximum
• percentiles
• etc.
2. Statistics of throughput
• average throughput - X
3. Statistics of utilization

#### 4. Parameters

System Parameters

1. Service statistics

1. Arrival statistics
• arrival rate - \lambda
2. Think time, which is really part of arrival statistics
• average think time - Z
3. Number of users, which is really part of arrival statistics.

#### 5. Factors

Same as parameters

### Little's Law (or Formula)

1. Picture of arrival and departure generating system load diagram
2. Area under system load is total response time: nR
3. Average load, Q, times time interval, L is total response time: QL = nR
4. n/L = X = throughput = \lambda = interarrival time.

#### Stability

Little's formula holds only if the system is stable, which is defined by U < 0

1. Infinite population of clients
• Is this actually possible? No, only in the limit.
• Only one possible distribution for interarrival time.

For a proof see this pdf.

• Demonstration: binomial -> Poisson -> exponential
2. Finite population of clients - think-time model
• client works (called thinking), then server works, then client works (called thinking), etc.

### Applying Little's Formula in the Think-time Model

#### 3. Metrics

1. X - Throughput
2. R - average response time


text:
# when to use beta distribution

Posted by on Nov 28, 2020 in Uncategorized | No Comments

Let’s take the special case where α and β are integers and start with what we’ve derived above. You have to update your model as more data come in (and that’s why we use Bayesian Inference).The computation in Bayesian Inference can be very heavy or sometimes even intractable. In this case y4’s worst case lower bound probability is better than others hence Black Book makes a safe choice for readers (users, who don’t want to take risk ). Notice we don’t need to choose nor permute Xs bigger than x. … Notice the curve is now both thinner and shifted to the right (higher batting average) than it used to be. Why is it U-shaped? (Not familiar with the term “Density”? Make learning your daily ritual. The Beta distribution is a probability distribution on probabilities. You might notice that this formula is equivalent to adding a "head start" to the number of hits and non-hits of a player- you're saying "start him off in the season with 81 hits and 219 non hits on his record"). In general people first look for ratings then also look for no of people rated in scenarios like this so for most the people Black Book (700/800) will be a better choice than Red Book (2/2) this can be easily figured out by checking beta distribution with Best Worst Case Scenario. You might say we can just use his batting average so far- but this will be a very poor measure at the start of a season! Examples are the probability of success in an experiment having only two outcomes, like success and failure. I would love to know more scenarios where you have used Beta distribution in practice. Below you find an example the "Jitter $\rightarrow$ Beta" - idea in action: Given our batting average problem, which can be represented with a binomial distribution (a series of successes and failures), the best way to represent these prior expectations (what we in statistics just call a prior) is with the Beta distribution- it’s saying, before we’ve seen the player take his first swing, what we roughly expect his batting average to be. In (typical) mathematical tomfoolery, there are three dif… If you think the probability of success is very high, let’s say 90%, set 90 for α and 10 for β. The beta distributionis a continuous probability distribution that can be used to represent proportion or probability outcomes. A Beta distribution is used to model things that have a limited range, like 0 to 1 Beta distribution is best for representing a probabilistic distribution of probabilities - the case … If you do a limited number of experiments, and some are successful, you can represent what that tells you by a beta distribution. https://www.joyofdata.de/blog/an-intuitive-interpretation-of-the-beta-distribution, Why The “Greek Freak” Matters, Even Outside Of Basketball, The NCAA Twitter Account Keeps Getting Roasted During March Madness, The Slowest Players in Major League Baseball, As you can see in the plot, this distribution lies almost entirely within. “Beta distributions are very versatile and a variety of uncertanties can be usefully modelled by them. And creating one should be easy. When α <1, β<1, the PDF of the Beta is U-shaped. Hands-on real-world examples, research, tutorials, and cutting-edge techniques delivered Monday to Thursday. The new Beta distribution will be: Where α and β are the parameters we started with that is, 81 and 219. This formula finds the probability that the random variable X falls within the interval from a to b given the density function f(x). How can we prove B(α,β) = Γ(α) * Γ(β) / Γ(α+β) ? Welcome to the series of W2HDS(What, When & How in Data Science). For example, the beta distribution might be used to find how likely it is that your preferred candidate for mayor will receive 70% of the vote. The Beta-Poisson mixture is a very interesting and flexible alternative to the widely used negative binomial distribution (which is a Gamma-Poisson mixture) to model overdispersion. For example, we can use it to model the probabilities: the Click-Through Rate of your advertisement, the conversion rate of customers actually purchasing on your website, how likely readers will clap for your blog, how likely it is that Trump will win a second term, the 5-year survival chance for women with breast cancer, and so on. Refer to this link for more details. We will also have hosted notebooks where you can try these concepts by running each cells and try your experiments. In that case, why do we insist on using the beta distribution over the arbitrary probability distribution? Let's say halfway through the season he has been up to bat 300 times, hitting 100 out of those times. In our date acceptance/rejection example, the beta distribution is a conjugate prior to the binomial likelihood. The beta distribution represents continuous probability distribution parametrized by two positive shape parameters, $\alpha$ and $\beta$, which appear as exponents of the random variable x and control the shape of the distribution. The beta distribution is used for many applications, including Bayesian hypothesis testing, the Rule of Succession (a famous example being Pierre-Simon Laplace’s treatment of the sunrise problem), and Task duration modeling. If you have a good idea about the U-shaped Beta, please let me know! You can think of α-1 as the number of successes and β-1 as the number of failures, just like n & n-x terms in binomial. B(α,β) is the area under the graph of the Beta PDF from 0 to 1. In probability theory and statistics, the beta distribution is a family of continuous probability distributions defined on the interval [0, 1] parametrized by two positive shape parameters, denoted by α and β, that appear as exponents of the random variable and control the shape of the distribution. The beta distribution is used to check the behaviour of random variables which are limited to intervals of finite length in a wide variety of disciplines.. (That's because one hit doesn't really mean anything). The Beta distribution is characterized as follows. Now, lets take a scenario, you have four books in library, each book is rated by students good(1) or bad(0). If someone need to choose which Book should I read based on above ratings, one can look of these beta distribution and come up with different choosing criteria. Top 11 Github Repositories to Learn Python. Let’s say how likely someone would agree to go on a date with you follows a Beta distribution with α = 2 and β = 8. His record for the season is now 1 hit; 1 at bat. Let X_1, X_2, . You might have seen the PDF of Beta written in terms of the Gamma function. The only time I need to use the beta distribution on the website is when the alpha and beta values are integers, although the beta distribution is used for many other purposes, including cases where the alpha and beta parameters are not integers. You can experiment with different values of α and β and visualize how the shape changes. One of the most interesting outputs of this formula is the expected value of the resulting Beta distribution, which is basically your new estimate. Take a look, I created my own YouTube algorithm (to stop me wasting time), All Machine Learning Algorithms You Should Know in 2021, Object Oriented Programming Explained Simply for Data Scientists. You see a number of instances of some integer minus 1. Notes: (1) If we had used the noninformative prior distribution $\mathsf{Unif}(0,1) \equiv \mathsf{Beta}(1,1),$ then the posterior distribution would have been $\mathsf{Beta}(621,381)$ with a 95% posterior probability interval $(0.589, 0.650).$ This is numerically the same (to three places) as a frequentist Agresti-style 95% confidence interval for $\theta$. Read “PDF is NOT a probability”). . This section is for the proof addict like me. Beta distribution is a distribution of probabilities. I really like to thank David Robinson for explaining the beta distribution from a baseball angle. As a data/ML scientist, your model is never complete. What is the probability that your success rate will be greater than 50%? More concretely: If you have test with $$k$$ success amongst $$n$$ trials, your posterior distribution is $$Beta(k+1, n-k+1)$$, and this is preferable to using $$N(k/n, \sqrt{(k/n)(1-k/n)n^{-1}})$$. Imagine the player gets a single hit. You just got a probability distribution that can be used to model the probability. In other words, the probability is a parameter in binomial; In the Beta, the probability is a random variable. I don’t have an answer for this one yet. Use the Beta Distribution When you have a k-successes-out-of-n-trials-type test, you should use the Beta distribution to model your posterior distributions instead of using the normal approximation. The beta distribution is especially suited to project/planning control systems like PERT and CPM because the function is constrained by an interval with a minimum (0) and maximum (1) value. . The following is a proof that is a legitimate probability density function. Statistics - Beta Distribution - The beta distribution represents continuous probability distribution parametrized by two positive shape parameters, $\alpha$ and $\beta$, which appear as ex


text:
# GuaSS law Might be Helpfull Here..!!

Consider two charges $$Q$$ and $$q$$. An electrostatic electric field line exits the positive charge $$Q$$ at 36 degrees and enters the negative charge $$q$$ at 180 degrees, as shown in the figure above. What is the magnitude of ratio of charges $$Q/q$$?

Details and Assumptions

• Use $$\sin(\pi/10)=0.309$$
• The given figure is a rough idea for this problem (Plz feel it), and sorry for inconvenient figure.
• This is not original Question
×


text:
# [Pw_forum] Reference of example07 (version 4.2.1) (Eyvaz Isaev)

Vo, Trinh (388C) Trinh.Vo at jpl.nasa.gov
Thu Dec 30 21:48:33 CET 2010

Dear Paul,

How are you?  I hope you are fine and enjoying the holidays.

I filled out the tie card today.  I saw one of the funding is  not there: the TE funding.  The ABSCO, I think, will be out in the next week.  If you don’t mind, could you renew these 2 funding if possible.  You don’t have to do it now, since it is holiday time now, and you probably have your own plan in the holidays.   I just let you know in advance since the week after New Year, I will need them for charging the time card.

I emailed you the data last week of the nscf run using the scf 9x9x9.  I am waiting for your calculation of Seebeck coefficient, so that I can decide whether I should run the scf 9x9x9 for the one atom case.   I don’t mean to ask you to do it now since it is your holidays, and you need to enjoy too.

I will fly back on Jan. 3, and from Jan 4 to Jan 6, I have class.  I am not sure if I can do anything much after the class.  I will try to work if I am not very tired.    See you after Jan. 6.

HAPPY NEW YEAR!

Trinh

On 12/30/10 8:37 AM, "Eyvaz Isaev" <eyvaz_isaev at yahoo.com> wrote:

Dear Zhou,

It is a good idea citing  the paper as it contains all formulas used to calculate \lambda.

Bests,
Eyvaz.

________________________________
From: Xiang-FengZhou <zxf888 at 163.com>
To: pw_forum at pwscf.org
Sent: Thu, December 30, 2010 2:58:20 PM
Subject: Re: [Pw_forum] Reference of example07 (version 4.2.1) (Eyvaz Isaev)

Dear Eyvaz,
Thanks a lot for such quick response. I want to know the current method which is just implemented in espresso-4.2.1.
I guess it may be arXiv:cond-mat/0504077v2 <http://arxiv.org/abs/cond-mat/0504077v2>  with the title "Origins of low- and high-pressure discontinuities of Tc in niobium".
But I am not very sure about it.
Best regards,
Xiang-Feng Zhou
Nankai University

>Subject: Re: [Pw_forum] Reference of example07 (version 4.2.1)
>To: PWSCF Forum <pw_forum at pwscf.org>
>Message-ID: <642054.81981.qm at web65713.mail.ac4.yahoo.com>
>Content-Type: text/plain; charset="us-ascii"
>
>Hi,
>
>>From: Xiang-FengZhou <zxf888 at 163.com>
>
>>which will be the best reference for the example07 (electron-phonon calculation)
>>within the >version of 4.1 or 4.2.1 ?
>If you mean which one 4.1 or 4.2.1 is better for \lambda calculations, you can
>use both,   in my experience I do not see any difference between&n bsp;them.
>
>
>You can try CVS version which should give additional information (lambda.out)
>with \lambda and T_c). Hopefully it contains changes I have made in July.
>
>
>Bests,
>Eyvaz.
> -------------------------------------------------------------------
>Prof. Eyvaz Isaev,
>Department of Physics, Chemistry, and Biology (IFM), Linkoping University,
>Sweden
>
>Theoretical Physics Department, Moscow State Institute of Steel & Alloys,
>Russia,
>
>isaev at ifm.liu.se, eyvaz_isaev at yahoo.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quantum-espresso.org/pipermail/users/attachments/20101230/22e146a8/attachment.html>


text:
# On asymptotic properties of the sum of consecutive powers

For positive integers $p, n$, the sum of consecutive $p$-th powers is $$S_p(n) := \sum_{k=1}^n k^p.$$ From Asymptotic behaviour of sums of consecutive powers we have that $S_p(n)/n^{p+1}$ is decreasing when viewed as a function of $p$ (with $n$ fixed). Can we be more precise? Say can we compute the limit of $S_p(n)/n^{p+1}$ as $p \to \infty$? Thanks.

• I am not following: since $n$ is fixed, it suffices to compute the limit of $k^p/n^{p+1}$ for each $1\le k\le n$. Is this out of reach? – Did Sep 14 '15 at 19:54
• since $n$ is fixed, I don't think that Riemann Sums are really applicable – robjohn Sep 14 '15 at 19:56
• Oh I see. You guys are funny :) – user152169 Sep 14 '15 at 19:57

We have $$\frac{S_p(n)}{n^{p+1}} = \frac{1}{n} \left( \frac{1}{n^p} + \left(\frac{2}{n}\right)^p + \dotsb + \left(\frac{n-1}{n}\right)^p + 1 \right).$$ Now, $n$ is fixed, so if we take the limit as $p \to \infty$, we can push it inside the sum. Every term in the sum is the $p$th power of a number in $(0,1)$ apart from the last one. Therefore every term in the sum tends to zero except the last one, and $$\lim_{p \to \infty} \frac{S_p(n)}{n^{p+1}} = \frac{1}{n}.$$
• But the number of terms in the sum is also a function of $p$. Something needs to be said to justify interchanging the sum and limit. – Jair Taylor Sep 14 '15 at 19:37
• @JairTaylor: no, $n$ is fixed. The number of terms does not change. I was about to post the same answer (with some notation changes), so I am pretty sure that this is correct. – robjohn Sep 14 '15 at 19:49


text:
# Electric potential and length of wire?

The formula of electric potential is $$V=\frac{kQ}{r}$$ and the voltage across two points is $a$ and $b$ that determines the work of the electric field on a charge $q_1$ from $a$ to $b$.

If, say, we have short wire and make a circuit with a power source, then there would be some voltage. Now if we use a long wire instead of short wire, isn't now the distance increased between $a$ and $b$? So why does the voltage remain same if we consider the wire conductivity 100%? If we use the above formula then it means that the voltage must decrease. So how does all this happen?

Outside of a static spherically symmetric charge distribution with total charge $Q$, the electric potential is indeed given by the formula you quote.
Your formulae $$V=\frac{kQ}{r}$$ is for the potential of a point charge in an infinite non-conductive medium. Simply put,it doesn't apply to the case within an electric wire which in the ideal case is what is known as a equipotential i.e. "at the same voltage". Of course in the real world you can have a voltage drop along the length of the wire when current flows.