text:
# [SOLVED]How to use Taylor series to represent any well-behaved f(x)

#### DeusAbscondus

##### Active member
Does one assess $x$ at $x=0$ for the entire series? (If so, wouldn't that have the effect of "zeroing" all the co-efficients when one computes?)
only raising the value of $k$ by $1$ at each iteration?
and thereby raising the order of derivative at each iteration?

$$\sum_{k=0}^{\infty}\frac{f^{k}(0)}{k!} x^k= f(0)+\frac{df}{dx}|_0 \ x + \frac{1}{2!}\frac{d^2f}{dx^2}|_0 \ x^2+ \frac{1}{3!}\frac{d^3f}{dx^3}|_0 \ x^3+ ....$$

I have no experience with series or sequences, so, I know I have to remedy this gap in my knowledge.
In the interim, however, I am currently enrolled in a Math course that looks at Calculus by beginning with Taylor series.
I am an adult beginner at Math, having done an introductory crash course in Calculus last year; I wanted to flesh this out: hence my current enrolment.

But I am at a loss to know how to manipulate the notation above and would appreciate a worked solution for some simple $f(x)$ (I won't nominate one, so as to preclude the possibility of my cheating on some set work)
I just need to see this baby in action with a "well-behaved function" of someone else's choosing, with some notes attached if that someone would be so kind.

Thanks,
Deo Abscondo

Last edited:

#### Bacterius

##### Well-known member
MHB Math Helper
Re: How to use Taylor series to represent any well-behaved $f(x)$

Yes, the idea is that as you add more and more terms to the Taylor series, the series approximation becomes better and better and fits the function more closely for values farther away from $x = 0$.

For instance, let's take the venerable $y = \sin(x)$ function. Let's plot it:

The first term of the Taylor series (i.e. the Taylor series approximation at $k = 0$) is just $f(0) = 0$, hence:

Of course, this approximation sucks. Let's try $k = 1$. Then the Taylor series approximation for $k = 1$ is:
$$\sum_{k = 0}^1 \frac{f^k (0)}{k!} x^k = \sin(0) + x \cos(0) = x$$
And our "first-order approximation" for $\sin(x)$ is the curve $y = x$, as illustrated below:

Still not an awesome approximation, but it works pretty well for $x$ close to zero. In fact this is known as the small-angle approximation which says that $\sin(x) \approx x$ for small $x$.

What about the second order approximation $k = 2$, which is given by:
$$\sum_{k = 0}^2 \frac{f^k (0)}{k!} x^k = \sin(0) + x \cos(0) - \frac{sin(0)}{2!} x^2 = x$$
It turns out that the new term becomes zero. Ok.. fine.. that happens, so what about $k = 3$? Now we see that:
$$\sum_{k = 0}^3 \frac{f^k (0)}{k!} x^k = x - \frac{\cos(0)}{3!} x^3 = x - \frac{x^3}{3!}$$
And let's plot this:

Wow! That's a really good approximation for all $|x| < 1$. And we see a pattern: repeatedly differentiating $\sin(x)$ will end up giving you $\cos(x)$, $- \sin(x)$, $- \cos(x)$, $\sin(x)$ endlessly. Every second term will become zero because of the $\sin(0)$ term, so only odd-numbered terms actually matter. We conclude that:
$$\sin(x) = \sum_{k = 0}^\infty \frac{f^k (0)}{k!} x^k = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \cdots$$
Here's the Taylor series approximation for $k = 7$. Check it out:

And here's the one for $k = 9$:

As you add more and more terms, the approximation tends towards the function for larger and larger values of $x$. In the limit, the Taylor series is equal to the original function.

So in other words, a Taylor series is another representation of a function, as an infinite series (a sum of infinitely many terms). A Taylor series approximation is the Taylor series truncated at a finite number of terms, which has the nice property of approximating the function around $x = 0$, and is often easier to calculate and work with, especially in physics where approximations are often used.

There is in fact a theorem that gives the maximal error of the Taylor series approximation at any point $x$ of the function in terms of $k$. Of course, as $k$ tends to infinity, the error tends to zero. This is Taylor's Theorem.

EDIT: uploaded images to imgur for perennity. W|A does strange things to externally linked images.

Last edited:

#### DeusAbscondus

##### Active member
Re: How to use Taylor series to represent any well-behaved $f(x)$

Thanks kindly Bacterius.

But how would this work for a polynomial?
I mean, wouldn't the evaluation $x=0$ lead to "zeroing" all the co-efficients and resulting in non-sense?

If I take the case of $y=x^2+2x$ is this amenable to being described by the same series?
$$\sum_{k=0}^{\infty}\ \frac{f^k (0)}{k!}=0+ 2(0) + \frac{1}{2!}(2\cdot 0) .....$$
This doesn't seem to work! All I get is an infinite string of 0s!

So in other words, a Taylor series is another representation of a function, as an infinite series (a sum of infinitely many terms). A Taylor series approximation is the Taylor series truncated at a finite number of terms, which has the nice property of approximating the function around $x = 0$, and is often easier to calculate and work with, especially in physics where approximations are often used.

There is in fact a theorem that gives the maximal error of the Taylor series approximation at any point $x$ of the function in terms of $k$. Of course, as $k$ tends to infinity, the error tends to zero. This is Taylor's Theorem.

Last edited:

#### Bacterius

##### Well-known member
MHB Math Helper
Re: How to use Taylor series to represent any well-behaved $f(x)$

Taylor series of polynomials have the interesting property that they are in fact equal to the polynomial itself, and all extra terms are zero. In other words, the Taylor series for $x^2 + 2x$ is $x^2 + 2x + 0 + 0 + \cdots$. To see why:
$$f(x) = x^2 + 2x$$
$$f'(x) = 2x + 2$$
$$f''(x) = 2$$
$$f'''(x) = 0$$
.. and any further differentiation still gives zero

So:
$$\sum_{k = 0}^\infty \frac{f^{(k)} (0)}{k!} x^k = \frac{0^2 + 2 \cdot 0}{0!} x^0 + \frac{2 \cdot 0 + 2}{1!} x^1 + \frac{2}{2!} x^2 + 0 + \cdots = 0 + 2x + x^2 + 0 + \cdots = x^2 + 2x$$
So, yes, it still works, although it would seem to be less useful for polynomials than for other functions (but then, polynomials are easy to compute and are already pretty simple. I don't think "reducing" them to infinite series generally helps).

To calculate Taylor series I recommend you write down the iterated derivative of your function $f(x)$ and then plug in the numbers. Remember, $f^{(k)} (0)$ means "the $k$th derivative of $f$ evaluated at $x = 0$". The $x$ in your Taylor series is a different $x$ and is *not* equal to zero.

Also, there is a generalization of Taylor's series which is centered on arbitrarily values of $x$ instead of $x = 0$. I'll let you work out the general expression, though, it's an interesting exercise.

#### DeusAbscondus

##### Active member
Re: How to use Taylor series to represent any well-behaved $f(x)$

That has nailed it for me Bacterius!
Mightily obliged to you.

As per usual, the problem has vanished under the gaze of fresh eyes.

(Going now to chew on this strong meat with a cup of medicinal wine "to aid the digestion")

Cheers,
D'abs

Taylor series of polynomials have the interesting property that they are in fact equal to the polynomial itself, and all extra terms are zero. In other words, the Taylor series for $x^2 + 2x$ is $x^2 + 2x + 0 + 0 + \cdots$. To see why:
$$f(x) = x^2 + 2x$$
$$f'(x) = 2x + 2$$
$$f''(x) = 2$$
$$f'''(x) = 0$$
.. a.

#### DeusAbscondus

##### Active member
Re: How to use Taylor series to represent any well-behaved $f(x)$

The x in your Taylor series is a different x and is *not* equal to zero.
Okay, basically, I'm in the clear .....
but just what is this "different x"?

If it is distinct from the $x$ of my polynomial, by what principle/rule do I distinguish the two when I come to compute the polynomial?

D'abs

#### Bacterius

##### Well-known member
MHB Math Helper
Re: How to use Taylor series to represent any well-behaved $f(x)$

Okay, basically, I'm in the clear .....
but just what is this "different x"?

If it is distinct from the $x$ of my polynomial, by what principle/rule do I distinguish the two when I come to compute the polynomial?

D'abs
The $x$ in the Taylor series is the $x$ at which you are evaluating your Taylor series (or your approximation of it). The derivative is always evaluated at 0 for this version of the Taylor series (sorry I agree it was a bit confusing, there is only one $x$, it's just the derivative is evaluated at a constant).

Essentially you are numerically evaluating derivatives of your original function, and using the resulting values as coefficients for your Taylor series (this is not a particularly useful way to think of it but it may be more intuitive to you to understand what is what)

#### DeusAbscondus

##### Active member
Re: How to use Taylor series to represent any well-behaved $f(x)$

That makes sense.
Meanwhile, I've been plugging and chugging a few simple polynomial functions through the T. series: hehe! what fun! it works!!! (*broadly grins)

You made my day: not understanding was getting me down (as usual);
and, again as usual, once some fresh light comes, and the aha! moment arrives, and one feels exuberant rather than dispirited.

Have a great weekend Bacteriu!

[QUOTEEssentially you are numerically evaluating derivatives of your original function, and using the resulting values as coefficients for your Taylor series (this is not a particularly useful way to think of it but it may be more intuitive to you to understand what is what)[/QUOTE]


text:
# Padding to increase entropy and size of (otherwise) small JSON objects

Maybe this better fits, the security stackexchange...

I'm building a web API. We want to enable some relatively simple encryption, instead of going full-blown OAuth2 (which frankly, IMO, sucks). So I decided to use JWT. Anyway, it could happen for some requests that the request or response payloads are very small. Something like this for example:

{
"order_id": 7
}

I imagine that when you encrypt something as small as this that it'd be relatively easy to brute-force. Therefore I'd like to increase the size of the payload by doing something like this:

{
"order_id": 7,
}

This should work, unless I'm missing something. But ideally, I'd like to prevent the padding from being visible after decoding the JSON payload. I considered using a comment to that end, but JSON does not allow comments and apparently most implementations stick to the specification in that regard.

So is there a better way to do what I want, with the padding disappearing after decrypting/decoding? If anyone has an alternative for JWE, which does not involve OAUTH, I'm also all ears.

-
If you're using proper encryption (with a per-message IV) you don't need to pad the message. –  CodesInChaos Jun 4 at 13:13
What is the attack you want to defend against? If it's finding the key by knowing the plaintext, you need not be worried – all the encryption algorithms JWE may use are secure against known plaintext. If it's inferring the length of plaintext from the length of ciphertext, you may want to pad them all to equal length. –  otus Jun 4 at 13:22

Encryption cannot be brute-forced: verifying a guess is as hard as decrypting. You can encrypt a 1-byte string — even a 1-bit string — and any sane encryption scheme guarantees that an adversary cannot tell which value is encrypted.

You do need to take care that the encryption algorithm is non-deterministic, in that if you encrypt the same plaintext twice, you get different ciphertexts. Otherwise an adversary could tell when you've sent the same message twice. All recommended encryption modes (i.e. anything found in typical libraries other than ECB) provide this guarantee, provided you use them correctly (e.g. using a random IV, which is necessary anyway with some modes).

An adversary can tell the length of the plaintext, or more precisely, can tell in which 16-byte interval it lies (16 bytes being the block size of AES (regardless of key size)). For example, {"order_id": 7} might encrypt to 32 bytes while {"order_id": 17} would encrypt to 48 bytes. You may want to pad all your objects to a constant size to avoid this, or at least arrange for variable-size values to be padded. The padding doesn't need to be random, you just need to manage the length. Given that you're encrypting JSON representations, adding space characters at the end should be fine.

Note that encryption only guarantees that the encrypted message remains secret. It doesn't guarantee that the message hasn't been modified in transit. For that, you need authentication. JWT offers A128CBC-HS256 (AES-128-CBC + HMAC-SHA-256) which combines encryption for confidentiality and a MAC for authenticity; if available on your implementation (it's only recommended in the standard), use the authenticated encryption mode A128GCM (AES-128-GCM).

-
Thanks for the thorough answer. Yeah, the idea was to do signing as well. Question just focused on crypto part. –  aross Jun 4 at 15:41
I'd rather use asymmetric encryption though, not AES. –  aross Jun 4 at 15:44
@aross Asymmetric encryption is never used for ordinary data directly — it would be technically possible but extremely slow and libraries aren't set up for it. What you do is hybrid encryption: generate a random AES key, use an AES mode to encrypt (and authenticate) the data (your JSON string), and use public-key encryption on the AES key. You can keep using the AES key as long as the other party still has it. JWT only standardizes RSAES-PKCS1-V1_5 for asymmetric encryption, which is not perfect. –  Gilles Jun 4 at 15:55

Assuming you are afraid that the attacker will find out the length of the ID – i.e. be able to narrow it down to 1-9 or 10-99, you can do the following.

I considered using a comment to that end, but JSON does not allow comments and apparently most implementations stick to the specification in that regard.

You could simply whitespace-pad the ID to a constant size: i.e. something like:

7   -> "         7" (" "*9 + "7")
123 -> "       123" (" "*29 + "123")

-
I'm encrypting the entire string representation of the JSON object. Not just the values. –  aross Jun 4 at 14:06
@aross, that shouldn't prevent you from placing whitespace in the JSON string. If that's problematic otherwise, you can make the ID a constant width string (encoding an int) before generating the JSON. –  otus Jun 4 at 14:32
Or use a fixed-width number format like 0x00000007 and 0x0000007B –  bmm6o Jun 4 at 15:10
@otus, right... that's an idea –  aross Jun 4 at 15:37

format: plain


text:
Version:
0.4
When typing an open interval as $]a,b[$, a closing bracket is being used in place of an opening fence and vice versa. This leads to the wrong spacing in, say, $]-a,b[$ or $A\in]a,b[=B$. The package attempts to solve this using: \interval{a}{b} -> [a,b] \interval[open]{a}{b} -> ]a,b[ \interval[open left]{a}{b} -> ]a,b] The package also supports fence scaling and ensures that the enclosing fences will end up having the proper closing and opening types. TeX maths does not do this job properly. The package depends on pgfkeys.


text:
# Need help with deciphering calculus 2 problem

## Homework Statement

Use substitution to show that for any continuous function f,
$$\int_0^{\pi/2} f(\sin x)\,dx = \int_0^{\pi/2} f(\cos x)\,dx.$$

## Homework Equations

$$\cos(\pi/2-x)=\sin x$$

## The Attempt at a Solution

My confusion is that f is inside the integral, and I have no idea if it would change anything.

When I do the substitution normally, I get $\int_0^{\pi/2} f(\cos u)\,du$, but that doesn't help because it is in terms of u and not x.

Can someone help me understand this?

Last edited by a moderator:

Related Calculus and Beyond Homework Help News on Phys.org
Shoot. I don't know how the formatting works on this site. The squigly line is an integrand and they all go from 0 to pi/2.

Last edited:
eumyang
Homework Helper
When I do the substitution normally, I get $\int_0^{\pi/2} f(\cos u)\,du$, but that doesn't help because it is in terms of u and not x.
I don't think it matters. In the definite integrals of f(x) dx, from x = a to x = b, x is a dummy variable, since it could be replaced everywhere by any other letter and the meaning would be unchanged. So IIRC you can just change the letters from
$$\int_0^{\pi/2} f(\cos u)\,du$$
to
$$\int_0^{\pi/2} f(\cos x)\,dx$$
and you're done.


text:
# Mathematica – Another Day

I tried some less obvious things. Here is a sound with Mathematica.

Clicking the play button plays the sound as expected. The same can be achieved in Euler with a bit more effort.

>t=soundsec(6); s=(sin(440*t)+sin(660*t))*(2+sin(2*t))/(t+1);
>playwave(s);

Euler is saving the file in wav format to the temporary directory, and plays it from there using the sound API of Windows. It is a bit harder to get the Fourier analysis.

>figure(3,1); figure(1); mapsound(s); ...
> figure(2); analyzesound(s); ...
> figure(3); plot2d(t,s); ...
> figure(0):

Mathematica has so many nice graphics in the Web. I wanted to try to produce some of them. Here is a starting point for image processing with Mathematica. Or have a look at this page. This is all very beautiful. Mathematica is really leading on this area.

I tried to create some images on my own, but the results were disappointing. You obviously need the right parameters. The trial version cannot save PNG files, so it is hard to test this properly. All examples I showed you till now are screen dumps. Here is another example. It is from this page. By the way, I don’t want to be nit-picking, but the page blocked my browser. I could read off this example however. It is straightforward.

This is a screen dump. I tried various export formats, but most did not work in the trial. One that worked was PDF. It  produced a PDF file, which can be loaded to the Acrobat Reader. But I was surprised to experience a very, very sloooow display. I have no idea, how Mathematica saves its graphics to PDF. But you can see triangle for triangle appearing on the display. If you are interested, you can study the 5MB PDF file.

I took a screen dump of the PDF output.

This is all not very encouraging.  Let me try that in Euler.

>plot3d("x*sin(x*y)",r=pi,fscale=1,n=100,>hue,grid=10,zoom=3, ...
> angle=45°,height=45°):

Euler can save SVG too. I tried that and opened the file in the Opera browser. You can then zoom in and out. The first display is a bit slow, but not as slow as the PDF file above. Here is a screen dump.

I am sorry if I leave the impression that I am comparing Mathematica and Euler. I am not. It is just so, that I have some experience with Euler and Maxima, which allows me to estimate and validate the results of Mathematica.

SVG is a format that works in the trial. But the output was very disappointing. I do not expect this kind of bug in a professional program of this price range.

Diese Website verwendet Akismet, um Spam zu reduzieren. Erfahre mehr darüber, wie deine Kommentardaten verarbeitet werden.


text:
1. ## vectors

if this is wrong place please mvoe i dont know what topic vector belong in

so basically this i sthe qu

find x so the two vectors are perpendiculs

v1= (1,1,0)^T
v2= (x,1-1,)^T

the nfind a cross product

i dont have any source materials/TEXTS before people say read your text book etc which always happen. i am not in school...

2. Two vectors are perpendicular if there dot product is zero.
$\cdot=ap+bq+cr$

3. Originally Posted by mathcore
if this is wrong place please mvoe i dont know what topic vector belong in

so basically this i sthe qu

find x so the two vectors are perpendiculs

v1= (1,1,0)^T
v2= (x,1-1,)^T

the nfind a cross product

i dont have any source materials/TEXTS before people say read your text book etc which always happen. i am not in school...
You have no access to a library so that you could borrow an appropriate textbook?

Furthermore, here is what I get when I use Google and the search string 'two vectors perpendicular': Google

I'm sure with a little browsing many useful websites would be found ....

The same thing can be done with 'cross product'.

People don't mind helping, but most would prefer that the obvious possibilities for help, some of which admittedly require a little effort, have first been exhausted by the person askng for help.

4. Originally Posted by Plato
Two vectors are perpendicular if there dot product is zero.
$\cdot=ap+bq+cr$

i didnt say i dont know what makes t wo vector perpemdiculuar

i said i dont know HOW to make them

so what we have here is a power ^T on each side what do u do with this

and fantastic guy the google link dont help. yes i have looked on all those websites and i dont get it thats why im askin help.

5. Originally Posted by mathcore
i didnt say i dont know what makes t wo vector perpemdiculuar
i said i dont know HOW to make them
so what we have here is a power ^T on each side what do u do with this
.
Can you solve $(1)(x)+(1)(1)+(0)(-1)=0~?$
The ^T is for transpose: $\[
\left\langle {a,b,c} \right\rangle ^T = \left[ {\begin{array}{*{20}c} a \\ b \\ c \\ \end{array} } \right]$

Originally Posted by mathcore
and fantastic guy the google link dont help. yes i have looked on all those websites and i dont get it thats why im askin help.
Now for your attitude. It is not our fault that you seem to not be able to make yourself clear as to what you really need to ask. Moreover, you choose to use sort of web-blather, no caps, no complete sentences, etc. All of that makes it difficult to read your posts.

6. Originally Posted by mathcore
i didnt say i dont know what makes t wo vector perpemdiculuar

i said i dont know HOW to make them

so what we have here is a power ^T on each side what do u do with this

and fantastic guy the google link dont help. yes i have looked on all those websites and i dont get it thats why im askin help.
The ^T is merely notation to represent the vectors as column matrices. Wherever the question has come from assumes that you are familiar with this notation.

For all practical purposes the vectors are <1,1,0> and <x,1,-1>. You've been given the tool for solving the question. And if none of the Google links help I'd be greatly surprised.

Where has the question come from and why are you trying to solve it?

7. so does it means x + 1 + -1 = o so x = 0

8. Originally Posted by mathcore
so does it means x + 1 + -1 = o so x = 0
Is you real problem that you cannot do basic algebra?
$(1)(x)+(1)(1)+(0)(-1)=x+1=0$ that means $x=-1$.

9. ok thanks

Using the cross product, find a unit vector ^c
so that ^a;^b and ^c are the unit vectors for a right-handed coordinate system.

i have the unit vectors ^a and ^b but what do i need to do next? is it asking me find cross product a and b? or ^a and ^b?

sorry but why is this is PRE university? this is university materiall...

10. Originally Posted by mathcore
ok thanks


text:
# Item response theory (IRT) for continuous responses

I hope this message finds everyone safe and well.

I want to estimate the Rasch item difficulty parameters for my test items (dataset below). However, I have two challenges:

(1) Item scores are continuous between 0 and 1 (item_score)

(2) Test is adaptive and thus, items (item_id) vary across persons (person_id)

Is there an R package to take (1) and (2) into account (I highly appreciate a demonstration)?

--Many thanks

#===== Dataset in R
dat <- read.csv('https://raw.githubusercontent.com/izeh/n/master/g.csv', stringsAsFactors = F)

• Does this stats.stackexchange.com/questions/44515/… help? May 2 '20 at 15:14
• @mdewey, not really I have stated specific challenges that require a different answer. May 2 '20 at 15:40

Edit: This answer is not correct. It's not clear to me what OP is looking for, but take a look at the discussion at https://chat.stackexchange.com/rooms/107527/discussion-between-jeremy-miles-and-user7148318 before answering.

There is no package that can do this (as far as I know).

The lavaan package for sem does not give standard errors for latent variable estimates (and I don't know you can predict a model with new data).

You might be able to do this with merTools::predictInterval(), however I'm having trouble understanding your data. What identifies the question?

You see to have very large number of questions (~ 16000?) - each of which is not answered by very many people, so your standard errors will be high. Have I understood that correctly?

My guess is that the will look like:

library(dplyr)
library(lme4)
library(merTools)
dat <- read.csv('https://raw.githubusercontent.com/izeh/n/master/g.csv', stringsAsFactors = F)

dat\$item_id <- factor(item_id)

dat_no_1 <- dat[dat$$person_id != 1, ] dat_no_1 <- dat[dat$$person_id > 1, ]

fit1 <- lme4::lmer(item_score ~ as.factor(item_id) +
(1 | person_id),
data = dat_no_1)
system.time(
pred1 <-
merTools::predictInterval(fit1,
newdata = dat_no_1,
n.sims = 999)
)

I can't test this though, as I run out of memory.

Note that this ignores the non-normality issue.

• First of all, thank you! so, the test is computer adaptive. It assigns items to test takers based on their response (i.e., if correct makes the next one harder, if incorrect make the next one easier). The item_id identifies the specific question targeted by each test taker. Each test for each person consists of 5 different item_types. Speaking of lavaan, it seems this page talks about a transformation on the responses and than using lavaan, do you think it makes sense for this data? BTW, what are the item difficulty parameters in your code? May 2 '20 at 20:49
• Item difficulty parameters are the intercepts. The code i wrote is the first step - you get the item parameters (these are stored in fit1) then you predict the CI of person 1. If the CI is sufficienlty small, you can stop. If not, give them another item - so you'd need to wrap this in some sort of loop. The system.time() part is the time it takes to score the individual, I don't know how long this would take - if it's too long, presumably it's not feasible. May 2 '20 at 21:01
• Do you really have 16k items? May 2 '20 at 21:02
• !! OK, that's a lot. You definitely can't use lavaan for this. Can you run the code I put in the answer? (I can't on my current machine.) May 2 '20 at 21:17
• You can't test the cat on any person who has taken an item that no other person has taken. May 2 '20 at 21:18


text:
# Koch Snowflake

The Koch Snowflake is a fractal based on a very simple rule.

The Rule: Whenever you see a straight line, like the one on the left, divide it in thirds and build an equilateral triangle (one with all three sides equal) on the middle third, and erase the base of the equilateral triangle, so that it looks like the thing on the right.

The Koch Snowflake happens when we repeat this process indefinitely on an equilateral triangle. (You could try this on other shapes, too, but I’ll leave those variations for you to explore.) Let’s walk through the steps.

We start with this triangle. Now for each of the three sides, we apply The Rule, so it becomes a 6-pointed star. (The new lines that we just added are in red.)

Then for each side of the 6-pointed star, we apply The Rule again, so it looks like this.

After we apply The Rule again to the result it starts to look much more like a snowflake.

And we can keep going – here’s the next iteration. (I’ll drop the red coloring now that you get the idea.)

And if we continue this on to infinity, we get the Koch Snowflake.

Well, this is a very pretty thing. It looks like the most intricate snowflake that ever fell out of the sky.

Here’s an interesting question: What is the perimeter of the Koch Snowflake? In other words, if you were a bug and you wanted to walk along all those squiggles, how far would you have to travel?

To answer that, let’s look back at our Rule for a moment.

Every time we apply The Rule to a line segment, we’re replacing that segment with $4$ little segments each $\frac{1}{3}$ the length of the original. That means we’re multiplying the length of the segment by $\frac{4}{3}$. If we do this for all the line segments in the snowflake, the net effect is to multiply the entire perimeter by $\frac{4}{3}$. Intuitively, we can see that the perimeter is going to become infinitely squiggly, and that a bug walking along it would need to travel an infinite distance. (That would literally take forever!) If we want to prove it, we can walk through the following logic:

• Our original triangle had some side length, which we can call $s$.
• Since all three sides were the same length, the triangle’s perimeter was $3 \cdot s$.
• When we applied The Rule once, we replaced each line segment with $4$ little segments each $\frac{1}{3}$ the original length, which means we multiplied the length of each segment by $\frac{4}{3}$.
• That made the snowflake’s perimeter $3 \cdot s \cdot \frac{4}{3}$.
• When we applied The Rule a second time, we again multiplied the perimeter by $\frac{4}{3}$.
• That made the snowflake’s perimeter $3 \cdot s \cdot \frac{4}{3} \cdot \frac{4}{3}$ , which equals $3 \cdot s \cdot \left(\frac{4}{3}\right)^2$.
• When we applied The Rule a third time, we again multiplied the perimeter by $\frac{4}{3}$.
• That made the snowflake’s perimeter $3 \cdot s \cdot \left(\frac{4}{3}\right)^3$.
• In general, if we apply The Rule $n$ times, the snowflake’s perimeter will be $3 \cdot s \cdot \left(\frac{4}{3}\right)^n$.
• Since $\frac{4}{3}$ is bigger than 1, as $n$ gets bigger and bigger off to infinity, $\left(\frac{4}{3}\right)^n$ gets bigger and bigger off to infinity as well, which means the perimeter of the snowflake really is infinite.

So the perimeter of the Koch Snowflake is infinite. This fact is really mind-boggling when you consider that the Koch Snowflake has a finite area. You could build a fence around it like the picture below:

But you could never build a fence that traces its perimeter exactly.

If we’re very careful and clever about it, we can actually calculate the area of the Koch Snowflake. (If you’re curious, the derivation is here.) It turns out that if we start with a triangle with side length $s$, the area of the snowflake is

$$\dfrac{2s^2\sqrt{3}}{5}$$

The important part, though, is the idea of infinite squiggles all crumpled up in a finite space: infinite perimeter, finite area. This infinite detail is characteristic of fractals; it’s fascinating and mind-blowing. If you’d like to explore more fractals, there are more listed here!


text:
# How to deal with errors of defining data types in pandas' read_csv ()?

I have a table with 118,000 rows and 80 columns. I would like to select 8 columns from the table. I am reading the file using the pandas function pd.read_csv command as:

df = pd.read_csv(filename, header=None, sep='|',
usecols=[1,3,4,5,37,40,51,76])

I would like to change the data type of each column inside of read_csv using dtype={'5': np.float, '37': np.float, ....}, but this does not work.

There is a message that column 5 has mixed types. The command print(df.dtypes) shows all columns of the type object. When I examine the column 5, I cannot see any problems. I have to change the data type for each column separately using pd.to_numeric.

My question is: Is there a way of setting data types inside read_csv and what is the problem in this case?

If you see the warning that your column has mixed types, but you only see numbers there, it could be that missing values are causing the problem.

In Pandas 1.0.0, a new function has been introduced to try to solve that problem. Namely, the Dataframe.convert_dtypes (docs).

You can use it like this:

df = pd.read_csv(filename, header=None, sep='|', usecols=[1,3,4,5,37,40,51,76])
df = df.convert_dtypes()

then check the type of the columns

print(df.dtypes)

• Thanks for the new function. I solved this problem by converting columns datatype after importing them into df. I passed a list of columns I needed to convert into for loop. That worked. For example: col_list=['col1', 'col2', 'col5', etc...] and than using for loop for col in col_list: df[col]=pd.to_numeric(df[col], errors='coerce') Thanks – Liliana Apr 23 '20 at 11:00
• @Liliana just be careful that you have errors='coerce' which could mean that you lose some data unwillingly. – Bruno Lubascher Apr 23 '20 at 11:08
• Thanks. Good idea to compare input and output files. – Liliana Apr 28 '20 at 10:59

You could try just using your own solution, replacing np.float:

dtype={'5': pd.to_numeric, '37': np.float, ....}

Or make a function that does what you want:

def convert(val):
try:
return np.float(val)
except:
return float(val)
except:
return pd.to_numeric(val)

return val

Then:

dtype={'5': convert, '37': np.float, ....}

That is a bit exaggerated, but you get the idea :)


text:
# Étale cohomology

In mathematics, the étale cohomology groups of an algebraic variety or scheme are algebraic analogues of the usual cohomology groups with finite coefficients of a topological space, introduced by Grothendieck in order to prove the Weil conjectures. Étale cohomology theory can be used to construct ℓ-adic cohomology, which is an example of a Weil cohomology theory in algebraic geometry. This has many applications, such as the proof of the Weil conjectures and the construction of representations of finite groups of Lie type.

## History

Étale cohomology was introduced by Alexander Grothendieck (1960), using some suggestions by Jean-Pierre Serre, and was motivated by the attempt to construct a Weil cohomology theory in order to prove the Weil conjectures. The foundations were soon after worked out by Grothendieck together with Michael Artin, and published as (Artin 1962) and SGA 4. Grothendieck used étale cohomology to prove some of the Weil conjectures (Bernard Dwork had already managed to prove the rationality part of the conjectures in 1960 using p-adic methods), and the remaining conjecture, the analogue of the Riemann hypothesis was proved by Pierre Deligne (1974) using ℓ-adic cohomology.

Further contact with classical theory was found in the shape of the Grothendieck version of the Brauer group; this was applied in short order to diophantine geometry, by Yuri Manin. The burden and success of the general theory was certainly both to integrate all this information, and to prove general results such as Poincaré duality and the Lefschetz fixed point theorem in this context.

Grothendieck originally developed étale cohomology in an extremely general setting, working with concepts such as Grothendieck toposes and Grothendieck universes. With hindsight, much of this machinery proved unnecessary for most practical applications of the étale theory, and Deligne (1977) gave a simplified exposition of étale cohomology theory. Grothendieck's use of these universes (whose existence cannot be proved in Zermelo–Fraenkel set theory) led to some uninformed speculation that étale cohomology and its applications (such as the proof of Fermat's last theorem) needed axioms beyond ZFC. In practice étale cohomology is used mainly for constructible sheaves over schemes of finite type over the integers, and this needs no deep axioms of set theory: with a little care it can be constructed in this case without using any uncountable sets, and this can easily be done in ZFC (and even in much weaker theories).

Étale cohomology quickly found other applications, for example Deligne and George Lusztig used it to construct representations of finite groups of Lie type; see Deligne–Lusztig theory.

## Motivation

For complex algebraic varieties, invariants from algebraic topology such as the fundamental group and cohomology groups are very useful, and one would like to have analogues of these for varieties over other fields, such as finite fields. (One reason for this is that Weil suggested that the Weil conjectures could be proved using such a cohomology theory.) In the case of cohomology of coherent sheaves, Serre showed that one could get a satisfactory theory just by using the Zariski topology of the algebraic variety, and in the case of complex varieties this gives the same cohomology groups (for coherent sheaves) as the much finer complex topology. However, for constant sheaves such as the sheaf of integers this does not work: the cohomology groups defined using the Zariski topology are badly behaved. For example, Weil envisioned a cohomology theory for varieties over finite fields with similar power as the usual singular cohomology of topological spaces, but in fact, any constant sheaf on an irreducible variety has trivial cohomology (all higher cohomology groups vanish).

The reason that the Zariski topology does not work well is that it is too coarse: it has too few open sets. There seems to be no good way to fix this by using a finer topology on a general algebraic variety. Grothendieck's key insight was to realize that there is no reason why the more general open sets should be subsets of the algebraic variety: the definition of a sheaf works perfectly well for any category, not just the category of open subsets of a space. He defined étale cohomology by replacing the category of open subsets of a space by the category of étale mappings to a space: roughly speaking, these can be thought of as open subsets of finite unbranched covers of the space. These turn out (after a lot of work) to give just enough extra open sets that one can get reasonable cohomology groups for some constant coefficients, in particular for coefficients Z/nZ when n is coprime to the characteristic of the field one is working over.

Some basic intuitions of the theory are these:

• The étale requirement is the condition that would allow one to apply the implicit function theorem if it were true in algebraic geometry (but it isn't — implicit algebraic functions are called algebroid in older literature).
• There are certain basic cases, of dimension 0 and 1, and for an abelian variety, where the answers with constant sheaves of coefficients can be predicted (via Galois cohomology and Tate modules).

## Definitions

For any scheme X the category Et(X) is the category of all étale morphisms from a scheme to X. It is an analogue of the category of open subsets of a topological space, and its objects can be thought of informally as "étale open subsets" of X. The intersection of two open sets of a topological space corresponds to the pullback of two étale maps to X. There is a rather minor set-theoretical problem here, since Et(X) is a "large" category: its objects do not form a set. However, it is equivalent to a small category because étale morphisms are locally of finite presentation, so it is harmless to pretend that it is a small category.

A presheaf on a topological space X is a contravariant functor from the category of open subsets to sets. By analogy we define an étale presheaf on a scheme X to be a contravariant functor from Et(X) to sets.

A presheaf F on a topological space is called a sheaf if it satisfies the sheaf condition: whenever an open subset is covered by open subsets Ui, and we are given elements of F(Ui) for all i whose restrictions to UiUj agree for all i, j, then they are images of a unique element of F(U). By analogy, an étale presheaf is called a sheaf if it satisfies the same condition (with intersections of open sets replaced by pullbacks of étale morphisms, and where a set of étale maps to U is said to cover U if the topological space underlying U is the union of their images). More generally, one can define a sheaf for any Grothendieck topology on a category in a similar way.

The category of sheaves of abelian groups over a scheme has enough injective objects, so one can define right derived functors of left exact functors. The étale cohomology groups Hi(F) of the sheaf F of abelian groups are defined as the right derived functors of the functor of sections,

${\displaystyle F\to \Gamma (F)}$

(where the space of sections Γ(F) of F is F(X)). The sections of a sheaf can be thought of as Hom(Z, F) where Z is the sheaf that returns the integers as an abelian group. The idea of derived functor here is that the functor of sections doesn't respect exact sequences as it is not right exact; according to general principles of homological algebra there will be a sequence of functors H0, H1, ... that represent the 'compensations' that must be made in order to restore some measure of exactness (long exact sequences arising from short ones). The H0 functor coincides with the section functor Γ.

More generally, a morphism of schemes f : XY induces a map f from étale sheaves over X to étale sheaves over Y, and its right derived functors are denoted by Rqf, for q a non-negative integer. In the special case when Y is the spectrum of an algebraically closed field (a point), Rqf(F) is the same as Hq(F).

Suppose that X is a Noetherian scheme. An abelian étale sheaf F over X is called finite locally constant if it is represented by an étale cover of X. It is called constructible if X can be covered by a finite family of subschemes on each of which the restriction of F is finite locally constant. It is called torsion if F(U) is a torsion group for all étale covers U of X. Finite locally constant sheaves are constructible, and constructible sheaves are torsion. Every torsion sheaf is a filtered inductive limit of constructible sheaves.

In applications to algebraic geometry over a finite field Fq with characteristic p, the main objective was to find a replacement for the singular cohomology groups with integer (or rational) coefficients, which are not available in the same way as for geometry of an algebraic variety over the complex number field. Étale cohomology works fine for coefficients Z/nZ for n co-prime to p, but gives unsatisfactory results for non-torsion coefficients. To get cohomology groups without torsion from étale cohomology one has to take an inverse limit of étale cohomology groups with certain torsion coefficients; this is called ℓ-adic cohomology, where ℓ stands for any prime number different from p. One considers, for schemes V, the cohomology groups

${\displaystyle H^{i}(V,\mathbf {Z} /\ell ^{k}\mathbf {Z} )}$

and defines the ℓ-adic cohomology group

${\displaystyle H^{i}(V,\mathbf {Z} _{\ell })=\varprojlim H^{i}(V,\mathbf {Z} /\ell ^{k}\mathbf {Z} )}$

as their inverse limit. Here Z denotes the ℓ-adic integers, but the definition is by means of the system of 'constant' sheaves with the finite coefficients Z/ℓkZ. (There is a notorious trap here: cohomology does not commute with taking inverse limits, and the ℓ-adic cohomology group, defined as an inverse limit, is not the cohomology with coefficients in the étale sheaf Z; the latter cohomology group exists but gives the "wrong" cohomology groups.)

More generally, if F is an inverse system of étale sheaves Fi, then the cohomology of F is defined to be the inverse limit of the cohomology of the sheaves Fi

${\displaystyle H^{q}(X,F)=\varprojlim H^{q}(X,F_{i}),}$

and though there is a natural map

${\displaystyle H^{q}(X,\varprojlim F_{i})\to \varprojlim H^{q}(X,F_{i}),}$

this is not usually an isomorphism. An ℓ-adic sheaf is a special sort of inverse system of étale sheaves Fi, where i runs through positive integers, and Fi is a module over Z/ℓiZ and the map from Fi+1 to Fi is just reduction mod Z/ℓiZ.

When V is a non-singular algebraic curve of genus g, H1 is a free Z-module of rank 2g, dual to the Tate module of the Jacobian variety of V. Since the first Betti number of a Riemann surface of genus g is 2g, this is isomorphic to the usual singular cohomology with Z coefficients for complex algebraic curves. It also shows one reason why the condition ℓ  p is required: when ℓ = p the rank of the Tate module is at most g.

Torsion subgroups can occur, and were applied by Michael Artin and David Mumford to geometric questions. To remove any torsion subgroup from the ℓ-adic cohomology groups and get cohomology groups that are vector spaces over fields of characteristic 0 one defines

${\displaystyle H^{i}(V,\mathbf {Q} _{\ell })=H^{i}(V,\mathbf {Z} _{\ell })\otimes \mathbf {Q} _{\ell }.}$

This notation is misleading: the symbol Q on the left represents neither an étale sheaf nor an ℓ-adic sheaf. The etale cohomology with coefficients in the constant etale sheaf Q does also exist but is quite different from ${\displaystyle H^{i}(V,\mathbf {Z} _{\ell })\otimes \mathbf {Q} _{\ell }}$. Confusing these two groups is a common mistake.

## Properties

In general the ℓ-adic cohomology groups of a variety tend to have similar properties to the singular cohomology groups of complex varieties, except that they are modules over the ℓ-adic integers (or numbers) rather than the integers (or rationals). They satisfy a form of Poincaré duality on non-singular projective varieties, and the ℓ-adic cohomology groups of a "reduction mod p" of a complex variety tend to have the same rank as the singular cohomology groups. A Künneth formula also holds.

For example, the first cohomology group of a complex elliptic curve is a free module of rank 2 over the integers, while the first ℓ-adic cohomology group of an elliptic curve over a finite field is a free module of rank 2 over the ℓ-adic integers, provided ℓ is not the characteristic of the field concerned, and is dual to its Tate module.

There is one way in which ℓ-adic cohomology groups are better than singular cohomology groups: they tend to be acted on by Galois groups. For example, if a complex variety is defined over the rational numbers, its ℓ-adic cohomology groups are acted on by the absolute Galois group of the rational numbers: they afford Galois representations.

Elements of the Galois group of the rationals, other than the identity and complex conjugation, do not usually act continuously on a complex variety defined over the rationals, so do not act on the singular cohomology groups. This phenomenon of Galois representations is related to the fact that the fundamental group of a topological space acts on the singular cohomology groups, because Grothendieck showed that the Galois group can be regarded as a sort of fundamental group. (See also Grothendieck's Galois theory.)

## Calculation of étale cohomology groups for algebraic curves

The main initial step in calculating étale cohomology groups of a variety is to calculate them for complete connected smooth algebraic curves X over algebraically closed fields k. The étale cohomology groups of arbitrary varieties can then be controlled using analogues of the usual machinery of algebraic topology, such as the spectral sequence of a fibration. For curves the calculation takes several steps, as follows (Artin 1962). Let Gm denote the sheaf of non-vanishing functions.

### Calculation of H1(X, Gm)

The exact sequence of étale sheaves

${\displaystyle 1\to \mathbf {G} _{m}\to j_{*}\mathbf {G} _{m,K}\to \bigoplus _{x\in |X|}i_{x*}\mathbf {Z} \to 1}$

gives a long exact sequence of cohomology groups

{\displaystyle {\begin{aligned}0&\to H^{0}(\mathbf {G} _{m})\to H^{0}(j_{*}\mathbf {G} _{m,K})\to \bigoplus \nolimits _{x\in |X|}H^{0}(i_{x*}\mathbf {Z} )\to \\&\to H^{1}(\mathbf {G} _{m})\to H^{1}(j_{*}\mathbf {G} _{m,K})\to \bigoplus \nolimits _{x\in |X|}H^{1}(i_{x*}\mathbf {Z} )\to \\&\to \cdots \end{aligned}}}

Here j is the injection of the generic point, ix is the injection of a closed point x, Gm,K is the sheaf Gm on Spec K (the generic point of X), and Zx is a copy of Z for each closed point of X. The groups Hi(ix*Z) vanish if i > 0 (because ix*Z is a skyscraper sheaf) and for i = 0 they are Z so their sum is just the divisor group of X. Moreover, the first cohomology group H1(X, jGm,K) is isomorphic to the Galois cohomology group H1(K, K*) which vanishes by Hilbert's theorem 90. Therefore, the long exact sequence of étale cohomology groups gives an exact sequence

${\displaystyle K\to \mathrm {Div} (X)\to H^{1}(\mathbf {G} _{m})\to 1}$

where Div(X) is the group of divisors of X and K is its function field. In particular H1(X, Gm) is the Picard group Pic(X) (and the first cohomology groups of Gm are the same for the étale and Zariski topologies). This step works for varieties X of any dimension (with points replaced by codimension 1 subvarieties), not just curves.

### Calculation of Hi(X, Gm)

The same long exact sequence above shows that if i  2 then the cohomology group Hi(X, Gm) is isomorphic to Hi(X, j*Gm,K), which is isomorphic to the Galois cohomology group Hi(K, K*). Tsen's theorem implies that the Brauer group of a function field K in one variable over an algebraically closed field vanishes. This in turn implies that all the Galois cohomology groups Hi(K, K*) vanish for i  1, so all the cohomology groups Hi(X, Gm) vanish if i  2.

### Calculation of Hi(X, μn)

If μn is the sheaf of n-th roots of unity and n and the characteristic of the field k are coprime integers, then:

${\displaystyle H^{i}(X,\mu _{n})={\begin{cases}\mu _{n}(k)&i=0\\\mathrm {Pic} _{n}(X)&i=1\\\mathbf {Z} /n\mathbf {Z} &i=2\\0&i\geqslant 3\end{cases}}}$

where Picn(X) is group of n-torsion points of Pic(X). This follows from the previous results using the long exact sequence

{\displaystyle {\begin{aligned}0&\to H^{0}(X,\mu _{n})\to H^{0}(X,\mathbf {G} _{m})\to H^{0}(X,\mathbf {G} _{m})\to \\&\to H^{1}(X,\mu _{n})\to H^{1}(X,\mathbf {G} _{m})\to H^{1}(X,\mathbf {G} _{m})\to \\&\to H^{2}(X,\mu _{n})\to H^{2}(X,\mathbf {G} _{m})\to H^{2}(X,\mathbf {G} _{m})\to \\&\to \cdots \end{aligned}}}

of the Kummer exact sequence of étale sheaves

${\displaystyle 1\to \mu _{n}\to \mathbf {G} _{m}{\xrightarrow {(\cdot )^{n}}}\mathbf {G} _{m}\to 1.}$

and inserting the known values

${\displaystyle H^{i}(X,\mathbf {G} _{m})={\begin{cases}k^{*}&i=0\\\mathrm {Pic} (X)&i=1\\0&i\geqslant 2\end{cases}}}$

In particular we get an exact sequence

${\displaystyle 1\to H^{1}(X,\mu _{n})\to \mathrm {Pic} (X){\xrightarrow {\times n}}\mathrm {Pic} (X)\to H^{2}(X,\mu _{n})\to 1.}$

If n is divisible by p this argument breaks down because p-th roots of unity behave strangely over fields of characteristic p. In the Zariski topology the Kummer sequence is not exact on the right, as a non-vanishing function does not usually have an n-th root locally for the Zariski topology, so this is one place where the use of the étale topology rather than the Zariski topology is essential.

### Calculation of H i(X, Z/nZ)

By fixing a primitive n-th root of unity we can identify the group Z/nZ with the group μn of n-th roots of unity. The étale group Hi(X, Z/nZ) is then a free module over the ring Z/nZ and its rank is given by:

${\displaystyle {\text{rank}}(H^{i}(X,\mathbf {Z} /n\mathbf {Z} ))={\begin{cases}1&i=0\\2g&i=1\\1&i=2\\0&i\geqslant 3\end{cases}}}$

where g is the genus of the curve X. This follows from the previous result, using the fact that the Picard group of a curve is the points of its Jacobian variety, an abelian variety of dimension g, and if n is coprime to the characteristic then the points of order dividing n in an abelian variety of dimension g over an algebraically closed field form a group isomorphic to (Z/nZ)2g. These values for the étale group Hi(X, Z/nZ) are the same as the corresponding singular cohomology groups when X is a complex curve.

### Calculation of Hi(X, Z/pZ)

It is possible to calculate étale cohomology groups with constant coefficients of order divisible by the characteristic in a similar way, using the Artin–Schreier sequence

${\displaystyle 0\to \mathbf {Z} /p\mathbf {Z} \to K\ {\xrightarrow {{} \atop x\mapsto x^{p}-x}}\ K\to 0}$

instead of the Kummer sequence. (For coefficients in Z/pnZ there is a similar sequence involving Witt vectors.) The resulting cohomology groups usually have ranks less than that of the corresponding groups in characteristic 0.

## Examples of étale cohomology groups

• If X is the spectrum of a field K with absolute Galois group G, then étale sheaves over X correspond to continuous sets (or abelian groups) acted on by the (profinite) group G, and étale cohomology of the sheaf is the same as the group cohomology of G, i.e. the Galois cohomology of K.
• If X is a complex variety, then étale cohomology with finite coefficients is isomorphic to singular cohomology with finite coefficients. (This does not hold for integer coefficients.) More generally the cohomology with coefficients in any constructible sheaf is the same.
• If F is a coherent sheaf (or Gm) then the étale cohomology of F is the same as Serre's coherent sheaf cohomology calculated with the Zariski topology (and if X is a complex variety this is the same as the sheaf cohomology calculated with the usual complex topology).
• For abelian varieties and curves there is an elementary description of ℓ-adic cohomology. For abelian varieties the first ℓ-adic cohomology group is the dual of the Tate module, and the higher cohomology groups are given by its exterior powers. For curves the first cohomology group is the first cohomology group of its Jacobian. This explains why Weil was able to give a more elementary proof of the Weil conjectures in these two cases: in general one expects to find an elementary proof whenever there is an elementary description of the ℓ-adic cohomology.

## Poincaré duality and cohomology with compact support

The étale cohomology groups with compact support of a variety X are defined to be

${\displaystyle H_{c}^{q}(X,F)=H^{q}(Y,j_{!}F)}$

where j is an open immersion of X into a proper variety Y and j! is the extension by 0 of the étale sheaf F to Y. This is independent of the immersion j. If X has dimension at most n and F is a torsion sheaf then these cohomology groups ${\displaystyle H_{c}^{q}(X,F)}$ with compact support vanish if q > 2n, and if in addition X is affine of finite type over a separably closed field the cohomology groups ${\displaystyle H^{q}(X,F)}$ vanish for q > n (for the last statement, see SGA 4, XIV, Cor.3.2).

More generally if f is a separated morphism of finite type from X to S (with X and S Noetherian) then the higher direct images with compact support Rqf! are defined by

${\displaystyle R^{q}f_{!}(F)=R^{q}g_{*}(j_{!}F)}$

for any torsion sheaf F. Here j is any open immersion of X into a scheme Y with a proper morphism g to S (with f = gj), and as before the definition does not depend on the choice of j and Y. Cohomology with compact support is the special case of this with S a point. If f is a separated morphism of finite type then Rqf! takes constructible sheaves on X to constructible sheaves on S. If in addition the fibers of f have dimension at most n then Rqf! vanishes on torsion sheaves for q > 2n. If X is a complex variety then Rqf! is the same as the usual higher direct image with compact support (for the complex topology) for torsion sheaves.

If X is a smooth algebraic variety of dimension N and n is coprime to the characteristic then there is a trace map

${\displaystyle \mathrm {Tr} :H_{c}^{2N}(X,\mu _{n}^{N})\rightarrow \mathbf {Z} /n\mathbf {Z} }$

and the bilinear form Tr(ab) with values in Z/nZ identifies each of the groups

${\displaystyle H_{c}^{i}(X,\mu _{n}^{N})}$

and

${\displaystyle H^{2N-i}(X,\mathbf {Z} /n\mathbf {Z} )}$

with the dual of the other. This is the analogue of Poincaré duality for étale cohomology.

## An application to curves

This is how the theory could be applied to the local zeta-function of an algebraic curve.

Theorem. Let X be a curve of genus g defined over Fp, the finite field with p elements. Then for n ≥ 1

${\displaystyle \#X\left(\mathbf {F} _{p^{n}}\right)=p^{n}+1-\sum _{i=1}^{2g}\alpha _{i}^{n},}$

where αi are certain algebraic numbers satisfying |αi| = p.

This agrees with P1(Fpn) being a curve of genus 0 with pn + 1 points. It also shows that the number of points on any curve is rather close (within 2gpn / 2) to that of the projective line; in particular, it generalizes Hasse's theorem on elliptic curves.

### Idea of proof

According to the Lefschetz fixed point theorem, the number of fixed points of any morphism f : XX is equal to the sum

${\displaystyle \sum _{i=0}^{2\dim(X)}(-1)^{i}\mathrm {Tr} \left(f|_{H^{i}(X)}\right).}$

This formula is valid for ordinary topological varieties and ordinary topology, but it is wrong for most algebraic topologies. However, this formula does hold for étale cohomology (though this is not so simple to prove).

The points of X that are defined over Fpn are those fixed by Fn, where F is the Frobenius automorphism in characteristic p.

The étale cohomology Betti numbers of X in dimensions 0, 1, 2 are 1, 2g, and 1 respectively.

According to all of these,

${\displaystyle \#X\left(\mathbf {F} _{p^{n}}\right)=\mathrm {Tr} \left(F^{n}|_{H^{0}(X)}\right)-\mathrm {Tr} \left(F^{n}|_{H^{1}(X)}\right)+\mathrm {Tr} \left(F^{n}|_{H^{2}(X)}\right).}$

This gives the general form of the theorem.

The assertion on the absolute values of the αi is the 1-dimensional Riemann Hypothesis of the Weil Conjectures.

The whole idea fits into the framework of motives: formally [X] = [point]+[line]+[1-part], and [1-part] has something like p points.


text:
# GRE Practice Question

Let k be the number of real solutions of the equation e$$^{x}$$ + x - 2 = 0 in the interval [0,1] and let n be the number of real solutions that are not in the interval.

By looking at the graph, I know it crosses the x axis; however, I don't remember or know how to do this problem.

LCKurtz
Homework Helper
Gold Member
Hint: If f(x) = ex + x - 2, look at f(0), f(1) and f '(x).

I know what f(0) and f(1) are and f '(x) = e$$^{x}$$ + 1

How is that suppose to help?

LCKurtz
Homework Helper
Gold Member
I know what f(0) and f(1) are and f '(x) = e$$^{x}$$ + 1

How is that suppose to help?

You mean "supposed" to help.

What does the fact that f(0) and f(1) have opposite signs tell you? What does having a positive derivative tell you? And, of course, I'm just assuming I know what your actual question was since your original post doesn't actually contain a question.

At least this isn't an English forum. The question was in regards to multiple choices so I left that out because it wasn't needed.

LCKurtz


text:
• 0 Vote(s) - 0 Average
• 1
• 2
• 3
• 4
• 5
 Approaches to Tetration bo198214 Administrator Posts: 1,389 Threads: 90 Joined: Aug 2007 07/18/2008, 10:06 AM (This post was last modified: 07/18/2008, 10:07 AM by bo198214.) Gottfried Wrote:bo198214 Wrote:Gottfried Wrote:... the goal to extend the operator hierarchy is not always driven by a functional representation ... there is a strong effort to extend the (binary) operator hierarchy solely based on the properties of the usual operators. What means "driven by functional representation"? Of course there is this area of the operator hierarchy and then there is this area of non-integer iteration. But these are not different approaches but the non-integer iteration is a way to get the operations demanded in the operator hierarchy. From the operator hierarchy we have the law: $b[4]0=1$ $b[4](x+1)=b[3](b[4]x)$ So we need an operation [4] (with real right operand) which satisfies these conditions. That means for each $b$ we need a function $f (x)=b[4]x$ (with certain smoothness) which satisfies: $f(0)=1$ $f(x+1)=b^{f(x)}$. We can obtain such a function by non-integer iteration of $\exp_b$, (perhaps there are also other possibilities): $f(x)=\exp_b^{\circ x}(1)$. And we can perform non-integer iteration via those several approaches we discussed here (natural, diagonalization, regular). And those approaches then may have variants for which we need a series expansion or for which we dont need a series expansion. So the really concurrent approaches are not operator-hierarchy and series-expansion. But our 3 different approaches to function iteration. Operator hierarchy and series expansion are just parts of the whole area, where operator hierarchy is a framework into which you can plugin different approaches for non-integer iteration, including those performed by series expansion. « Next Oldest | Next Newest »

 Messages In This Thread Approaches to Tetration - by Gottfried - 07/17/2008, 10:43 AM RE: FAQ-discuss: Approaches to tetration - by bo198214 - 07/17/2008, 07:11 PM RE: FAQ-discuss: Approaches to tetration - by Gottfried - 07/17/2008, 07:41 PM RE: FAQ-discuss: Approaches to tetration - by bo198214 - 07/17/2008, 08:21 PM RE: FAQ-discuss: Approaches to tetration - by Gottfried - 07/18/2008, 09:09 AM RE: FAQ-discuss: Approaches to tetration - by bo198214 - 07/18/2008, 10:06 AM

Users browsing this thread: 1 Guest(s)


text:
# Math Help - Maximum & Minimum Problem

1. ## Maximum & Minimum Problem

What is the maximum possible area of a rectangle with base that lies on the x-axis and with two upper vertices that lie on the graph of the equation $y$ $=$ $4$ $-$ $x^2$?

I have no idea how to do this, can someone please show the full solutions to help me through the process? Thank you!!!

2. Originally Posted by bhuang
What is the maximum possible area of a rectangle with base that lies on the x-axis and with two upper vertices that lie on the graph of the equation $y$ $=$ $4$ $-$ $x^2$?

I have no idea how to do this, can someone please show the full solutions to help me through the process? Thank you!!!
Start by drawing a picture (did you do that?). Let the coordinates of the vertices have x-coordinates at x = a and x = -a. Get an expression for the area in terms of a. Then use calculus in the usual way to maximise this area.


text:
### ArcGIS API for PythonSamples

• Advanced Machine Learning
• 2D Computer Vision
• Generative Models

# Generating rgb imagery from digital surface model using Pix2Pix

• 🔬 Data Science
• 🥠 Deep Learning and image translation

## Introduction

In this notebook, we will focus on using Pix2Pix [1], which is one of the famous and sucessful deep learning models used for paired image-to-image translation. In geospatial sciences, this approach could help in wide range of applications traditionally not possible, where we may want to go from one domain of images to another.

The aim of this notebook is to make use of arcgis.learn Pix2Pix model to translate or convert the gray-scale DSM to a RGB imagery. For more details about model and its working refer How Pix2Pix works ? in guide section.

## Necessary imports

import os, zipfile
from pathlib import Path
from os import listdir
from os.path import isfile, join

from arcgis import GIS
from arcgis.learn import Pix2Pix, prepare_data

## Connect to your GIS

# gis = GIS('home')
ent_gis = GIS('https://pythonapi.playground.esri.com/portal', 'arcgis_python', 'amazing_arcgis_123')

## Export image domain data

For this usecase, we have a high-resolution NAIP airborne imagery in the form of IR-G-B tiles and lidar data converted into DSM, collected over St. George, state of utah by state of utah and partners [5] with same spatial resolution of 0.5 m. We will export that using “Export_Tiles” metadata format available in the Export Training Data For Deep Learning tool. This tool is available in ArcGIS Pro as well as ArcGIS Image Server. The various inputs required by the tool, are described below.

• Input Raster: DSM
• Additional Input Raster: NAIP airborne imagery
• Tile Size X & Tile Size Y: 256
• Stride X & Stride Y: 128
• Meta Data Format: 'Export_Tiles' as we are training a Pix2Pix model.
• Environments: Set optimum Cell Size, Processing Extent.

Raster's used for exporting the training dataset are provided below

naip_domain_b_raster = ent_gis.content.get('a55890fcd6424b5bb4edddfc5a4bdc4b')
naip_domain_b_raster
naip_train_area_domain_b
naip raster or domain bImagery Layer by api_data_owner
Last Modified: March 12, 2021
0 comments, 10 views
dsm_domain_a_raster = ent_gis.content.get('aa31a374f889487d951e15063944b921')
dsm_domain_a_raster
dsm_train_area_domain_a
dsm raster or domain aImagery Layer by api_data_owner
Last Modified: January 08, 2021
0 comments, 7 views

Inside the exported data folder, 'Images' and 'Images2' folders contain all the image tiles from two domains exported from DSM and drone imagery respectively. Now we are ready to train the Pix2Pix model.

## Model training

Alternatively, we have provided a subset of training data containing a few samples that follows the same directory structure mentioned above and also provided the rasters used for exporting the training dataset. You can use the data directly to run the experiments.

training_data = gis.content.get('2a3dad36569b48ed99858e8579611a80')
training_data
data_for_pix2pix_with_trained_model
data_for_pix2pix_with_trained_modelImage Collection by api_data_owner
Last Modified: January 08, 2021
0 comments, 0 views
filepath = training_data.download(file_name=training_data.name)
#Extract the data from the zipped image collection

with zipfile.ZipFile(filepath, 'r') as zip_ref:
zip_ref.extractall(Path(filepath).parent)

### Prepare data

output_path = Path(os.path.join(os.path.splitext(filepath)[0]))
data = prepare_data(output_path, dataset_type="Pix2Pix", batch_size=5)

### Visualize a few samples from your training data

To get a sense of what the training data looks like, arcgis.learn.show_batch() method randomly picks a few training chips and visualize them. On the left are some DSM's (digital surface model) with the corresponding RGB imageries of various locations on the right.

data.show_batch()

### Load Pix2Pix model architecture

model = Pix2Pix(data)

### Tuning for optimal learning rate

Learning rate is one of the most important hyperparameters in model training. ArcGIS API for Python provides a learning rate finder that automatically chooses the optimal learning rate for you.

lr = model.lr_find()

2.5118864315095795e-05

### Fit the model

The model is trained for around a few epochs with the suggested learning rate.

model.fit(30, lr)
epochtrain_lossvalid_lossgen_lossl1_lossD_losstime
013.20354713.9802550.5761100.1262740.41244701:01
112.67535313.8917870.5733630.1210200.41113101:02
212.83037713.6523390.5773340.1225300.41022401:00
312.82602813.4789500.5786730.1224740.41002801:01
412.83049613.4645010.5794460.1225100.40703401:01
512.97819013.8087770.5813290.1239690.40515501:01
612.93388714.1885250.5798170.1235410.40228001:01
712.66038313.2734590.5831290.1207730.39804101:01
812.49337813.2347050.5845130.1190890.39592801:02
912.70437314.3149360.5836710.1212070.39375501:01
1012.28365212.8727520.5861150.1169750.39149601:01
1112.00802512.9890320.5858510.1142220.38654201:02
1211.84821412.3562300.5867060.1126150.38512001:01
1311.64824812.3878240.5862940.1106200.38334501:01
1411.22064212.0512900.5863540.1063430.38074701:01
1511.06536311.8160180.5871540.1047820.37941701:01
1611.10709911.5793070.5878860.1051920.37714401:02
1710.68060311.5040060.5873070.1009330.37577901:03
1810.60440811.2342900.5873800.1001700.37391701:03
1910.45902111.1627760.5868170.0987220.37289201:05
2010.25144510.9444000.5876710.0966380.37193301:02
2110.17338210.9668410.5873220.0958610.37182101:01
229.94563410.7838340.5872470.0935840.37138701:01
239.68118210.7164440.5878640.0909330.36966801:01
249.87203910.6006160.5883030.0928370.36956301:00
259.78672010.6039120.5883640.0919840.36971501:02
269.68065810.5063520.5878780.0909280.36986301:02
279.38690410.5025960.5873280.0879960.36850201:01
289.83592310.5058370.5883240.0924760.36969601:01
299.63007110.4986540.5869290.0904310.36885601:00

Here, with 30 epochs, we can see reasonable results — both training and validation losses have gone down considerably, indicating that the model is learning to translate between domain of imageries.

### Save the model

We will save the model which we trained as a 'Deep Learning Package' ('.dlpk' format). Deep Learning package is the standard format used to deploy deep learning models on the ArcGIS platform.

We will use the save() method to save the trained model. By default, it will be saved to the 'models' sub-folder within our training data folder.

model.save("pix2pix_model_e30", publish =True)

### Visualize results in validation set

It is a good practice to see results of the model viz-a-viz ground truth. The code below picks random samples and shows us ground truth and model predictions, side by side. This enables us to preview the results of the model within the notebook.

model.show_results()

### Compute evaluation metrics

The Frechet Inception Distance score, or FID for short, is a metric that calculates the distance between feature vectors calculated for real and generated images. Lower scores indicate the two groups of images are more similar, or have more similar statistics, with a perfect score being 0.0 indicating that the two groups of images are identical.

model.compute_metrics()
263.63128885232044

## Model inferencing

### Inference on a single imagery chip

We can translate DSM to RGB imagery with the help of predict() method.

Using predict function, we can apply the trained model on the image chip kept for validation, which we want to translate.

• img_path: path to the image file.
valid_data = gis.content.get('f682b16bcc6d40419a775ea2cad8f861')
valid_data
dsm raster chip for inferencing
dsm raster chip for inferencing Image by api_data_owner
Last Modified: January 08, 2021
0 comments, 8 views
filepath2 = valid_data.download(file_name=valid_data.name)
# Visualize the image chip used for inferencing
from fastai.vision import open_image
open_image(filepath2)
#Inference single imagery chip
model.predict(filepath2)

### Generate raster using classify pixels using deep learning tool

After we trained the Pix2Pix model and saved the weights for translating image and we could use the classify pixels using deep learning tool avialable in both ArcGIS pro and ArcGIS Enterprise for inferencing at scale.

test_data = ent_gis.content.get('86bed58f977c4c0aa39053d93141cdb1')
test_data
dsm_test_area
Test area dsm for large scale inferencingImagery Layer by api_data_owner
Last Modified: January 22, 2021
0 comments, 0 views

out_classified_raster = arcpy.ia.ClassifyPixelsUsingDeepLearning("Imagery", r"C:\path\to\model.emd", "padding 64;batch_size 2"); out_classified_raster.save(r"C:\sample\sample.gdb\predicted_img2dsm")

## Results visualization

The RGB output raster is generated using ArcGIS Pro. The output raster is published on the portal for visualization.

inferenced_results = ent_gis.content.get('30951690103047f096c6339398593d79')
inferenced_results
predicted_rgb_imagery
Inferenced rgb imagery Imagery Layer by api_data_owner
Last Modified: January 22, 2021
0 comments, 4 views

### Create map widgets

Two map widgets are created showing DSM and Inferenced RGB raster.

map1 = ent_gis.map('Washington Fields', 13)
map1.add_layer(test_data)
map2 = ent_gis.map('Washington Fields', 13)
map2.add_layer(inferenced_results)

### Synchronize web maps

The maps are synchronized with each other using MapView.sync_navigation functionality. It helps in comparing the inferenced results with the DSM. Detailed description about advanced map widget options can be referred here.

map2.sync_navigation(map1)

### Set the map layout

from ipywidgets import HBox, VBox, Label, Layout

Hbox and Vbox were used to set the layout of map widgets.

hbox_layout = Layout()
hbox_layout.justify_content = 'space-around'

hb1=HBox([Label('DSM'),Label('RGB results')])
hb1.layout=hbox_layout

### Results

The predictions are provided as a map for better visualization.

VBox([hb1,HBox([map1,map2])])
map2.zoom_to_layer(inferenced_results)

## Conclusion

In this notebook, we demonstrated how to use Pix2Pix model using ArcGIS API for Python in order to translate imagery of one domain to the another domain.

## References

• [1]. Isola, Phillip, Jun-Yan Zhu, Tinghui Zhou, and Alexei A. Efros. "Image-to-image translation with conditional adversarial networks." In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 1125-1134. 2017.
• [2]. Goodfellow, Ian, Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. "Generative adversarial nets." In Advances in neural information processing systems, pp. 2672-2680. 2014.
• [3]. https://stephan-osterburg.gitbook.io/coding/coding/ml-dl/tensorfow/chapter-4-conditional-generative-adversarial-network/acgan-architectural-design
• [4]. Kang, Yuhao, Song Gao, and Robert E. Roth. "Transferring multiscale map styles using generative adversarial networks." International Journal of Cartography 5, no. 2-3 (2019): 115-141.
• [5]. State of Utah and Partners, 2019, Regional Utah high-resolution lidar data 2015 - 2017: Collected by Quantum Spatial, Inc., Digital Mapping, Inc., and Aero-Graphics, Inc. and distributed by OpenTopography, https://doi.org/10.5069/G9RV0KSQ. Accessed: 2020-12-08

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.


text:
# $∞$ Infinity $∞$

## I. What is it that we call infinity ?

2. Hilbert’s Hotel

## II. How big is it ?

1. Counting to $∞$ : $\aleph_0$
2. Ordinals : $𝜔$
3. Inaccessible cardinals

Zeno of Elea : In a race, the quickest runner can never overtake the slowest.

$⇑$

Actually, modern math provide a solution :

$$\sum_{n>0} \frac{1}{2^n}$$ is convergent

# Hilbert's Hotel

• Fully occupied
• Infinitely many rooms

$⟶$ How many additional guests can be housed ?

1. For $n$ new guests : a shift of $n$
2. How about infintely many new guests ?

# II. How big is infinity ?

## Cardinals : $\aleph_0$

Cardinal : the number of elements of an unordered set

$\downarrow$

If the set of all the integers ($ℕ$) exists, we call $\aleph_0$ its cardinal

NB : Zeno paradox$\aleph_0$ elements can be "written" within a finite space

## Ordinals : $𝜔$

Ordinal : the first label you’ll have to use in order to append 1 element to an ordered set

NB :

• For a finite number of elements : ordinal ⟺ cardinal
• $\aleph_0 + 1 = \aleph_0$, but $𝜔 + 1 \neq 𝜔$

### Axiom of replacement : to infinity and beyond !

Axiom of replacement : if you take an existing set and replace all elements with something else, you’re left with an other existing set.

We’re going to use it to the fullest !

$$𝜔^{2}$$

$𝜔^3$

$𝜔^4$

$𝜔^𝜔$

$𝜔^{5}$

$𝜔^{𝜔^𝜔}$

$𝜔^{𝜔^{𝜔^{\vdots^{𝜔}}}}$

up to

$𝜀_0$

# And all that is smaller than …

$\omega_1$

## corresponding to the cardinal …

$\aleph_1$

# Then …

$𝜔_2, 𝜔_3, \ldots, 𝜔_{𝜔}, \ldots, 𝜔_{𝜔^{𝜔^{𝜔^{\vdots^{𝜔}}}}}, 𝜔_{𝜀_0}, \ldots$

## and the corresponding cardinals

$\aleph_2, \aleph_3, \ldots$

# Power sets : becoming exponentially big

$|𝒫(E)| = 2^{|E|}$

+

Axiom of replacement

$\downarrow$

# But all of that has an order type … so : it remains smaller than …

Inaccessible cardinals


text:
# Tag Info

7

$g^x \cdot g^y \;\;\; = \;\;\; (\hspace{.02 in}g\cdot g\cdot g\cdot \ldots$ [$\hspace{.02 in}x$ of them] $\ldots \cdot g\cdot g\cdot g) \: \cdot \: (\hspace{.02 in}g\cdot g\cdot g\cdot \ldots$ [$\hspace{.03 in}y$ of them] $\ldots \cdot g\cdot g\cdot g)$ $= \;\;\; g\cdot g\cdot g\cdot \ldots$ [$\hspace{.02 in}x\hspace{-0.05 in}+\hspace{-0.05 in}y$ of them] ...

4

$\pi$ is the transcendental number 3.1415926... It's there in the formula to show this specific number was not chosen with a specific cryptographical backdoor in mind; it seems unlikely that anyone was able to select the value of $\pi$ (unless Carl Sagan was correct, of course :-)

3

In DH if you want to compute $g^a$ from $K$ you have to know $b$ (which the legitimate receiver of $g^a$ clearly knowns, so this does not really make sence). This party can compute the inverse of $b$, namely $b^{-1}$, and then compute $g^a=K^{b^{-1}}$. Note that this is not the same as $(K^b)^{-1}=(g^{ab})^{-1}$ (as I will discuss below). But that is not ...

3

That depends on the groups you are working in. Using a $\Sigma$-protocol If you have a group $G$ of prime order $q$ where the DDH is hard and you have a DH tuple $(g,g^u,g^v,g^w)$ with $w\equiv uv \pmod q$, then if your prover knows one of these values, say $u$, then we can write the DH tuple as $(g,g^u,h,h^u)$ and he is able to convince a verifier that ...

1

All this work is done modulo the prime $p$ (which is 11 in your toy example); in this field, addition, subtraction and multiplication is done in the usual way (except you do a modulo $p$ at the end); however division is defined differently. We define $x = 6/4\ (\bmod 11)$ to be that value such that $x \times 4 = 6\ (\bmod 11)$. Now, we see that \$7 \times ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# 2.4 Two metrics on distributions

A major theme of this book is quantifying the convergence theorem (Theorem 2.2) to give estimates of how close the distribution of a chain is to the stationary distribution at finite times. Such quantifications require some explicit choice of “distance” between distributions, and two of the simplest choices are explained in this section. We illustrate with a trivial

###### Example 2.18

Rain or shine?

Suppose the true probability of rain tomorrow is 80% whereas we think the probability is 70%. How far off are we? In other words, what is the “distance” between $\pi$ and $\theta$, where

 $\pi(\mbox{rain})=0.8,\ \pi(\mbox{shine})=0.2$
 $\theta(\mbox{rain})=0.7,\ \theta(\mbox{shine})=0.3.$

Different notions of distance will give different numerical answers. Our first notion abstracts the idea that the “additive error” in this example is $0.8-0.7=0.1$.

## 2.4.1 Variation distance

Perhaps the simplest notion of distance between probability distributions is variation distance, defined as

 $||\theta_{1}-\theta_{2}||=\max_{A\subseteq I}|\theta_{1}(A)-\theta_{2}(A)|.$

So variation distance is just the maximum additive error one can make, in using the “wrong” distribution to evaluate the probability of an event. In example 2.18, variation distance is $0.1$. Several equivalent definitions are provided by

###### Lemma 2.19

For probability distributions $\theta_{1},\theta_{2}$ on a finite state space $I$,

 $\displaystyle\frac{1}{2}\sum_{i}|\theta_{1}(i)-\theta_{2}(i)|$ $\displaystyle=$ $\displaystyle\sum_{i}(\theta_{1}(i)-\theta_{2}(i))^{+}$ $\displaystyle=$ $\displaystyle\sum_{i}(\theta_{1}(i)-\theta_{2}(i))^{-}$ $\displaystyle=$ $\displaystyle 1-\sum_{i}\min(\theta_{1}(i),\theta_{2}(i))$ $\displaystyle=$ $\displaystyle\max_{A\subseteq I}|\theta_{1}(A)-\theta_{2}(A)|$ $\displaystyle=$ $\displaystyle\min P(V_{1}\neq V_{2})$

the minimum taken over random pairs $(V_{1},V_{2})$ such that $V_{m}$ has distribution $\theta_{m}$ ($m=1,2$). So each of these quantities equals the variation distance $||\theta_{1}-\theta_{2}||$.

Proof. The first three equalities are clear. For the fourth, set $B=\{i:\theta_{1}(i)>\theta_{2}(i)\}$. Then

 $\displaystyle\theta_{1}(A)-\theta_{2}(A)$ $\displaystyle=$ $\displaystyle\sum_{i\in A}(\theta_{1}(i)-\theta_{2}(i))$ $\displaystyle\leq$ $\displaystyle\sum_{i\in A\cap B}(\theta_{1}(i)-\theta_{2}(i))$ $\displaystyle\leq$ $\displaystyle\sum_{i\in B}(\theta_{1}(i)-\theta_{2}(i))$ $\displaystyle=$ $\displaystyle\sum_{i}(\theta_{1}(i)-\theta_{2}(i))^{+}$

with equality when $A=B$. This, and the symmetric form, establish the fourth equality. In the final equality, the “$\leq$” follows from

 $|\theta_{1}(A)-\theta_{2}(A)|=|P(V_{1}\in A)-P(V_{2}\in A)|\leq P(V_{2}\neq V_% {1}).$

And equality is attained by the following joint distribution. Let $\theta(i)=\min(\theta_{1}(i),\theta_{2}(i))$ and let

 $P(V_{1}=i,V_{2}=i)=\theta(i)$
 $P(V_{1}=i,V_{2}=j)=\frac{(\theta_{1}(i)-\theta(i))(\theta_{2}(j)-\theta(j))}{1% -\sum_{k}\theta(k)},\ i\neq j.$

(If the denominator is zero, then $\theta_{1}=\theta_{2}$ and the result is trivial.) $\Box$

In the context of Markov chains we may use

 $d_{i}(t):=||P_{i}(X_{t}=\cdot)-\pi(\cdot)||$ (2.13)

as a measure of deviation from stationarity at time $t$, for the chain started at state $i$. Also define

 $d(t):=\max_{i}d_{i}(t)$ (2.14)

as the worst-case deviation from stationarity. Finally, it is technically convenient to introduce also

 $\bar{d}(t)=\max_{ij}||P_{i}(X_{t}=\cdot)-P_{j}(X_{t}=\cdot)||.$ (2.15)

In Chapter 4 we discuss, for reversible chains, relations between these “variation distance” notions and other measures of closeness-to-stationarity, and discuss parameters $\tau$ measuring “time until $d(t)$ becomes small” and their relation to other parameters of the chain. For now, let’s just introduce a fundamental technical fact, the submultiplicativity property.

###### Lemma 2.20

(a) $\bar{d}(s+t)\leq\bar{d}(s)\bar{d}(t),\ s,t\geq 0$ [the submultiplicativity property].

(b) $d(s+t)\leq 2d(s)d(t),\ s,t\geq 0$ .

(c) $d(t)\leq\bar{d}(t)\leq 2d(t),\ t\geq 0.$

(d) $d(t)$ and $\bar{d}(t)$ decrease as $t$ increases.

Proof. We use the characterization of variation distance as

 $||\theta_{1}-\theta_{2}||=\min P(V_{1}\neq V_{2}),$ (2.16)

the minimum taken over random pairs $(V_{1},V_{2})$ such that $V_{m}$ has distribution $\theta_{m}$ ($m=1,2$).

Fix states $i_{1},i_{2}$ and times $s,t$, and let ${\bf Y}^{1},{\bf Y}^{2}$ denote the chains started at $i_{1}$, $i_{2}$ respectively. By (2.16) we can construct a joint distribution for $(Y^{1}_{s},Y^{2}_{s})$ such that

 $\displaystyle P(Y^{1}_{s}\neq Y^{2}_{s})$ $\displaystyle=$ $\displaystyle||P_{i_{1}}(X_{s}=\cdot)-P_{i_{2}}(X_{s}=\cdot)||$ $\displaystyle\leq$ $\displaystyle\bar{d}(s).$

Now for each pair $(j_{1},j_{2})$, we can use (2.16) to construct a joint distribution for $(Y^{1}_{s+t},Y^{2}_{s+t})$ given $(Y^{1}_{s}=j_{1},Y^{2}_{s}=j_{2})$ with the property that

 $P(Y^{1}_{s+t}\neq Y^{2}_{s+t}|Y^{1}_{s}=j_{1},Y^{2}_{s}=j_{2})=||P_{j_{1}}(X_{% t}=\cdot)-P_{j_{2}}(X_{t}=\cdot)||.$

The right side is $0$ if $j_{1}=j_{2}$, and otherwise is at most $\bar{d}(t)$. So unconditionally

 $P(Y^{1}_{s+t}\neq Y^{2}_{s+t})\leq\bar{d}(s)\bar{d}(t)$

and (2.16) establishes part (a) of the lemma. For part (b), the same argument (with ${\bf Y}^{2}$ now being the stationary chain) shows

 $d(s+t)\leq d(s)\bar{d}(t)$ (2.17)

so that (b) will follow from the upper bound $\bar{d}(t)\leq 2d(t)$ in (c). But this upper bound is clear from the triangle inequality for variation distance. And the lower bound in (c) follows from the fact that $\mu\rightarrow||\theta-\mu||$ is a convex function, so that averaging over $j$ with respect to $\pi$ in (2.15) can only decrease distance. Finally, the “decreasing” property for $\bar{d}(t)$ follows from (a), and for $d(t)$ follows from (2.17). $\Box$

The assertions of this section hold in either discrete or continuous time. But note that the numerical value of $d(t)$ changes when we switch from a discrete-time chain to the continuized chain. In particular, for a discrete-time chain with period $q$ we have $d(t)\rightarrow(q-1)/q$ as $t\rightarrow\infty$ (which incidently implies, taking $q=2$, that the factor $2$ in Lemma 2.20(b) cannot be reduced) whereas for the continuized chain $d(t)\rightarrow 0$.

One often sees slightly disguised corollaries of the submultiplicativity property in the literature. The following is a typical one.

###### Corollary 2.21

Suppose there exists a probability measure $\mu$, a real $\delta>0$ and a time $t$ such that

 $p^{(t)}_{ij}\geq\delta\mu_{j}\ \forall i,j.$

Then

 $d(s)\leq(1-\delta)^{\lfloor s/t\rfloor},\ s\geq 0.$

Proof. The hypothesis implies $\bar{d}(t)\leq 1-\delta$, by the third equality in Lemma 2.19, and then the conclusion follows by submultiplicativity.

## 2.4.2 $L^{2}$ distance

Another notion of distance, which is less intuitively natural but often more mathematically tractable, is $L^{2}$ distance. This is defined with respect to some fixed reference probability distribution $\pi$ on $I$, which for our purposes will be the stationary distribution of some irreducible chain under consideration (and so $\pi_{i}>0\ \forall i$). The $L^{2}$ norm of a function $f:I\rightarrow R$ is

 $||f||_{2}=\sqrt{\sum_{i}\pi_{i}f^{2}(i)}.$ (2.18)

We define the $L^{2}$ norm of a signed measure $\nu$ on $I$ by

 $||\nu||_{2}=\sqrt{\sum_{i}\nu^{2}_{i}/\pi_{i}}.$ (2.19)

This may look confusing, because a signed measure $\nu$ and a function $f$ are in a sense “the same thing”, being determined by values $(f(i);i\in I)$ or $(\nu_{i};i\in I)$ which can be chosen arbitrarily. But the measure $\nu$ can also be determined by its density function $f(i)=\nu_{i}/\pi_{i}$, and so (2.18) and (2.19) say that the $L^{2}$ norm of a signed measure is defined to be the $L^{2}$ norm of its density function.

So $||\theta-\mu||_{2}$ is the “$L^{2}$” measure of distance between probability distributions $\theta,\mu$. In particular, the distance between $\theta$ and the reference distribution $\pi$ is

 $||\theta-\pi||_{2}=\sqrt{\sum_{i}\frac{(\theta_{i}-\pi_{i})^{2}}{\pi_{i}}}=% \sqrt{\sum_{i}\frac{\theta^{2}_{i}}{\pi_{i}}\ \ -1}.$

In Example 2.18 we find $||\theta-\pi||_{2}=1/4$.

Writing $\theta(t)$ for the distribution at time $t$ of a chain with stationary distribution $\pi$, it is true (cf. Lemma 2.20(d) for variation distance) that $||\theta(t)-\pi||_{2}$ is decreasing with $t$. Since there is a more instructive proof in the reversible case (Chapter 3 Lemma 23) (yyy 9/2/94 version) we won’t prove the general case (see Notes).

Analogous to the $L^{2}$ norms are the $L^{1}$ norms

 $||f||_{1}=\sum_{i}\pi_{i}|f(i)|$
 $||\nu||_{1}=\sum_{i}|\nu_{i}|.$

The Cauchy-Schwarz inequality gives $||\cdot||_{1}\leq||\cdot||_{2}$. Note that in the definition of $||\nu||_{1}$ the reference measure $\pi$ has “cancelled out”. Lemma 2.19 shows that for probability measures $\theta_{1},\theta_{2}$ the $L^{1}$ distance is the same as variation distance, up to a factor of $2$:

 $||\theta_{1}-\theta_{2}||={\textstyle\frac{1}{2}}||\theta_{1}-\theta_{2}||_{1}.$

As a trivial example in the Markov chain setting, consider

###### Example 2.22

Take $I=\{0,1,\ldots,n-1\}$, fix a parameter $0 and define a transition matrix

 $p_{ij}=a1_{(j=i+1\ \bmod\ n)}\ +\ \frac{1-a}{n}.$

In this example the $t$-step transition probabilities are

 $p^{(t)}_{ij}=a^{t}1_{(j=i+t\ \bmod\ n)}\ +\ \frac{1-a^{t}}{n}$

and the stationary distribution $\pi$ is uniform. We calculate (for arbitrary $j\neq i$)

 $d(t)=||P_{i}(X_{t}\in\cdot)-\pi||=(1-n^{-1})a^{t}$
 $\bar{d}(t)=||P_{i}(X_{t}\in\cdot)-P_{j}(X_{t}\in\cdot)||=a^{t}$
 $||P_{i}(X_{t}\in\cdot)-\pi||_{2}=(n-1)^{1/2}a^{t}.$

## 2.4.3 Exponential tails of hitting times

The submultiplicative property of $\bar{d}(t)$ is one instance of a general principle:

because our state space is finite, many quantities which converge to zero as $t\to\infty$ must converge exponentially fast, by iterating over worst-case initial states.

Here’s another instance, tails of hitting time distributions.

Consider the first hitting time $T_{A}$ on a subset $A$. Define $t^{*}_{A}:=\max_{i}E_{i}T_{A}$. For any initial distribution $\mu$, any time $s>0$ and any integer $m\geq 1$,

 $\displaystyle P_{\mu}(T_{A}>ms|T_{A}>(m-1)s)$ $\displaystyle=$ $\displaystyle P_{\theta}(T_{A}>s)\mbox{ for some dist. }\theta$ $\displaystyle\leq$ $\displaystyle\max_{i}P_{i}(T_{A}>s)$ $\displaystyle\leq$ $\displaystyle t^{*}_{A}/s.$

So by induction on $m$

 $P_{\mu}(T_{A}>js)\leq(t^{*}_{A}/s)^{j}$

implying

 $P_{\mu}(T_{A}>t)\leq(t^{*}_{A}/s)^{\lfloor t/s\rfloor},\ \ \ t>0.$

In continuous time, a good (asymptotically optimal) choice of $s$ is $s=et^{*}_{A}$, giving the exponential tail bound

 $\sup_{\mu}P_{\mu}(T_{A}>t)\leq\exp\left(-\left\lfloor\frac{t}{et^{*}_{A}}% \right\rfloor\right),\ \ 0 (2.20)

A messier bound holds in discrete time, where we have to choose $s$ to be an integer.


text:
In the figure C_1 = C_5 = 8.3 micro F and C_2 = C_3 = C_4 = 4.4 micro F . The applied potential...

Question:

In the figure {eq}C_1 = C_5 = 8.3 \ \mu F \ and \ C_2 = C_3 = C_4 = 4.4 \ \mu F {/eq}. The applied potential is {eq}V_{ab} = 210 \ V {/eq}.
What is the equivalent capacitance of the network between points {eq}a \ and \ b?{/eq}
What is the charge and potential difference of each of the capacitors?

Series and Parallel Combination of Capacitors

Many times we require a capacitor whose capacity is not of standard capacity. In order to have such a capacitor, we use a series or parallel combination of capacitors. If we want to have a have a higher capacity than the available capacitors, then the capacitors are connected in parallel. . If we want to have a have a smaller capacity than the available capacitors, then the capacitors are connected in series.

Symbols Used

1) {eq}\space C_1, \space C_2, \space C_3, \space C_4, \space C_5, \space{/eq} are the capacitors

2){eq}\space C_{S1}, \space...

Become a Study.com member to unlock this answer! Create your account


text:
## Commutators

Operators (or variables in quantum mechanics) do not necessarily commute. We can see our first example of that now that we have a few operators. We define the commutator to be

(using and as examples.)

We will now compute the commutator between and . Because is represented by a differential operator, we must do this carefully. Lets think of the commutator as a (differential) operator too, as generally it will be. To make sure that we keep all the that we need, we will compute then remove the at the end to see only the commutator.

So, removing the we used for computational purposes, we get the commutator.

Later we will learn to derive the uncertainty relation for two variables from their commutator. Physical variable with zero commutator have no uncertainty principle and we can know both of them at the same time.

We will also use commutators to solve several important problems.

We can compute the same commutator in momentum space.

The commutator is the same in any representation.

* Example: Compute the commutator .*
* Example: Compute the commutator .*
* Example: Compute the commutator .*
* Example: Compute the commutator of the angular momentum operators .*

Gasiorowicz Chapter 3

Griffiths Chapter 3

Cohen-Tannoudji et al. Chapter

Jim Branson 2013-04-22


text:
Physics Help Forum statics(Momentum) problem

 Jun 20th 2013, 01:19 AM #1 Junior Member   Join Date: Aug 2011 Posts: 5 statics(Momentum) problem the force acts in the plane of triangle ABC , where A(2,3) ,B(1,-4) ,C(-1,0) If moment about A = moment about B = 60 and moment about C =-60 Find vector F and its magnitude >> this is my attempt .... HTML Code:  Is this correct? __________________ ]Nothing is impossible Last edited by mido22; Jun 20th 2013 at 01:23 AM.
 Jun 20th 2013, 10:00 AM #2 Physics Team     Join Date: Jun 2010 Location: Morristown, NJ USA Posts: 2,354 Looks good right up to the end. Your values for L and M are the x and y values for vector F, respectively, but instead of writing F=(L,M) you wrote F=(M,L). You can see quite easily that the direction of F as you've written it is not parallel to AB because of the reversed values of x and y components. However the calculation of the magnitude of F is good.
 Jun 22nd 2013, 01:26 PM #3 Junior Member   Join Date: Aug 2011 Posts: 5 thanks very much for your help __________________ ]Nothing is impossible
 Jun 24th 2013, 07:17 AM #4 Physics Team     Join Date: Jun 2010 Location: Morristown, NJ USA Posts: 2,354 You're welcome! By the way I notice that you used the word "momentum" in the subject title of this thread, but of course what you meant is "moment."

 Thread Tools Display Modes Linear Mode

 Similar Physics Forum Discussions Thread Thread Starter Forum Replies Last Post pablorodas_5 Advanced Mechanics 0 May 15th 2011 11:49 PM Coobe Equilibrium and Elasticity 1 Mar 11th 2010 10:03 AM Seda Kinematics and Dynamics 1 Nov 20th 2009 12:30 AM Diggidy Equilibrium and Elasticity 1 Apr 2nd 2009 04:14 AM Tulip007 Equilibrium and Elasticity 0 Oct 12th 2008 12:34 AM