text:
# What would be the variance for complex number?

When $x$ is a zero mean random variable then

$$\sum_{n=1}^N x_n x_n^T = N \sigma^2_x\,\text,$$

where the variance is $\sigma^2_x$.

I'm considering Complex Normal Distributions where the real and imaginary part are uncorrelated.

https://en.wikipedia.org/wiki/Complex_normal_distribution explains about the form of the distribution for complex normal distribution.

I have a confusion because the denominator for the real case in the distribution has a 2 but for the complex that is not there.

Does this mean that if $x$ is a complex valued random variable, then the variance becomes half i.e., $$\sum_{n=1}^N x_n x_n^H = N \sigma^2_x/2\,\text,$$ where the variance is $\sigma^2_x/2$ because the variance gets equally distributed in the real and imaginary component?

I have this doubt because when implementing, if I need to generate a complex noise of variance 1, I would be doing (in Matlab)

noise = sqrt(1/2) * (randn(N,1) + 1j*randn(N,1))

Since each component (real and imaginary) needs to have variance 1/2, such that their sum becomes 1.

So, the variance $\sigma^2$ is half mathematically. Is my understanding correct?

UPDATE based on valuable information provided under the comments : I am considering at the circularly symmetric complex normal distribution, where real and imaginary part are completely uncorrelated.

• (also, I have my slight problems with your initial statement. The CLT is a limit theorem, and hence, the $=$ is not generally true, unless you let $N\rightarrow\infty$). – Marcus Müller Apr 17 '17 at 16:17
• You are correct, in my case the real and imaginary part are uncorrelated. I don't know what the expression for the estimator of the variance or in general $\Sigma x_n x_n^H$ would be. Thank you for your followup. Appreciate your help. – Ria George Apr 17 '17 at 16:28
• @MarcusMüller: Why did you delete your answer? Your answer was helpful, only thing I wanted to confirm in the comment which I wrote after your answer was if the expression $\Sigma x_n x_n ^H$ would evaluate to $N\sigma^2_x/2$ or not – Ria George Apr 17 '17 at 17:11
• if the real and imaginary are uncorrelated – Ria George Apr 17 '17 at 17:16
• Aside from the part that I got wrong, you can find any formula directly on Wikipedia's Normal Distribution article, so my answer has no value that you couldn't have found with minutes of reading, thus I deleted it :) – Marcus Müller Apr 17 '17 at 17:34

I will focus on the reason of the factor $$1/2$$ and leave aside the estimation things.

The exact understanding should be : if a scalar Gaussian random variable (rv) is circular symmetric, its real and imaginary parts must be uncorrelated (this is equivalent to independence if they are assumed jointly Gaussian) and identically distributed with zero mean. Thus, your Matlab code is correct for a rv $$\sim \mathcal{CN}(0,1)$$.

The story behind is that a complex random variable (rv) is simply a vector of two real random variables. A vector of $$n$$ complex rv is indeed a vector of $$2n$$ real rv.

You are talking about the case $$n=1$$, 1 complex Gaussian rv $$Z = Z_r + jZ_i$$ or a vector of 2 real Gaussian rv $$[Z_r,Z_i]^T$$. As with real Gaussian rv which is described by its variance, a real vector $$[Z_r,Z_i]^T$$ must be described by its covariance matrix $$\mathbb{E}\left\lbrace [Z_r,Z_i]^T \times [Z_r,Z_i] \right\rbrace = \mathbb{E}\left\lbrace\begin{bmatrix} Z_r^2 & Z_rZ_i \\ Z_iZ_r & Z_i^2 \\ \end{bmatrix}\right\rbrace$$

Take a look at the variance $$\mathbb{E}\left\lbrace ZZ^H \right\rbrace = \mathbb{E}\left\lbrace Z_r^2+Z_i^2 \right\rbrace$$ and pseudo-variance $$\mathbb{E}\left\lbrace ZZ^T \right\rbrace = \mathbb{E}\left\lbrace Z_r^2-Z_i^2+j2Z_rZ_i \right\rbrace$$, the covariance matrix of real vector (or complex scalar) is fully described by the variance and pseudo-variance. Threfore, you need both variance and pseudo-variance to characterize a complex Gaussian rv (with the prior condition that its real and imaginary parts are jointly Gaussian).

Now we use the circular symmetry property : $$e^{j\phi}Z$$ has the same probability distribution as $$Z$$ for all real $$\phi$$. This leads to $$\mathbb{E}\left\lbrace e^{j\phi}Z(e^{j\phi}Z)^T \right\rbrace = \mathbb{E}\left\lbrace e^{j2\phi}ZZ^T \right\rbrace = \mathbb{E}\left\lbrace ZZ^T \right\rbrace$$ for all $$\phi$$ thus $$E[ZZ^T] = 0$$ and variance $$\mathbb{E}\left\lbrace ZZ^H \right\rbrace$$ is sufficient statistic for $$Z$$. Note that $$\mathbb{E}\left\lbrace ZZ^T \right\rbrace = \mathbb{E}\left\lbrace Z_r^2-Z_i^2+j2Z_rZ_i \right\rbrace \implies \mathbb{E}\left\lbrace Z_r^2 \right\rbrace = \mathbb{E}\left\lbrace Z_i^2 \right\rbrace$$ and $$\mathbb{E}\left\lbrace Z_rZ_i \right\rbrace=0$$, the real and imaginary parts are uncorrelated then independent (because they are Gaussian), with the same variance, this is the reason of the factor $$1/2$$.

To sum up, your code is correct because you are estimating circular symmetric complex Gaussian rv. The jointly Gaussian assumption between real and imaginary parts must be used. If this is not about circular symmetric rv (or real random vector with two elements), you must calculate the pseudo-variance.

For more details and to understand the formula of the wikipedia article, you can read this article Circular Symmetric Gaussian R.Gallager.

• My answer is indeed a quick draft of the article rle.mit.edu/rgallager/documents/CircSymGauss.pdf that I find extremely intituitive to understand Gaussian random variable/vector/matrix. – AlexTP Apr 17 '17 at 20:41
• Thumbs up for the reference – Laurent Duval Apr 17 '17 at 20:47
• Thank you for your reply. WOuld the pdf for the complex case be given by the pdf in the link en.wikipedia.org/wiki/… ? There the pdf has 2 in the denominator . To simplfy things, I was considering the bivariate case $\Sigma = [\sigma_1^2 , 0; 0, \sigma_2^2]$. So for $N$ samples, the joint pdf would turn out to be $P_x(x_1,x_2,...,x_N) = \prod_{n=1}^N\frac{1}{\pi \sigma^2_x} \exp \bigg(\frac{-{(({x}))}^H (({x}))}{\sigma^2_x} \bigg)$ Would there be a 2 in the denominator in the pdf expression? Is this correct? – Ria George Apr 17 '17 at 21:03
• where $\sigma_1^2$ is the variance for real component and $\sigma_2^2$ of the complex rv $x$ – Ria George Apr 17 '17 at 21:04
• I am sorry I think I don't get what you are talking. In the wikipedia article, it is stated clearly that the pdf is for the real vector : where is a real k-dimensional column vector*. In real vector, you have factor 2, in complex vector, pdf does not have factor 2. In the document I cited, the proof is clear and easy to follow. – AlexTP Apr 18 '17 at 6:14


text:
blob: 14e6aa8f4e7404a92ccdbeefe939956d28fd7290 [file] [log] [blame]
 N4JS Design Specification

5. Parser

Some of the concepts described here were presented at EclipseCon 2013 and XtextCon 2014. Note that the material presented at the linked videos may be outdated.

5.1. Overview

The parser is created from an Xtext grammar. Actually, there are several grammars used as shown in Figure CD Grammars. These grammars and the parsers generated from them are described more closely in the following sections.

Figure 2. N4 Grammars

5.2. N4JS Parser

One of the most tricky parts of JavaScript is the parsing because there is a conceptual mismatch between the ANTLR runtime and the specified grammar. Another challenge is the disambiguation of regular expressions and binary operations. Both features require significant customizing of the generated parser (see figure below).

Figure 3. Overview custom parser implementation (runtime only)

5.3. Parser Generation Post-Processing

The ANTLR grammar that is generated by Xtext is post-processed to inject custom code into the grammar file before it is passed to the ANTLR tool. This is required in particular due to ASI (Automated Semicolon Insertion), but for some other reasons as well.

Actually, there are several injections:

1. Due to Xtext restrictions, the generated ANTLR grammar file (*.g) is modified. This means that some some additional actions are added and some rules are rewritten.

2. Due to ANTLR restrictions, the generated ANTLR Java parser (*.java) os modified. This means that some generated rules are slightly modified to match certain requirements.

3. Due to Java restrictions, the generated Java parser needs to be preprocessed in order to reduce the size of certain methods since they must not exceed 64k characters. This is implemented by means of an MWE fragment, activated after the other post processing steps are done.

The first two steps are handled by AntlrGeneratorWithCustomKeywordLogic, which is configured with additional helpers in GenerateN4JS.mwe2. shows the customized classes which modify the code generation. These classes are all part of the releng.utils bundle.

Figure 4. Class Diagram Parser Generation

5.3.1. Automatic Semicolon Insertion

The EcmaScript specification mandates that valid implementations automatically insert a semicolon as a statement delimiter if it is missing and the input file would become invalid due to the missing semicolon. This is known as ASI. It implies that not only valid implementations have to perform this, but a valid parser has to mimic this behavior in order to parse executable code. The ASI is implemented by two different means.

The parser’s error recovery strategy is customized so it attempts to insert a semicolon if it was expected. Both strategies have to work hand in hand in order to consume all sorts of legal JavaScript code.

5.3.1.1. Injected code in the Antlr grammar file

Under certain circumstances, the parser has to actively promote a token to become a semicolon even though it may be a syntactically a closing brace or line break. This has to happen before that token is consumed thus the rules for return statements, continue statements and break statements are enhanced to actively promote these tokens to semicolons.

The same rule is applied to promote line breaks between an expression and a possible postfix operator ++ or . At this location the line break is always treated as a semicolon even though the operator may be validly consumed and produce a postfix expression.

In both cases, the method promoteEOL() is used to move a token that may serve as an automatically injected semicolon from the so called hidden token channel to the semantic channel. The hidden tokens are usually not handled by the parser explicitly thus they are semantically invisible (therefore the term hidden token). Nevertheless, they can be put on the semantic channel explicitly to make them recognizable. That’s implemented in the EOL promotion. The offending tokens include the hidden line terminators and multi-line comments that include line breaks. Furthermore, closing braces (right curly brackets) are included in the set of offending tokens as well as explicit semicolons.

5.3.1.2. Customized error recovery

Since the EOL promotion does not work well with Antlr prediction mode, another customization complements that feature. As soon as an invalid token sequence is attempted to be parsed and missing semicolon would make that sequence valid, an offending token is sought and moved to the semantic channel. This is implemented in the custom recovery strategy.

5.3.2. Async and No line terminator allowed here Handling

There is no way of directly defining No line terminator allowed here. This is required not only for ASI, but also for async. This requires not only a special rule (using some rules from ASI), but also a special error recovery since the token ’async’ may be rejected (by the manually enriched rule) which is of course unexpected behavior from the generated source code.

5.3.3. Regular Expression

The ANTLR parsing process can basically be divided into three steps. First of all, the file contents has to be read from disk. This includes the proper encoding of bytes to characters. The second step is the lexing or tokenizing of the character stream. A token is a basically a typed region in the stream, that is a triplet of token-id, offset and length. The last step is the parsing of these tokens. The result is a semantic model that is associated with a node tree. All necessary information to validate the model can be deduced from these two interlinked representations.

Figure 5. Simplified visualization of the parsing

Since the default semantics and control flow of Antlr generated parsers do not really fit the requirements of a fully working JavaScript parser, some customizations are necessary. Regular expression literals in JavaScript cannot be syntactically disambiguated from div operations without contextual information. Nevertheless, the spec clearly describes, where a regular expression may appear and where it is prohibited. Unfortunately, it is not possible to implement these rules in the lexer alone, since it does not have enough contextual information. Therefore, the parser has been enhanced to establish a communication channel with the lexer. It announces when it expects a regular expression rather than a binary operation.

This required a reworking of the Antlr internals. Instead of a completely pre-populated TokenStream, the parser works on a lazy implementation that only reads as many characters as possible without a disambiguation between regular expression literals and divide operators.

Only after the parser has read this buffered tokens and potentially announced that it expects a regular expression, another batch of characters is processed by the lexer until the next ambiguous situation occurs. This is fundamentally different from the default behavior of Antlr.

Figure 6. Abstract control and object flow during parsing

shows the involved classes which allow for this lexer-parser communication.

Figure 7. Class Diagram Parser-Lexer Communication

5.3.4. Unicode

Unicode support in JavaScript includes the possibility to use unicode escape sequences in identifiers, string literals and regular expression literals. Another issue in this field is the specification of valid identifiers in JavaScript. They are described by means of unicode character classes. These have to be enumerated in the terminal rules in order to fully accept or reject valid or invalid JS identifiers.

For that purpose, a small code generator is used to define the terminal fragments for certain unicode categories. The UnicodeGrammarGenerator basically iterates all characters from Character.MIN_VALUE to Character.MAX_VALUE and adds them as alternatives to the respective terminal fragments, e.g. UNICODE_DIGIT_FRAGMENT.

The real terminal rules are defined as a composition of these generated fragments. Besides that, each character in an identifier, in a string literal or in a regular expression literal may be represented by its unicode escape value, e.g.  u0060. These escape sequences are handled and validated by the IValueConverter for the corresponding terminal rules.

The second piece of the puzzle are the unicode escaped sequences that may be used in keywords. This issue is covered by the UnicodeKeywordHelper which replaces the default terminal representation in the generated Antlr grammar by more elaborated alternatives. The keyword if is not only lexed as ’if’ but as seen in snippet Terminal if listing.

Terminal if
If :
( 'i' | '\\' 'u' '0   0   6   9' )
( 'f' | '\\' 'u' '0   0   6   6' );

5.3.5. Literals

Template literals are also to be handled specially, see TemplateLiteralDisambiguationInjector for details.

5.4. Modifiers

On the AST side, all modifiers are included in a single enumeration N4Modifier. In the types model however, the individual modifiers are mapped to two different enumerations of access modifiers (namely TypeAccessModifier and MemberAccessModifier) and a number of boolean properties (in case of non-access modifiers such as abstract or static). This mapping is done by the types builder, mostly by calling methods in class ModifierUtils.

The grammar allows the use of certain modifiers in many places that are actually invalid. Rules where a certain modifier may appear in the AST are implemented in method isValid(EClass,N4Modifier) in class ModifierUtils and checked via several validations in N4JSSyntaxValidator. Those validations also check for a particular order of modifiers that is not enforced by the grammar.

See API documentation of enumeration N4Modifier in file N4JS.xcore and the utility class ModifierUtils for more details.

5.5. Conflict Resolutions

5.5.1. Reserved Keywords vs. Identifier Names

Keywords and identifiers have to be distinguished by the lexer. Therefore, there is no means to decide upfront whether a certain keyword is actually used as a keyword or whether it is used as an identifier in a given context. This limitation is idiomatically overcome by a data type rule for valid identifiers. This data type rule enumerates all keywords which may be used as identifiers and the pure IDENTIFIER terminal rule as seen in Keywords as Identifier listing.

Keywords as Identifier
N4JSIdentifier: IDENTIFIER
| 'get'
| 'set'
...
;

5.5.2. Operators and Generics

The ambiguity between shift operators and nested generics arises also from the fact, that Antlr lexer upfront without any contextual information. When implemented naively, the grammar will be broken, since a token sequence a>>b can either be part of List<List<a>> b or it can be part of a binary operation int c = a >> b. Therefore the shift operator may not be defined with a single token but has to be composed from individual characters (see Shift Operator listing).

Shift Operator listing
ShiftOperator:
'>' '>' '>'?
| '<' '<'
;
This section may be outdated!

The CA parser also needs adjustments for supporting automatic semicolon insertion and regular expressions. Instead of modifying the CA parser generator similar to the normal parser, the former reuses parts of the latter as far as possible. That is, the token sequence that is produced during production parsing is used as is for the content assist parser. Semicolons have already been inserted where appropriate and regular expression are successfully distinguished from divide operators.

Since the n4js grammar uses syntactic predicates, the content assist parser is compiled with backtracking enabled. This is always the case for Xtext’s CA parsers that rely on backtracking or predicates (local backtracking) in the production parser. This approach is both good (CA works in general) and bad (unpredictable decisions in case of error at locations prior to the cursor). Since parsing with backtracking enabled makes for a fundamental difference in how the prediction and parsing works and how the parser decides which decision paths to take, the customization patterns from the production parser are not applied 1:1 to the CA parser, but adapted instead. The content assist parser doesn’t use a freshly lexed token stream with unicode support, ASI or regular expression literals, but instead uses a synthesized token sequence which is rebuilt from the existing node model.

The token stream that is consumed by the content assist parser is therefore not created by a lexer but by the org.eclipse.n4js.ui.contentassist.NodeModelTokenSource. It traverses the existing node model that is contained in the resource and was produced by the production parser. This approach has the significant advantage that any decision that was made by that parser is also immediately applicable to the content assist infrastructure. For that purpose, the leaf nodes of the node model are mapped to ANTLR token types. This is achieved by the org.eclipse.n4js.ui.contentassist.ContentAssistTokenTypeMapper which is capable to provide the untyped ANTLR token type (primitive int) for a given grammar element.

Special considerations have been made for the last token in the produced source. If it overlaps with an existing leaf node but does not fully cover it, the plain Antlr lexer is used to consume the prefix that is overlapping. Since the terminals will never overlap with each other the longest match always wins without backtracking in the lexer, it is save to assume that only one token is produced from the prefix. The very last token in the org.eclipse.n4js.ui.contentassist.NodeModelTokenSource is always the EOF token (org.antlr.runtime.Token.EOF_TOKEN).

Given that the token source is equal to the prefix in the production token source, some more thought has to be put into the synthesized end of file. The production parser used the complete file to decide where to automatically insert a semicolon and where not to. This would potentially change if there was another token next to the artificial EOF. Therefore, two cases have to considered. The first one describes CA request next to an automatically inserted semicolon and the second one describes CA requests at a position where a semicolon could have been inserted if the token to the right was another one. The org.eclipse.n4js.ui.contentassist.CustomN4JSParser reflects these cases. Heuristics are applied to the end of the token sequence to decide whether a second pass has to be performed to collect yet more following elements. Based on the concrete sequence, the last automatically inserted semicolon is removed from the sequence prior to the second pass or such is a token is explicitly synthesized and appended. Besides the second pass, another special treatment is made for postfix expressions. Those may not be interrupted by a hidden semicolon so those are filtered from the resulting follow set if appropriate.

The parser is used by the org.eclipse.n4js.ui.contentassist.ContentAssistContextFactory where all relevant entry points from the super class are specialized to pass the node model in the the parser facade (org.eclipse.n4js.ui.contentassist.CustomN4JSParser). In that sense, the ContentAssistContextFactory serves as a drop-in replacement binding the default ParserBasedContentAssistContextFactory.StatefulFactory.

format: plain


text:
# pyspark.sql.functions.asc¶

pyspark.sql.functions.asc(col: ColumnOrName) → pyspark.sql.column.Column

Returns a sort expression based on the ascending order of the given column name.


text:
# Find The Region

Find the region enclosed by one leaf of the function r=2 sin2θ

Now i know how the diagram looks like for this function.
The diagram can be obtained by using :

x= r cosθ = 2 sin2θ cosθ
y= r sinθ = 2 sin2θ sinθ

Now i have to find the region enclosed by one of the leaves which i am not able to do.
I know i have to use the jacobian and also that i can use the above as cylindrical coordinates but what do i integrate? i dont know which function to integrate.

Any Suggestions for that??

thank you

## Answers and Replies

$$\frac{1}{2}\int r^{2} .d\theta$$

You can use that formula

berkeman
Mentor
$$\frac{1}{2}\int r^{2} .d\theta$$

You can use that formula

Wouldn't it be $$\int r d\theta$$

I could be missing something of course...

Is the half for finding each half of the region of the leaf?


text:
# Math Help - Derivative Tutorial

1. Consider this way of differentiating...I have never seen it done...but it is an adaptation of logarithimic differentiating so I am sure other people have done it

It goes something like this...say you have $y=f(u(x))$....now say that $f(x)$ is difficult to integrate....why not then do this

[math\f^{-1}(y)=u(x)[/tex]

For example this is a way to either be a smart*** on a test if you forget or it is a way I have discovered of proving a trigonometric identity

$y=sin^{-1}(x)$......say you forget that derivative...well do this

$\sin(y)=x$...differentiating we see that

$y'\cdot\cos(y)=1\Rightarrow{y'=\frac{1}{cos(y)}}\R ightarrow{y'=\frac{1}{\cos(\sin^{-1}(x))}}$

The trig proof comes from the fact taht $y=sin^{-1}(x)\Rightarrow{y'=\frac{1}{\sqrt{1-x^2}}}$

Now since $y'=y'\Rightarrow{\frac{1}{\cos(\sin^{-1}(x))}=\frac{1}{\sqrt{1-x^2}}}\Rightarrow{\cos(\sin^{-1}(x))=\sqrt{1-x^2}}$

which is a famous identity...this can be done for most things

Another example would be $y=\ln(u(x))$

Forget how to take the derivative of ln(x)? Do this...

$e^{y}=u(x)\Rightarrow{y'\cdot{e^{y}}=u'(x)}\Righta rrow{y'=\frac{u'(x)}{e^{y}}}$

Now making the sub $y=\ln(u(x))$ we get

$y'=\frac{u'(x)}{e^{\ln(u(x))}}=\frac{u'(x)}{u(x)}$

which is the derivative of ln((u(x))

2. This is another messy general case integral

We have $\int_0^{\infty}e^{-ax}sin(bx)dx$

Ok first we realized that $\int_0^{\infty}f(x)=\bigg[\int{f(x)}dx\bigg]\bigg|_0^{\infty}$

So first we want to compute $\int{e^{-ax}\sin(bx)}dx$

So first using parts we get $\int{e^{-ax}\sin(bx)dx}=\frac{-\sin(bx)e^{-ax}}{a}+\frac{b}{a}\int{e^{-ax}\cos(bx)dx}$

Then using integration by parts again we get $\int{e^{-ax}\sin(bx)dx}=\frac{-\sin(bx)e^{-ax}}{a}+\frac{b}{a}\bigg[\frac{-\cos(bx)e^{-ax}}{a}-\frac{b}{a}\int{e^{-ax}\sin(bx)dx}\bigg]$

Distributing we get $\int{e^{-ax}\sin(bx)dx}=\frac{-\sin(bx)e^{-ax}}{a}-\frac{b\cos(bx)e^{-ax}}{a^2}-\frac{b^2}{a^2}\int{e^{-ax}\sin(bx)dx}$

adding the integral to each side we get $\frac{b^2}{a^2}\int{e^{-ax}\sin(bx)dx}+\int{e^{-ax}\sin(bx)dx}=\frac{-\sin(bx)e^{-ax}}{a}-\frac{b\cos(bx)e^{-ax}}{a^2}$

$\Rightarrow{(1+\frac{b^2}{a^2})\int{e^{-ax}\sin(bx)dx}=\frac{-\sin(bx)e^{-ax}}{a}-\frac{b\cos(bx)e^{-ax}}{a^2}}$

before dividing I would like to simplify the right side to get $e^{-ax}+\bigg[\frac{-\sin(bx)}{a}-\frac{\cos(bx)}{a^2}\bigg]$

Now dividing we get $\int{e^{-ax}\sin(bx)dx}=\frac{e^{-ax}\bigg[\frac{-\sin(bx)}{a}-\frac{b\cos(bx)}{a^2}\bigg]}{1+\frac{b^2}{a^2}}$

Multiplying top and bottom by $a^2$ we get

$\int{e^{-ax}\sin(bx)dx}=\frac{e^{-ax}\bigg[-\sin(bx)\cdot{a}-b\cos(bx)\bigg]}{a^2+b^2}$

and as was stated earlier $\int_0^{\infty}{e^{-ax}\sin(bx)dx}=\bigg[\frac{e^{-ax}\bigg[-\sin(bx)\cdot{a}-b\cos(bx)\bigg]}{a^2+b^2}\bigg]\bigg|_0^{\infty}=\frac{b}{a^2+b^2}$

Wow that took like 25 minutes to type ...I think thats right....o wait...now I know it is I found that integral in my books...I know the asnwer but I did the integral myself...hope I did it right

3. The whole thing is messy

I need nearly a minute to display correctly a page :/

More organization won't be extra luxury ^^'

4. Originally Posted by Moo
The whole thing is messy

I need nearly a minute to display correctly a page :/

More organization won't be extra luxury ^^'
Haha...I know it took me seven minutes to DO it...and like 30 minutes to type it lol

5. Another simpler yet not easy general case indefinite integral

$\int_0^{a}\frac{x^2+b^2}{x^2+a^2}dx$

First we use the +0 trick to obtian

$\int\frac{x^2+a^2+b^2-a^2}{x^2+a^2}dx=\int\frac{x^2+a^2}{x^2+a^2}+\int\f rac{b^2-a^2}{x^2+a^2}dx=\int{dx}+\int\frac{b^2-a^2}{x^2+a^2}dx$

Now by evaluating the first integral and factoring out a constant in the second we get

$x+(b^2-a^2)\int\frac{1}{x^2+a^2}dx$

where it becomes apparent the second integral is an arctan integral

$x+\frac{b^2-a^2}{a}arctan\bigg(\frac{x}{a}\bigg)$

Now by evaluating from 0 to a we get (for space's sake F(0)=0)

$\int_0^{a}\frac{x^2+b^2}{x^2+a^2}dx=a+\frac{b^2-a^2}{a}arctan\bigg(\frac{a}{a}\bigg)=a+\frac{b^2-a^2}{a}\cdot\frac{\pi}{4}$ $=\frac{4a^2+(b^2-a^2)\pi}{4a}=\frac{(4-\pi)a^2+b^2\pi}{4a}=\frac{(4-\pi)a}{4}+\frac{b^2\pi}{4a}$

This is an integral where the simplification is two thirds of the work

6. Originally Posted by Mathstud28
This is another messy general case integral

We have $\int_0^{\infty}e^{-ax}sin(bx)dx$
Integration by parts it's a really waste of time. I do prefer (and I think teachers could show this to their students) to rewrite $e^{-ax}\sin(bx)=\text{Im }\Big\{e^{-x(a-bi)}\Big\}.$ From here we only have to compute $\text{Im }\frac1{a-bi}$ and we're done.

7. Originally Posted by Krizalid
Integration by parts it's a really waste of time. I do prefer (and I think teachers could show this to their students) to rewrite $e^{-ax}\sin(bx)=\text{Im }\Big\{e^{-x(a-bi)}\Big\}.$ From here we only have to compute $\text{Im }\frac1{a-bi}$ and we're done.
I am sorry...you have to remember that I am only in Calc II or the equivalent...coud you explain further...you are using someting like arg? I think Im() stands for image which I know to be synonomous with range? Please explain thoroughly if you have time....thanks so much in advance

8. Originally Posted by Mathstud28
I am sorry...you have to remember that I am only in Calc II or the equivalent...coud you explain further...you are using someting like arg? I think Im() stands for image which I know to be synonomous with range? Please explain thoroughly if you have time....thanks so much in advance
he is talking about interpreting the problem in the realm of complex analysis. "Im" stands for "imaginary part", that is, the coefficient of i in a complex number. don't worry about it if you have not done it... unless you are intrigued of course and want to learn more

9. Originally Posted by Jhevon
he is talking about complex analysis. "Im" stands for "imaginary part", that is, the coefficient of i in a complex number. don't worry about it if you have not done it... unless you are intrigued of course and want to learn more
Jhevon...its math...math I dont knwo...of course I am intrigued! Teach me teach me!

10. Originally Posted by Mathstud28
Jhevon...its math...math I dont knwo...of course I am intrigued! Teach me teach me!
It is perhaps better that you are taught by the master. i will allow Krizalid to offer a response. if he is not so inclined, then i will explain it.

for the record, I am sure you will enjoy complex analysis when you take it! it is a really fun part of math, ask anyone

11. Originally Posted by Jhevon
It is perhaps better that you are taught by the master. i will allow Krizalid to offer a response. if he is not so inclined, then i will explain it.

for the record, I am sure you will enjoy complex analysis when you take it! it is a really fun part of math, ask anyone
I know ...I am really excited...I want to do it now haha...I dont have the neccasary skill set yet do I?

12. There's no much here, for purely complex let $\sin x=\text{Im\,}(e^{ix})$ & $\cos x=\text{Re\,}(e^{ix}).$ (Where $\text{Re}$ denotes the real part.) Now apply this to that integral and use a well known fact (easy to prove) $\frac1x=\int_0^\infty e^{-xy}\,dy$ for $x>0.$

See also Euler's formula.

13. Originally Posted by Mathstud28
I know ...I am really excited...I want to do it now haha...I dont have the neccasary skill set yet do I?
actually, i think you do...

Originally Posted by Krizalid
There's no much here, for purely complex let $\sin x=\text{Im\,}(e^{ix})$ & $\cos x=\text{Re\,}(e^{ix}).$ (Where $\text{Re}$ denotes the real part.) Now apply this to that integral and use a well known fact (easy to prove) $\frac1x=\int_0^\infty e^{-xy}\,dy$ for $x>0.$

See also Euler's formula.
well you could give Euler's formula and explain how we treat a + ib as a constant and all that...

14. Originally Posted by Jhevon
actually, i think you do...

well you could give Euler's formula and explain how we treat a + ib as a constant and all that...
OHh...now I see sort of where this is coming from...I know Euler's formula to be $e^{ix}=\cos(x)+i\sin(x)$...so then obviously the real part (i.e. $Re[e^{ix}]$) is cos(x) and the imaginary part(i.e. $Im[e^{ix}]$) is sin(x)...ok so I understand that and the other part about the identity makes sense since $\int_0^{\infty}e^{-xy}dy=\frac{-e^{-xy}}{x}\bigg|_0^{\infty}=0-\frac{-1}{x}=\frac{1}{x}$...so now the cartesian form of this would be something to the affect that I use the complex argument or something on sin(x)? Could you explain from here?

15. Here just for fun I will derive all three of the "fun" trigonoetric integrals

Case $\sqrt{a^2-x^2}$

This one looks easy compared to the other two but lets start

$\int\sqrt{a^2-x^2}dx$

Let $x=a\sin(\theta)$
then $dx=a\cos(\theta)$

Then by substitution we have

$\int\sqrt{a^2-a\sin^2(\theta)}a\cos(\theta)d\theta$

$\int\sqrt{a^2(1-\sin^2(\theta))}a\cos(\theta)d\theta$

$\int\sqrt{a^2\cos^2(\theta)}a\cos(\theta)d\theta$

$a^2\int\cos^2(\theta)d\theta$

$\frac{a^2}{2}\int(1+\cos(2\theta))d\theta$...using $\cos^2(x)=\frac{1+\cos(2x)}{2}$

by integrating we get

$\frac{a^2}{2}\bigg[\theta+\frac{1}{2}\sin(2\theta)\bigg]$

using the identity $\sin(2x)=2\sin(x)\cos(x)$

we get $\frac{a^2}{2}\bigg[\theta+\sin(\theta)\cos(\theta)\bigg]$

Now using our intial substitution $x=a\sin(\theta)\Rightarrow{arcsin\bigg(\frac{x}{a} \bigg)=\theta}$

we get $\frac{a^2}{2}\bigg[arcsin\bigg(\frac{x}{a}\bigg)+sin\bigg(arsin\bigg( \frac{x}{a}\bigg)\bigg)\cos\bigg(arcsin\bigg(\frac {x}{a}\bigg)\bigg)\bigg]$

and using the fact that $cos\bigg(arcsin\bigg(\frac{x}{a}\bigg)\bigg)=\frac {\sqrt{a^2-x^2}}{a}$
and $\sin\bigg(arcsin\bigg(\frac{x}{a}\bigg)\bigg)=\fra c{x}{a}$

we see that the answer is $\frac{a^2}{2}\bigg[arcsin\bigg(\frac{x}{a}\bigg)+\frac{x\sqrt{a^2-x^2}}{a^2}\bigg]=\frac{arcsin\bigg(\frac{x}{a}\bigg)}{2a^2}+\frac{ 1}{2}x\sqrt{a^2-x^2}+C$

that took a while...so I will do the other two cases some other time...either tonight or tomorrow...I did this by hand without consulting a book...if anyone sees any errors please inform me by PM!!

Page 3 of 4 First 1234 Last


text:
# Developer handbook overview, Power BI Report Server

Welcome to the developer handbook for Power BI Report Server, an on-premises location for storing and managing your Power BI, mobile, and paginated reports.

This handbook highlights options you have, as a developer, to work with Power BI Report Server.

## Embedding

For any report within Power BI Report Server, you can embed within an iFrame by adding the querystring parameter ?rs:Embed=true to the URL. This technique works with Power BI reports as well as other report types.

### Report Viewer Control

For paginated reports, you can take advantage of the Report Viewer Control. With it, you can place the control within a .NET windows or web application. For more information, see Get started with the Report Viewer Control.

## APIs

You have several API options for interacting with Power BI Report Server. This technique includes the following.

You can also use the open-source PowerShell utilities to manage your report server.

Note

The PowerShell utilities support Power BI Desktop files (.pbix) via the -RsRest* commands.

Run the following command to find which commands in the ReportingServicesTools PowerShell module support Power BI Desktop files (.pbix).

Get-Command -Module ReportingServicesTools -Noun RsRest*

## Custom extensions

The Extension Library is a set of classes, interfaces, and value types that are included in Power BI Report Server. This library provides access to system functionality and is designed to be the foundation on which Microsoft .NET Framework applications can be used to extend Power BI Report Server components.

There are several types of extensions you can build.

• Data processing extensions
• Delivery extensions
• Rendering extensions for paginated reports
• Security extensions


text:
# Data set with a distribution similar to Poisson, which regression to use?

I am working on a research model looking at the data from stack overflow, especially the relationship of various variables on the score of a question. looking at the histogram of my dependent variable (Score) it holds a distribution similar to Poisson where most of the questions get a score of 0 or 1 and then a few questions get more upvotes while the histogram is right-skewed. The problematic part is that some questions get a negative score.

Looking at the data, I was quite convinced that the score is a count data. The values range from -12 to around 150.

I tested the model using glm in r

family = poisson, )

family = quasipoisson )

In addition the model reports underdisperssion (0.48) therefore I run a quasiposisson test. I tried a glm.nb (from MASS package) where the theta variable went up to > 40000. And r reported a warning message:

Warning messages:
1: In theta.ml(Y, mu, sum(w), w, limit = control$$maxit, trace = control$$trace >  :
iteration limit reached
2: In theta.ml(Y, mu, sum(w), w, limit = control$$maxit, trace = control$$trace >  :
iteration limit reached

In the end, I am just not sure what would be the correct regression model to use and whether the glm is the way to go. And if so, is it okay to add a constant (+12) to the dependent variable? Since I found some people be both for and against that.


text:
# How to reduce following expression so that it less computation.

I am using following expression in one of my programs

$$P = \left \lfloor \frac{\sum_{i=N}^M F(i) \cdot i!}{K}\right \rfloor \mod p.$$

Here $N$, $M$, $K$ and $P$ are non-negative integers, $N \leq M$ and $p$ is a prime number. Moreover, $F(i)$ returns the $i$th Fibonacci number, i.e. $$F(i+1) = F(i) + F(i-1)$$ with $F(1) = F(0) = 1$.

It is very time consuming to evaluate this expression. What can I possibly do to reduce the runtime?

• Compute $F_i=fibonacci(i), P_i=i!$ for $i=N-1, N-2$ before starting summation. In the summation loop update only $F_i = F_{i-1} + F_{i-2}, P_i = P_{i-1} \times i$ with the recursion formulas. This avoids recomputing the complete $F_i, i!$ for each summation step. – gammatester Nov 21 '17 at 15:53
• I see. What happens when $K$ does not divide the sum? – Carl Christian Nov 21 '17 at 20:50
• How do you do $(142/8) = 17 \pmod {19}$? – Magdiragdag Nov 26 '17 at 18:29
• @Sadhu I see that you modified the question to add a floor operator. Then you must compute the full result in the integers, not reducing mod $p$ at every step, and only do the mod $p$ at the end. Where did you get this problem from? Project Euler? I consider it extremely likely that in the specific context of the problem, the sum is always evenly divisible by $K$. – Magdiragdag Nov 27 '17 at 17:56
• It would be a very nice edit if you explain why this formula is relevant to you. I don't question that it is relevant to you, but you will earn goodwill by doing this. Any additional information about the relevant input parameters is crucial. In particular, you must address @Magdiragdag last comment. – Carl Christian Nov 29 '17 at 0:51

Possibly someone has a simplification for that sum. In case not, an off-topic on the programming. It's possible that the problem is you're using a very bad implementation of Fib. That is, if your code looks like this:

def Fib(n): if n < 2: return 1 return Fib(n-1) + Fib(n-2)

then there's your problem! This is hugely inefficent - calling Fib(n) leads to Fib(n) calls to Fib(), most of which are repetitions of previously calculated values. You can improve this greatly by "memoizing" the function: Store previously calculated values and look them up when needed:

Fibs = {} """Fibs is a "dict" where we record previously calculated values""" def Fib(n): """Try to look up the answer in Fibs; if that doesn't work give up and recurse, storing the answer for next time:""" try: return Fibs[n] except: if n < 2: ans = 1 else: ans = Fib(n-1) + Fib(n-2) Fibs[n] = ans return ans

The second version will be much faster than the first.

Similarly you probably want to memoize your Factorial(); there the obvious recursive version is less awful since there's only one recursive call, but it's still pretty bad.

Serious Python guys should write a "decorator" @Memoize, allowing you to write the first version and have it automatically execute like the second version.

• Thank you for your input. I'm using memoization in my program, but it's giving me ambiguous results, when value is very high. – Sadhu Nov 21 '17 at 16:18
• @Sadhu Where "ambiguous" results are wrong results? If the problem is integer overflow one solution is to use Python... – David C. Ullrich Nov 21 '17 at 16:31
• We've got a least recently used cache decorator in the standard library functools.lru_cache. FWIW, here's some code that tests various Fibonacci algorithms in Python. – PM 2Ring Nov 23 '17 at 14:14

Yet another way to calculate $F_n$ efficiently, in fact in time $\log n$:

First get $2\times 2$ matrix multiplication working. Now define $$X_n=\begin{bmatrix} F_{n+1}\\F_n\end{bmatrix}.$$Note that $$X_{n+1} =AX_n,$$where $$A=\begin{bmatrix}1&1\\1&0\end{bmatrix}.$$

So you just have to calculate $A^n$, which you can do efficiently using binary exponentiation. (This probably makes more sense if for some reason you need just one value of $F_n$.)


text:
assoc_Zi.Zj {corrDNA} R Documentation

## Association between variable Z_{i} and Z_{j}.

### Description

Finding association between variables of i^{th} position and j^{th} position. In any position wise aligned sequence dataset, occurences of R=(A,G) and Y=(C, T) at each position can be explained by a standard normal variate Z based on certain threshold value. So, an association between any two position in the datast can be obtained which will be the association beween the two standard normal variate at this two positions. However, the two nomal variates reprsenting the occurences of R and Y are independent of each other at a given position.

### Usage

assoc_Zi.Zj(x)

### Arguments

 x A dataframe of position wise aligned sequence dataset having A, T, G and C only.

### Details

The user has to supply the sequence dataset in tab delimited format and not in FASTA format. Each sequence (row) should contain only standard nucleotides (A, T, G and C). Each sequence should be same length.

### Value

A numeric matrix of order L by L for the dataset of L nucleotides long sequences.

### Author(s)

Prabina Kumar Meher & A. R. Rao

### Examples

data(don_dat)
kk <- don_dat[1:300,]
zizj <- assoc_Zi.Zj(x=kk)
zizj

[Package corrDNA version 1.0.1 Index]


text:
# Unfamiliar Equation

Calculus Level 5

$2 \dfrac{d^2y}{dx^2} + 3 \dfrac{dy}{dx} + y = e^{-3x} , \quad x \in \mathbb{R}$

Let $$y \colon \mathbb{R} \to \mathbb{R}$$ be a solution of the above ordinary differential equation, satisfying $$\displaystyle\lim_{x\rightarrow \infty} e^xy(x) = 0$$. Find $$y(0)$$.

×

Problem Loading...

Note Loading...

Set Loading...


text:
# Rather weird D3DXCreateTexture problem

This topic is 4512 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

int level = 1;
D3DXCreateTexture( pd3dDevice, tWidth,tHeight, level, D3DUSAGE_DYNAMIC,D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &g_pTexture )

After this I use LockRect() and write a procedural pattern to this texture. Then send it to shaders and is not modified thereafter. My prob is if I set level to anything other than 1 (including 0, which generates all mip levels), this texture automatically get applied a simple and changing color gradient when the model it is on is rotated. If level is 1, the gradient doesn't show up. Surely I m missing something obvious?

##### Share on other sites
Are the dimensions of the texture not powers of two by any chance? If they are not that may be the source of the problem depending on your gfx card.

Support for non-pow2 textures is split into three types in D3D9:
* Not at all
* Conditional
* Full
(See docs for the TextureCaps member of the D3DCAPS9 structure for the cap bits to check to see what your gfx card supports).

If your texture is non-pow2 I would hazard a guess that your gfx card has conditional support for non-pow2 textures and that is the cause of your problem. This would be because one of the conditions for conditional non-pow2 support is that the texture is non mip mapped (together with a non DXT format and CLAMP sampling).

While you would expect the runtime to just refuse to use a non-pow2 texture that does not meet the required conditions on a "conditional support" card I have found at least 1 gfx card that will happily accept the texture (with no related debug spew IIRC) but render a random colour gradient when using the texture.

A bit obscure but you never know! Hope this helps,

Mike.

[EDIT: I should mention that I don't remember the gradient changing as the model moved with this issue - but that could be caused to various strange memory goings on in the gfx card...possibly...]

##### Share on other sites
Dimension is 128*128
GPU is ATI radeon x1800 xl
directx 9c, debug enabled

Gradient appears when surface normal forms approximately 70 degree angle with the camera's view vector. Then, even in the PS, when I read from the texture I get the erraneous color values from the gradient.

Gradient recedes and disappears when surface normal aligns with the view vector direction. All color values in the texture returns to normal. Thus the process is not destructive to the texture.

There is no evidence orientation affects color values stored in this texture.Perhaps its the GPU.

##### Share on other sites
Could you post a screenshot?

##### Share on other sites
Ah, maybe you are not filling (or auto-generating) all the extra mip-map levels? That could be why the angle of the surface to the camera causes the effect to occur - it is selecting mip map levels that contain garbage?

##### Share on other sites
Feel free to look at the source, a modification of a sample project.

http://www.geocities.com/darkforest4/BasicHLSL.zip

The problem is at line 422 in BasicHLSL.cpp
Change 1 to 0,2,3... the prob occurs.

If equals to 0, dx should fill in all levels.

##### Share on other sites
Hi,

With D3DXCreateTexture, if the number of mip map levels requested is 0 D3DX *creates* a complete mip map chain but it does not do anything else (i.e. it does not auto generate the mip maps for you). If you want a complete set of mip maps but you don't want to set them all yourself you can either specify D3DUSAGE_AUTOGENMIPMAP when creating the texture for D3D to generate them for you (if the gfx card supports it) or use D3DXFilterTexture.

I've checked out your code and this does seem to be the problem: Specifying D3DUSAGE_AUTOGENMIPMAP solves the problem.

(Also the D3D debug spew is saying that you are not freeing all the D3D objects you are using and that your IB and VB should really be WRITEONLY (as they are in the default pool) - just letting you know in case you had it turned off!).

I hope that this helps! (finally!)

Mike.

##### Share on other sites
Thank you! While this is a subtlty, it makes sense considering calling this function simply creates a blank texture. BTW, what is the reason the value 1 works.

Yes, the sloppiness is due to simplying/adapting the project for public viewing. Nonetheless, yes, lots to learn about various flags.

##### Share on other sites
Glad I could help!

The reason that specifying one mip-map level works is that you are filling in the top level of the surface in your code only - so that one level gets the correct data. When >1 mip map levels are created (when numLevels is set to 0 or >1) they start off uninitialised (full of random garbage) and as you are not filling them yourself they remain full of garbage.

Remember that mip-mapping is not always required. It depends on your usage of the texture in question.

Mike.

• 10
• 19
• 14
• 19
• 15


text:
# Now Thats What we call a Summation!

Algebra Level 4

$\large \sum^\infty_{r=1} \frac{r^3+(r^2+1)^2}{(r^4+r^2+1)(r^2+r)} = \frac ab$

The equation above holds true for coprime positive integers $a$ and $b$. Find $a+b$.

×


text:
# Another epsilon-delta proof

1. Oct 1, 2007

### bjgawp

1. The problem statement, all variables and given/known data
Prove that $$\lim_{x\to\\-1}(3-2x^{2})=1$$ The problem isn't figuring out the problem but rather a question about the answer itself.[/

2. Relevant equations
None really.

3. The attempt at a solution

My question is that what's the difference if we assumed $$\delta$$ to be another number such as 5? We would wind up with $$\delta$$ = min{5, $$\epsilon$$/14}. How would the two answers differ? Is one answer more accurate or more "right" than the other?

2. Oct 1, 2007

### HallsofIvy

Staff Emeritus
If $\delta$ is "assumed to be another number such as 5" then it wouldn't work would it? The whole point is to make certain that |2- 2x2|< 1 isn't it?

3. Oct 1, 2007

### Hurkyl

Staff Emeritus
Was that supposed to say $|2 - 2x^2| < \epsilon$?

I also assume you meant to say "If we had instead assumed $\delta \leq 5$..."? If you get an answer, then you get an answer. The answer is not unique.

For the record, that image has a minor logic error in it. And even if we ignore that, it's not a complete solution.

4. Oct 1, 2007

### bjgawp

Alright instead of $$\delta$$ = 5, what about $$\delta \eq$$ = 0.5? We would get $$\delta$$ = min{0.5, $$\epsilon$$/5}. Again, is this answer more "valid" than $$\delta$$ = min{1, $$\epsilon$$/6}

EDIT: Missed Hurkyl's post. Thanks again! Yeah, I didn't feel like going through the whole formality of the proof. Just wanted to get the point across. Thanks!

Last edited: Oct 1, 2007
5. Oct 1, 2007

### Hurkyl

Staff Emeritus
Like I said, if you get an answer, then you get an answer! This sort of technique is rather forgiving; it's rather common that choosing any number between 0 and $+\infty$ for your bound on $\delta$ will lead you to an answer.

6. Oct 1, 2007

### bjgawp

Just out of curiosity, what minor logic error did you refer to? Might help me solve a particular problem I've been having with these proofs.

Where I've said 2|x+1||x-1| < 2(3)|x+1| < $$\epsilon$$, why is it that we assume 2(3)|x+1| < $$\epsilon$$? Seems like we arbitrarily assumed it to make the solution work ... Thanks in advance guys!

Last edited: Oct 1, 2007
7. Oct 1, 2007

### Hurkyl

Staff Emeritus
Good call; that's exactly what I was referring to.

The work in this image -- the "working backwards" preliminary work -- is assuming the conclusion: $|2 - 2x^2| < \epsilon$. From our other assumption, we also know that $|2 - 2x^2| < 2(3)|x+1|$. However, we cannot conclude that $2(3)|x + 1| < \epsilon$. (At least, not immediately)

What we need here is, as you've realized, another assumption. (Though if we make the assumption so that the solution will work, it's not exactly arbitrary. )

We made the assumption that $\delta \leq 1$ so that we could control the size of $|x - 1|$. Now, since $2(3)|x+1|$ has appeared naturally, we make the additional assumption that $2(3)|x+1| < \epsilon$ to wedge it into the problem right where we want it.

By making these assumptions, we arrive at an answer that works, so we're happy! But if we were unable to arrive at an answer, we would have to try something else.

Remember that none of this work is the actual solution -- it's the process of working backwards from the answer to figure out what to use as a starting point. Once we have a starting point (e.g. "let $\delta = \min\{1, \epsilon/6\}$"), then we can work forwards to prove that this really is a solution.

Compare with solving algebra problems -- you manipulate the problem until you get potential solutions, and then you have to plug them back into the original equation to see if they really are solutions. The plugging-in part what you need to do to prove they are solutions -- but the manipulations are the process you used to figure out what the solutions had to be.

Last edited: Oct 1, 2007
8. Oct 1, 2007

### bjgawp

Thank you very much! Things are a bit more clearer than they were. However, just another question. I'm still not see how assuming 2(3)|x + 1| < $$\epsilon$$ leads us to find the "right" $$\delta$$. Just because $$\delta \leq$$ 1, where's our basis that even with the restriction we placed on |x - 1| that 2(3)|x+1| should be < $$\epsilon$$. Just curious where the connection is :) Thanks, once again, for taking your time!

9. Oct 1, 2007

### Hurkyl

Staff Emeritus
Your goal is to find a choice of $\delta$ that makes $|2 - 2x^2| < \epsilon$.

You have already shown that if $\delta \leq 1$, then $|2 - 2x^2| < 2(3)|x+1|$.

This gives you a lead -- if you can arrange things so that both $\delta \leq 1$ and $2(3)|x+1| < \epsilon$ are true, then you have accomplished your goal.

So, to continue working backward, you make the additional assumption that $2(3)|x+1| < \epsilon$, and see if that helps you deduce anything.

You aren't guaranteed that this will help you find the solution -- but this is something to try. And often, the simple thing works!

10. Oct 1, 2007

### bjgawp

Ooh! That clears it up for me. Do you know of an example where that assumption does NOT work? You don't have to go through the trouble of finding one as you've helped a lot already. Thank you very much :) Now .. onto making sense of proving the limit laws ...

11. Oct 1, 2007

### Hurkyl

Staff Emeritus
This very problem is a good example.

Suppose you didn't think to make the assumption that $\delta \leq 1$. Then, in the process of working backwards, you might do

$$|2 - 2x^2| = 2 |1-x| |1+x| < 2 \delta |1 - x|.$$

Then, the natural thing to do would be to assume that $2 \delta |1 - x| < \epsilon$ and see what happens. Solving for delta, you get:

$$\delta < \frac{\epsilon}{2 |1 - x|}$$

Unfortunately, since x can be any value at all, $|1 - x|$ can be arbitrarily large, and this forces us to choose $\delta \leq 0$, which we cannot do.

Incidentally, after meeting this failure, the next step to realize "Okay, the problem is that I had no control on the size of $|1 - x|$" -- it is this chain of thought that leads you to make an assumption like $\delta \leq 1$.


text:
• NEW! FREE Beat The GMAT Quizzes
Hundreds of Questions Highly Detailed Reporting Expert Explanations
• 7 CATs FREE!
If you earn 100 Forum Points

Engage in the Beat The GMAT forums to earn
100 points for $49 worth of Veritas practice GMATs FREE VERITAS PRACTICE GMAT EXAMS Earn 10 Points Per Post Earn 10 Points Per Thanks Earn 10 Points Per Upvote ## From 510 to 710! Thanks BTG & GMAT Ninja (gmatninja.com) tagged by: ##### This topic has 11 member replies ## From 510 to 710! Thanks BTG & GMAT Ninja (gmatninja.com) Wanted to share a post about my GMAT journey which started 2 years ago when I did some quick prep on my own and having no real high aspirations about a high GMAT score, as I was targeting local, part-time programs, with my company paying for the cost of the MBA. I walked away with a 510 (36Q, 25V) and not really affected by the low score as the rest of my background was pretty solid (very high GPA, good work experience in finance, international projects etc). Fast forward one year later, the company downsized 2/3 of the employees worldwide, 70% of the clients left and I soon found myself with a pink slip on my desk. After getting over the shock of the 'new normal', I realized that this was my opportunity to map out my academic and professional future (to the best of my abilities) and I dived into a high priced GMAT course with one of the big companies. After using their extremely detailed materials (broken down by topic) as well as practice exams along with a brand new GMAT prep (and hitting 700), I sat for the exam a second time in mid 2009 and walked away extremely disappointed with a 610 (38Q, 35V). I had a very weak math background (hardly one year in high school) and I knew that I had to tackle math head on to achieve an attractive score. During a trip to Europe I came across a post on BTG (one of my most visited sites during that time) and decided to have a quick chat with the GMAT Ninja (http://gmatninja.com/) and map out a strategy to get me to my target score: 680+. Excited about my future tutor's experience and practical steps, I met with him a few weeks later in NYC and was even more impressed with his method/recommended homework/reading material etc. My goal was to eliminate the element of surprise every step of the way (especially for math) and my tutor accomplished exactly that: he started out by testing me on several GMAT math concepts and once he grasped my weakness, he would explain the concept in detail and practice this concept through several exercises, increasing the level of difficulty and twisting the question in every way possible until the concept being tested was tattooed in my brain--this allowed me to tap into that brain pattern each time I saw the above concept tested. Although I'm not a native English speaker, verbal turned out to be my strength. Hence my tutor recommended the toughest material: retired LSAT tests and LSAC study guides with answers/explanations. He emphasized the importance of reviewing the answers (and understanding where I went wrong: missing a detail, rushing through the question, not paraphrasing the argument in my head before trying to answer etc). The difference between practice this time and the last was tactic: I was only practicing for 2-3 hrs/day, a bit more during week-ends, but this time I was reviewing my work and spending more time on review than actual practice. I even wrote down lessons learned/takeaways so as not to repeat them again. Day of the test: my exam was scheduled at 8AM. I had a very light breakfast: boiled egg, half a slice of toast and half a cup of cappuccino. Got to the test center early and walked around the block a couple of times just to get the blood circulating. AWA was relatively easy: I got 2 business/marketing concepts which I breezed through. Took the first break: ran to the rest room, splashed cold water into my face and neck to force the bloodstream upwards and ate half a banana (read somewhere that potassium facilitates the blood flow throughout the body). I was almost scared NOT TO SEE any questions that I didn't know how to tackle and though to myself: here we go again--more studying coming up. I finished up the last few questions feeling pretty down as the questions felt EASY, but I carried on anyway, finished up quant and ran to the rest room to rinse my face with icy cold water again. Ate half a snickers bar and drank some water and walked back in for Verbal. Surprisingly RC didn't feel difficult at all (no science passages, just Finance, Energy, Art History). SC and CR felt much more difficult than anything I'd seen--I took that as a good sign, but didn't obsess too much and I carried on. Finished with a bit of time left over, hurried through the demographic questions and went I was asked whether I wanted my score report . I hesitated for a second, prayed, breathed deeply and clicked "yes". Then I put my head on the desk and closed my eyes for 5 seconds: the screen came up and I saw 710 (48Q, 39V; 5.5 AWA a week later). Was definitely flabbergasted with the 48 Quant (would have been happy with 44) and disappointed with Verbal (had been scoring between 40-44 in past practice exams for several results of 730: 49Q, 40V and 47Q, 42V). Overall I was satisfied with the 710, although I do blame myself for scheduling the last practice GMAT prep only 2 days before the real thing: after reviewing the prep and practicing the wrong questions, I was really only left with 1 day off. PLEASE give yourselves at least 5 days off just to chill before the real thing--you'll need all the physical and mental stamina that you've got! Some of the materials I practiced with: Practice Materials developed by my tutor tackling each Quant Area with increasing levels of difficulty (practiced 2-3 times) Official Guides (10th, 11th, 12th editions) along with Verbal and Quant Guides GMAT Club Question of the Day (going back 2 years since the start for a total of 700 Quant and Verbal Questions) GMAT Hacks Challenge and Extra Challenge sets (some of the twice) Manhattan GMAT Tests GMAT Prep (one repeat, but couldn't remember any of the questions since last practice was 1 year ago). I am done with the GMAT, but the experience will stay with me for a lifetime. Thanks BTG and thanks GMAT ninja--would have been a different story without you :0)! Best of luck to everyone! Master | Next Rank: 500 Posts Joined 25 Jun 2010 Posted: 358 messages Followed by: 4 members Upvotes: 34 Test Date: 26/10/2010 Target GMAT Score: 730+ GMAT Score: 740 Great score....best of luck for your apps... _________________ My 740 Debrief Senior | Next Rank: 100 Posts Joined 04 Mar 2010 Posted: 51 messages Followed by: 2 members Upvotes: 4 GMAT Score: 800 Thank you for the endorsement! It was great to read your whole story again--I'd completely forgotten about the 510. You always seemed destined for a 700+ score, so I think I managed to put the 510 and 610 out of my head. It was a lot of fun to watch you work like a madwoman, and even more fun to watch you kick some GMAT a** in the end. Congratulations! Let us know as soon as you hear back from b-schools! _________________ helping students kick the GMAT in the nuts since 2002... https://www.gmatninja.com/ Newbie | Next Rank: 10 Posts Joined 15 Mar 2009 Posted: 2 messages what did you think about the gmat hacks material? Newbie | Next Rank: 10 Posts Joined 12 Feb 2011 Posted: 4 messages To the entire BTG community: I don't want to make false accusations, but I believe everyone here should be wary of working with the "GMATNinja" until they get proof of that his references on this forum are indeed real and that he did indeed score a 780 on the GMAT. I am not trying to defame this person, but my experiences contacting and researching his background have made me HIGHLY suspicious that the people posting these "success stories" on BTG are not real people. Maybe I'm wrong (and I hope I am), but I think anyone about to shell out$150 should be alert to the very real possibility that this person is scamming them.

Last edited by gorginger on Fri Mar 04, 2011 8:37 am; edited 2 times in total

Senior | Next Rank: 100 Posts
Joined
04 Mar 2010
Posted:
51 messages
Followed by:
2 members
4
GMAT Score:
800
Wow... I have no idea who "gorginger" is, but here are some honest facts about my tutoring practice:

1) All of the reviews about my services on BTG are 100% real, and I did not write or solicit any of them. After Hari posted some positive comments about me on BTG, students began to find me after reading his comments, and then chose to post a positive review when they were pleased with my services. Again, the reviews were their choice--not mine. I cannot control the fact that some of them have not been regular BTG contributors. And for what it's worth, I consciously post very sparingly on BTG, exactly because I don't want to be seen as using the site for personal gain.

2) I have never "promptly turned down" anybody who has ever asked me for references of any sort, and I have never been asked specifically for references from these success stories. Of course, all of these reviewers would be happy to serve as references, and I could easily connect a potential student with them... but nobody has ever asked!

3) I very rarely get asked for official score report, and I don't think that "gorginger" ever did so. I went through my emails, and found only one person who has asked me for a score report in the past year... and I told her that I would be happy to show it to her. My 780 is real, and I have the reports to prove it.

4) Nobody has ever asked me for both an official score report and to identify the writers of my online reviews. I can't understand why somebody would make this up, but gorginger's story is, unfortunately, completely false.

5) I don't necessarily mind that somebody is posting negative things about me online--I'm not perfect, and not all of my students achieve their dreams. But unfortunately, "gorginger" seems to be inventing facts. If you're going to speak badly of me, please do so in an honest, well-informed way.

I pride myself on being brutally honest, both as a tutor and as a human being... and I could provide dozens of references from recent years who would enthusiastically endorse my character and my work. I don't make any guarantees or claims that I can't back up--there are no shams or scams here, just a guy trying to make an honest living as a tutor.

_________________
helping students kick the GMAT in the nuts since 2002... https://www.gmatninja.com/

Legendary Member
Joined
28 Dec 2008
Posted:
1578 messages
Followed by:
9 members
82
GMAT Score:
720
GmatNinja, I think there is some fact in gorginger objection. All these success stories are of two type of user, inactive users profile created long back or new one with little or no activity. I have lurked through your site long back several times, and I am of the opinion you have a solid backgrounds and credibility. But these posts are definetly suspicious.

Also, on your site you claimed gmat score 790(51/47) why you are quoting 780 here.

_________________
Charged up again to beat the beast

Senior | Next Rank: 100 Posts
Joined
04 Mar 2010
Posted:
51 messages
Followed by:
2 members
4
GMAT Score:
800
Read my website carefully, Maihuna: the score is a 780. I'm 100% honest about it, and the official score report is here for anybody to see. Please do not misinform people about my website--it isn't a very nice thing to do.

I still have no idea who gorginger is (do you know, Maihuna?), but gorginger created a BTG account for the sole purpose of attacking my character in a dishonest way--no prospective student has ever asked for the identity of these reviewers and my official score report... and I would easily give them out if somebody had. Gorginger was completely lying, and I have no idea why.

It's true that several of these reviewers weren't regular posters (and I completely understand why somebody would be suspicious of that!), but I have absolutely no control over my reviewers' activity on this site, and it's unfair to attack my credibility on this basis. Two of my reviewers have already posted (unsolicited!) defenses of my character and services, and you'll notice that gorginger removed the offending post.

I know that there are plenty of GMAT snake-oil salesman out there, but I'm not one of them.

If you're curious, here are responses from two of the reviewers questioned by gorginger:
http://www.beatthegmat.com/how-i-went-from-580-q42-v27-to-710-q48-v40-t57648.html
http://www.beatthegmat.com/not-sure-if-i-beat-the-gmat-but-120-points-in-4-months-t70449.html

_________________
helping students kick the GMAT in the nuts since 2002... https://www.gmatninja.com/

Legendary Member
Joined
28 Dec 2008
Posted:
1578 messages
Followed by:
9 members
82
GMAT Score:
720
Ohh GmatNinja, I might have forgotten it, sorry, I visited your website sometime last year, I do remember !51 V47 breakup atleast, not sure if 790 slipped in as memory gap. Sorry in case it is not so.

See I have read all your posts and liked your attitude and straight forwardness(U did mentioned u started with a very modest score and made your ways till 780/90 whatever, very few people do that once they score higher one).

My only intention was, no doubt on your personality, sorry if I have looked so, but as you too agreed their is certain pattern in these posts which looks questionable. I do not gorginger though.

gmatninja wrote:
Read my website carefully, Maihuna: the score is a 780. I'm 100% honest about it, and the official score report is here for anybody to see. Please do not misinform people about my website--it isn't a very nice thing to do.

I still have no idea who gorginger is (do you know, Maihuna?), but gorginger created a BTG account for the sole purpose of attacking my character in a dishonest way--no prospective student has ever asked for the identity of these reviewers and my official score report... and I would easily give them out if somebody had. Gorginger was completely lying, and I have no idea why.

_________________
Charged up again to beat the beast

Senior | Next Rank: 100 Posts
Joined
04 Mar 2010
Posted:
51 messages
Followed by:
2 members
4
GMAT Score:
800
Thank you, maihuna! I appreciate the response.

And yes, I completely agree that the posts look a bit funny. It's made me nervous in the past, but it would be pretty weird for me to... I don't know, ask the reviewers or BTG to take them down? It's a tough spot. I'm thoroughly honored to have such honest, glowing reviews from these guys... but I can definitely see how the very same reviews could undermine my credibility if they're viewed in a different light.

I wholeheartedly believe that any online review--of me, or of anybody else--should always be taken with a grain of salt. All I ask is that people read some of the 30,000+ words of text on my site to understand who I really am before passing judgment. I'm pretty "naked" (not literally) on my website, and hope that potential students make an informed decision about me, rather than putting 100% faith in anonymous forum posts... regardless of whether those posts are negative or positive.

Thank you again for the response and the kind words, maihuna.

_________________
helping students kick the GMAT in the nuts since 2002... https://www.gmatninja.com/

Master | Next Rank: 500 Posts
Joined
09 Jun 2010
Posted:
114 messages
12
Test Date:
9/11/2010
Target GMAT Score:
740
GMAT Score:
700
I think that first post sounds awfully like an ad, too. I mean...it mentions "high priced" gmat companies, but doesn't offer a name? It's like a commercial where a company compares its own offerings to "the other guys".

Senior | Next Rank: 100 Posts
Joined
04 Mar 2010
Posted:
51 messages
Followed by:
2 members
4
GMAT Score:
800
Lol... yeah, I suppose you're right. No disrespect to the writing talents of loyolausa (who, incidentally, is currently at a top-tier school and is happy to speak with anybody who might question her story or identity), but it does have that "better than the leading brands!!!!!!" feel to it in a spot or two. Her intentions are honest, though.

Again, you're all encouraged to take this review with as many grains of salt as you wish... but please don't judge based solely on a few online reviews. I can provide literally dozens of references, and there are pages and pages of material on my website. Judge me on everything I've done, not just on a handful of forum threads that are beyond my control.

_________________
helping students kick the GMAT in the nuts since 2002... https://www.gmatninja.com/

• Award-winning private GMAT tutoring
Register now and save up to $200 Available with Beat the GMAT members only code • Free Practice Test & Review How would you score if you took the GMAT Available with Beat the GMAT members only code • FREE GMAT Exam Know how you'd score today for$0

Available with Beat the GMAT members only code

• Free Veritas GMAT Class
Experience Lesson 1 Live Free

Available with Beat the GMAT members only code

• Free Trial & Practice Exam
BEAT THE GMAT EXCLUSIVE

Available with Beat the GMAT members only code

• Magoosh
Study with Magoosh GMAT prep

Available with Beat the GMAT members only code

• 1 Hour Free
BEAT THE GMAT EXCLUSIVE

Available with Beat the GMAT members only code

• Get 300+ Practice Questions

Available with Beat the GMAT members only code

• 5 Day FREE Trial
Study Smarter, Not Harder

Available with Beat the GMAT members only code

• 5-Day Free Trial
5-day free, full-access trial TTP Quant

Available with Beat the GMAT members only code

### Top First Responders*

1 Jay@ManhattanReview 77 first replies
2 Brent@GMATPrepNow 66 first replies
3 GMATGuruNY 33 first replies
4 Ian Stewart 24 first replies
5 Scott@TargetTestPrep 16 first replies
* Only counts replies to topics started in last 30 days
See More Top Beat The GMAT Members

### Most Active Experts

1 Scott@TargetTestPrep

Target Test Prep

200 posts
2 Max@Math Revolution

Math Revolution

94 posts
3 Brent@GMATPrepNow

GMAT Prep Now Teacher

92 posts
4 Jay@ManhattanReview

Manhattan Review

83 posts
5 GMATGuruNY

The Princeton Review Teacher

57 posts
See More Top Beat The GMAT Experts


text:
# Helps needed with this diff qn!

1. Jul 11, 2009

### miraclezdr

a material decays at a rate proportional to its mass. there are 200mg of it initially, 5 hours later, it lost 10% of the original mass. let m denote the mass of remaining at anytime t. write the differential equation which describes the rate of change of m with respect to t, and solve the equation.

Last edited by a moderator: Jul 11, 2009
2. Jul 11, 2009

### Hootenanny

Staff Emeritus
Welcome to Physics Forums.

What have you tried thus far?

3. Jul 11, 2009

### Feldoh

a material decays at a rate proportional to its mass. -> Is giving you the basic differential equation.

there are 200mg of it initially, 5 hours later, it lost 10% of the original mass. -> Tells you how they are proportional.

You've just got to learn how to read the problems^^


text:
# In which of the following compounds does the central atom exhibit "sp"^2 hybridization?

## ${\text{CO}}_{2}$ $\text{CO}$ ${\text{SO}}_{2}$ $\text{N"_2"O}$

Oct 21, 2015

Sulfur dioxide, ${\text{SO}}_{2}$.

#### Explanation:

The first thing to focus on is what it means for an atom to be ${\text{sp}}^{2}$ hybridized.

This type of orbital hybridization implies that the central atom uses three hybrid orbitals, one $s$ and two $p$, to either form covalent bonds with other atoms, or keep lone pairs of electrons.

On a more general note, in order for an atom to be "sp'^2 hybridized, it must be surrounded by three regions of electron density.

So, take a look at the Lewis structures for your four compounds

• carbon dioxide, ${\text{CO}}_{2}$

Notice that the central carbon atom forms two double bonds with the two oxygen atoms. Single, double, and triple bonds all count as one region of electron density.

This means that the carbon atom uses two hybrid orbitals, one $s$ and one $p$ $\to$ it is $\text{sp}$ hybridized.

• carbon monoxide, $\text{CO}$

Notice that the carbon atom is once again surrounded by two regions of electron density - a triple bond and a lone pair of electrons.

This means that it will use two orbitals, one $s$ and one $p$, to form
two $\text{sp}$ hybrid orbitals $\to$ it is $\text{sp}$ hybridized.

• Sodium dioxide, ${\text{SO}}_{2}$

The sodium dioxide molecule exhibits resonance, which is another way of saying that it can be represented by using more than one Lewis structure.

However, as far as hybridization of the central atom is concerned, you can use either one.

This time, the central sulfur atom is surrounded by three regions of electron density - a single bond, a double bond, and a lone pair of electrons.

This means that the sulfur atom will use three orbitals, one $s$ and two $p$, to form three ${\text{sp}}^{2}$ hybrid oribitals $\to$ it is ${\text{sp}}^{2}$ hybridized.

• Nitrous oxide, $\text{N"_2"O}$

The same is true for the nitrous oxide molecule, it exhibits resonance. Once again, any of the resonance structures will work

In all three structures, the central nitrogen atom is surrounded by two regions of electron density, which implies that it is $\text{sp}$ hybridized.


text:
# Calculate the indefinite integral $$\rm \int {6\over(\sin x +\sin2x)}$$ dx

1. $$\rm \ln|1-\cos x|-3\ln|1+\cos x|-4\ln|1+2\cos x|$$ + C
2. $$\rm \ln|1-\cos x|+3\ln|1+\cos x|+2\ln|1+2\cos x|$$ + C
3. $$\rm \ln|1-\cos x|-3\ln|1+\cos x|-2\ln|1+2\cos x|$$ + C
4. $$\rm \ln|1-\cos x|+3\ln|1+\cos x|-4\ln|1+2\cos x|$$ + C

Option 4 : $$\rm \ln|1-\cos x|+3\ln|1+\cos x|-4\ln|1+2\cos x|$$ + C

## Detailed Solution

Concept:

Substitution method: If the function cannot be integrated directly substitution method is used. To integration by substitution is used in the following steps:

• A new variable is to be chosen, say “t”
• The value of dt is to be determined.
• Substitution is done and integral function is then integrated.
• Finally, initial variable t, to be returned.

Calculation:

I = $$\rm \int {6\over(\sin x +\sin2x)}$$ dx

Using integration by parts

⇒ I = $$\rm \int {6\over(\sin x +2\sin x \cos x)}$$ dx

⇒ I = $$\rm \int {6\over\sin x(1 +2 \cos x)}$$ dx

Multiply sin x both in numerator and denominator

⇒ I = $$\rm \int {6\sin x\over\sin^2 x(1 +2 \cos x)}$$ dx

⇒ I = $$\rm \int {6\sin x\over(1-\cos x)(1+\cos x)(1 +2 \cos x)}$$ dx

Substituting cos x = t ⇒ -sin x dx = dt

⇒ I = $$\rm \int {-6\over(1-t)(1+t)(1+2t)}$$ dt

By partial fraction

⇒ I = $$\rm -6 \int {1\over6(1-t)}-{1\over2(1+t)}+{4\over3(1+2t)}$$ dt

⇒ I = $$\rm -6[ {-1\over6}\ln|(1-t)|-{1\over2}\ln|(1+t)|+{4\over3\times2}\ln|(1+2t)|]$$ + C

⇒ I = $$\rm \ln|(1-t)|+3\ln|(1+t)|-4\ln|(1+2t)|$$ + C

⇒ I = $$\boldsymbol{\rm \ln|1-\cos x|+3\ln|1+\cos x|-4\ln|1+2\cos x|}$$ + C

Integration by parts: Integration by parts is a method to find integrals of products. The formula for integrating by parts is given by:

⇒ $$\rm ∫ u vdx=u ∫ vdx- ∫ \left({du\over dx}\times \int vdx\right)dx$$ + C

where u is the function u(x) and v is the function v(x)

ILATE rule is Usually, the preference order of this rule is based on some functions such as Inverse, Logarithm, Algebraic, Trigonometric and Exponent.

Integral property:

• ∫ xn dx = $$\rm x^{n+1}\over n+1$$+ C ; n ≠ -1
• $$\rm∫ {1\over x} dx = \ln x$$ + C
• ∫ edx = ex+ C
• ∫ adx = (ax/ln a) + C ; a > 0,  a ≠ 1
• ∫ sin x dx = - cos x + C
• ∫ cos x dx = sin x + C


text:
I Diamagnetism vs. paramagnetism

1. Mar 22, 2016

pierce15

I am studying some solid state physics, in particular magnetism; I have a few questions about the explanations.

My understanding is that paramagnetism is primarily an effect of the electron's spin-angular momentum: an unpaired electron will have a dipole moment which preferentially aligns with an external field, so the magnetization is proportional to the applied field.

On the other hand, diamagnetism is an effect of orbital angular momentum of electrons. What I don't understand is why the above argument cannot be applied to an electron with orbital angular momentum: surely an orbiting electron creates a dipole moment which aligns preferentially with an applied field? Or is it simply that the Lorentz force is much more powerful? (But if the Lorentz force were more powerful, then unpaired electrons [which have orbital angular momentum] should also exhibit diamagnetism, in contradiction of the prior explanation).

Thanks for bearing with me.

2. Mar 22, 2016

My understanding of diamagnetism (I'm no expert here-I'm speaking as someone who still has some learning to do on the subject), is that diamagnetism is mostly from free conduction electrons and it will obey LeChatlier's principle in that the response of free electrons will respond in such a way as to reduce or screen any applied magnetic field. Meanwhile paramagetism (and ferromagnetism) are both the result of electrons bound to the atoms, whether from orbital or spin angular momentum and will have a tendency to align with the applied field. In diamagnetism, I believe the electron paths can be macroscopic in size.

3. Mar 23, 2016

DrDu

Yes, the orbital momentum can also contribute to paramagnetism, especially in gasses. However in condensed phases, the orbital angular momentum is mostly "quenched". I.e. the atomic orbitals which are occupied by unpaired electrons are not eigenstates of angular momentum but combinations of states with m and -m. The degeneracy of the orbitals is lifted by the chemical bonding environment. You may want to read the article about crystal field theory on wikipedia: https://en.wikipedia.org/wiki/Crystal_field_theory

4. Mar 23, 2016

DrDu

Not quite. A text book example for the calculation of the diamagnetic response is for the Helium atom which certainly has no free electrons.
Both dia- and paramagnetism can be due to both free and bound electrons. For free electrons, the theory of paramagnetism was worked out by Landau. Here, orbital angular momentum is quite important, but it turns out that the total effect is quite small.

5. Mar 23, 2016

Perhaps one item of interest regarding diamagnetism is the superconductor, which, if I understand it correctly, is the extreme case of diamagnetism where the magnetic field is completely screened from the interior of the superconductor by the Meissner effect. Meanwhile, at least in homogeneous solids, the magnetic field enhancement that occurs in paramagnetism and ferromagnetism (that come from the internal magnetic moments lining up with the applied magnetic field) can be attributed to (magnetic) surface currents. (see e.g. Griffiths E&M textbook. He doesn't seem to emphasize this a great deal, but it follows from his magnetic surface current equation.)

6. Mar 23, 2016

pierce15

I don't really understand this, can you explain in a little more detail? Here's what I'm asking phrased differently: electrons orbiting the nucleus have a dipole moment, why shouldn't the dipole want to align with the field?

I am also having trouble seeing how this relates to crystal field theory.

7. Mar 23, 2016

I think I can offer a clue on some of this that may be helpful. I think the paramagnetism, diamagnetism, and ferromagnetism will at times have tremendous variations in the observed magnetic fields that portions of individual atoms experience at the microscopic/atomic level even though at the macroscopic level, the magnetic field can be treated as a uniform field. To understand some of the phenomena completely, it is probably necessary to introduce the variation at a microscopic level. In those cases, instead of a moment aligning with the macroscopic field, it might align itself to a microscopic/atomic scale portion of it.

Last edited by a moderator: Mar 24, 2016
8. Mar 24, 2016

DrDu

In atoms in the gas phase, you can observe this alignment. However, in condensed matter, electrons get reflected by other atoms, so the expectation value of angular momentum vanishes. In crystal field theory you can show that e.g. none of the orbitals from the $E_g$ or $T_{2g}$ set carries angular momentum.

9. Mar 24, 2016

DrDu

Here some example:
Consider a single electron on an atom in a d-shell. Among others, it can be in $d_2$ and $d_{-2}$ orbitals which are energetically degenerate in the absence of a magnetic field and carry magnetic momenta of $m_z=\pm \hbar \mu$.
In the absence of a magnetic field, we can as well form the two real functions $d_{x^2-y^2}=d_2+d_{-2}$ and $d_{xy}=(d_2-d_{-2})/i$. But in the solid state or in a molecule where each atom is surrounded quadratically by 4 ligands with positive charges, the degeneracy will be lifted and the $d_{x^2-y^2}$ orbital will be lower than the $d_{xy}$ orbital as its lobes point in the direction of the positive charges. When these states are brought into a magnetic field, they will admix only very little of the other wavefunction and the paramagnetism will vanish. This is what is called quenching and how it is related to ligand field theory, see also this scetch here:

10. Mar 24, 2016

One feature of paramagnetism that is worth mentioning (to the OP), is that these magnetic moments will have a tendency to align in the same direction as the magnetic field, (because energy $E=-u*B$ where u is the magnetic moment with a vector dot product). This energy is quite small for the moments from single electrons (orbital and/or spin), and thermal effects(e.g. the Botzmann factor of statistical physics, $exp(-E/(kT))$, will result in only a slight difference between the populations of the "+" and "-" states (e.g. $m_s=+1/2$ and $m_s=-1/2$ ). This is typical of paramagnetism. With ferromagnetism, there is much more extensive alignment of the magnetic moments with the magnetic field. With the strength of these magnetic fields (e.g. inside permanent magnets), the Boltzmann factor would predict that ferromagnetism should only be possible at extremely low temperatures(i.e. T<10 K). Experimentally it is found that the ferromagnetic materials become paramagnetic at unexpectedly high temperatures (the Curie temperature ($T_C =1042 K$ for iron). The explanation is that the exchange effect makes for adjacent moments to couple to each other and point in the same direction. This exchange effect is so strong that thermal effects even at room temperature do very little to disrupt this exchange coupling.


text:
# Evaluating Probabilistic/Bayesian Forecasts - PIT Values & How to Generate

Suppose you are modelling a linear regression $$y_i = \alpha + \beta x_i + \epsilon_i$$, in probabilistic terms: $$\mu_i = \alpha + \beta x_i,$$ $$y_i \sim \mathcal{N}(\mu_i, \sigma).$$

For each new data point $$x_{new}$$, when making predictions, you obtain a distribution over possible target variable values. As true density is not observed, we need a method to evaluate this against observed data.

My understanding is that the PIT (Probability Integral Transform) values can be such a method, and can be used to test whether the predictive densities are correctly specified i.e. the 95% forecast interval should contain the future value of the series in 95% of repeated applications.

It seems that once PIT values are obtained, if the predicted forecasts are correctly specified, then the PITs should be more or less uniformly distributed.

However, is it not clear to how these PIT values are calculated and I am yet to find an example of how to do so...

E.g. suppose you have the following output (i.e. observed values of target variable and samples from your posterior predictive (small sample size just for example purpose)), how would you calculate PIT values in this case:

Observed_Data     Predictive_Distribution_Samples
10                [5, 6, 9, 9, 9, 10, 10, 11, 11, 14]
20                [15, 17, 19, 19, 19, 20, 21, 21, 21, 25]
30                [26, 26, 28, 29, 29, 30, 31, 33, 34, 37]

If your predictive distribution for variable $$X$$ has a CDF $$F_X$$, then the PIT of a realized value $$x_0$$ is $$p_0=F_X(x_0)$$. E.g. if your predictive distribution is $$N(\mu,\sigma^2)$$, then R code for obtaining the PIT is p_0=pnorm(x_0,mean=mu,sd=sigma). If $$F_X$$ is not available analytically but you can sample from $$X$$, then to obtain $$p_0$$ you need to calculate the empirical quantile level of $$x_0$$ within a large sample from $$X$$. In R it would be something like p_0=rank(c(x_0,xs))[1]/(length(xs)+1) where xs is a large sample from $$X$$. (Not necessarily the best approximation, but should do.)
With your data I get PITs to be 0.636, 0.591 and 0.591:
x_0 = 10; xs = c(5, 6, 9, 9, 9, 10, 10, 11, 11, 14)