text:
D.E. with integrating factor question

I have $\frac{dy}{dx}=5xy + \sin x$, $y(0) = 1$. I am asked to use an integrating factor. What I did:

$\frac{dy}{dx}-5xy = \sin x \\ \text{Integrating factor:} \ e^{\int{-5x\ dx}} = e^{-\frac{5}{2}x^2} \\ \frac{d}{dx}\left[e^{-\frac{5}{2}x^2}y\right] = e^{-\frac{5}{2}x^2}\sin x \\ e^{-\frac{5}{2}x^2}y = \int e^{-\frac{5}{2}x^2}\sin x \ dx \\ y = e^{\frac{5}{2}x^2}\int e^{-\frac{5}{2}x^2}\sin x \ dx$

However, in my previous thread, How to solve $\frac{dy}{dx}=5xy + \sin x$?, few users said $y = e^{\frac{5}{2}x^2}\big(1+\int_0^x e^{-\frac{5}{2}t^2}\sin t \, dt\big)$ or $y = e^{\frac{5}{2} x^2} (\int e^{-\frac{5}{2} x^2} \sin x\ dx + C)$

But Im wondering, where does the $1$ or $c$ come from? Shouldnt it just be $y = e^{\frac{5}{2}x^2}\int e^{-\frac{5}{2}x^2}\sin x \ dx$?

Edit: $y = e^{\frac{5}{2}x^2}\int e^{-\frac{5}{2}x^2}\sin x \ dx + Ce^{\frac{5}{2}x^2}\\ \text{using } y(0) =1 \\c=1\\ y = e^{\frac{5}{2}x^2}\left(\int e^{-\frac{5}{2}x^2}\sin x \ dx + 1\right)$

-

The point is that $\int \ldots\ dx$ is an antiderivative, which always is defined only up to an arbitrary constant. So if you get one solution with a certain choice $g(x)$ for the antiderivative, you will get others by replacing $g(x)$ by $g(x)+C$, where $C$ is any constant. And you will need the freedom to choose that constant, because you also have an initial condition $y(0)=1$ to satisfy.
Thanks @RobertIsrael , can I ask, why did the other user put $1$ instead of $C$? –  Richard Apr 30 '12 at 22:06
He was using a particular antiderivative (a definite integral) and the $1$ was the value of $C$ that was needed to satisfy the initial condition. –  Robert Israel Apr 30 '12 at 22:08
No, because you didn't specify which antiderivative your $\int e^{-\frac{5}{2}x}\sin x\ dx$ is. –  Robert Israel Apr 30 '12 at 22:19


text:
zbMATH — the first resource for mathematics

Examples
 Geometry Search for the term Geometry in any field. Queries are case-independent. Funct* Wildcard queries are specified by * (e.g. functions, functorial, etc.). Otherwise the search is exact. "Topological group" Phrases (multi-words) should be set in "straight quotation marks". au: Bourbaki & ti: Algebra Search for author and title. The and-operator & is default and can be omitted. Chebyshev | Tschebyscheff The or-operator | allows to search for Chebyshev or Tschebyscheff. "Quasi* map*" py: 1989 The resulting documents have publication year 1989. so: Eur* J* Mat* Soc* cc: 14 Search for publications in a particular source with a Mathematics Subject Classification code (cc) in 14. "Partial diff* eq*" ! elliptic The not-operator ! eliminates all results containing the word elliptic. dt: b & au: Hilbert The document type is set to books; alternatively: j for journal articles, a for book articles. py: 2000-2015 cc: (94A | 11T) Number ranges are accepted. Terms can be grouped within (parentheses). la: chinese Find documents in a given language. ISO 639-1 language codes can also be used.

Operators
 a & b logic and a | b logic or !ab logic not abc* right wildcard "ab c" phrase (ab c) parentheses
Fields
 any anywhere an internal document identifier au author, editor ai internal author identifier ti title la language so source ab review, abstract py publication year rv reviewer cc MSC code ut uncontrolled term dt document type (j: journal article; b: book; a: book article)
Abelian Chern-Simons theory and linking numbers via oscillatory integrals. (English) Zbl 0869.46022
The work is dedicated to the creation of a mathematical model of Abelian Chern-Simons theory based on the theory of infinite-dimensional oscillatory integrals, developed in [the first author and {\it R. Hoegh-Krohn}, Mathematical theory of Feynman path integrals, Lect. Notes in Math. 523 (1976; Zbl 0337.28009)]. A Chern-Simons path integral is considered as a Fresnel integral in a certain Hilbert space. Willson loop variables are determined as Fresnel integrable functions. It is mathematically shown that there exists a connection between expectation values of products of Willson loops with respect to the path integral and linking numbers, which is a topological invariant. The topological invariant can be calculated in terms of pairwise linking numbers of the loops as was conjectured by {\it E. Witten} [Commun. Math. Phys. 117, No. 3, 353-386 (1988; Zbl 0656.53078)].

MSC:
 46G12 Measures and integration on abstract linear spaces 81S40 Path integrals in quantum mechanics
Full Text:

format: plain


text:
# Security vulnerability in Haskell with CGI

Compiled Haskell programs all include special RTS (Run Time System) options, that change things like the number of cores that it runs on, various internal things relating to how often garbage collection runs, etc. They’re specified by invoking the program like ./foo +RTS -m10 -k2000 -RTS to run the GHC-compiled program ‘foo’, reserving 10% of the heap for allocation and setting each thread’s stack size to a maximum of 2000 bytes. In the current build of GHC, there is no way to disable these options from working (although the option –RTS will make all further options be interpreted as normal, non-RTS options). The problem is that the option -tout will write profiling data to the file out. So, if your program is setuid root, anybody who runs it can write the profiling data to, say /etc/passwd and render the system unusable. They don’t get to pick what gets written, so they can’t add a backdoor for themselves, but they can essentially scribble over whatever files they want. This is bug #3910, and the fix (disabling RTS by default) has been uploaded.

Now, one of the more little-known features of CGI is that if you pass a query string that does not contain any = signs to a CGI script, the httpd may pass the string along as command-line arguments. This is specified in section 4.4 of RFC 3875, and it specifies how the query string SHOULD be turned into arguments (although it does not say anything about whether the httpd should behave this way, only that some do). This is an example script that only outputs its arguments in a comma-separated list; the link gives it some sample arguments. Note that by URL-escaping, you can send arbitrary strings through… including +RTS. So if that were, say, a Haskell script, I could pass the query string ?%2BRTS+-tindex.html+-RTS and overwrite index.html.

There are three ways to get around this: first, GHC 6.12.2 has the -no-rtsopts option, which will obviously disable RTS options. So if you just recompile your script with that, it’ll be safe. Note that 6.14 will disable the RTS options by default; the 6.12.2 patch didn’t for backwards-compatibility reasons. Second, if you don’t want to use 6.12.2 for whatever reason, you can wrap it in a shell script that calls it with no options. For example, replace the Haskell script with a shell script called, say, hscript.cgi (if your Haskell program is called hscript) that calls it with no arguments, e.g.

#!/bin/bash
./hscript.real

and rename the Haskell script to hscript.real, so that it doesn’t get run as CGI (I’m assuming that .real files don’t get run as CGI on your machine!) Another thing you can do is to add the following to your .htaccess, which will give 403 Forbidden errors to anybody passing RTS arguments in the URL:

RewriteEngine on
RewriteCond %{QUERY_STRING} ^(?:[^=]*\+)?(?:%2[bB]|(?:-|%2[dD]){1,2})(?:%52|R)(?:%54|T)(?:%53|S)(?:\+[^=]*)?$RewriteRule ^ - [F] This will solve it for every Haskell script you use, but relies on the regex being correct, which isn’t something I can guarantee. ## 6 ResponsesLeave one → 1. #### Kevin Reid / April 24, 2010 I strongly recommend not using the third option as it’s more error-prone: the regexp is not obviously correct, whereas the first or second option simply removes this data path entirely and so can’t “miss something”. Reply 2. #### zygoloid / April 27, 2010 One nice “fix” is: #! /bin/bash GHCRTS= real-program –RTS “$@”

The –RTS switch disables recognition of all further +RTS flags. I’d recommend this even once GHC 6.14 ships (it’ll still produce a warning if you specify +RTS).

3. #### 21st Century Man

/  April 27, 2010

CGI? 1998 called, it wants its insecure remote executable-launching protocol back.

4. #### Hailey

/  June 15, 2010

One nice “fix” is:

#! /bin/bash
GHCRTS= real-program –RTS “\$@”

The –RTS switch disables recognition of all further +RTS flags. I’d recommend this even once GHC 6.14 ships (it’ll still produce a warning if you specify +RTS).


text:
What is a system of linear equations in three variables?

What is a system of linear equations in three variables?
You can still ask an expert for help

• Questions are typically answered in as fast as 30 minutes

Solve your problem for the price of one coffee

• Math expert for every subject
• Pay only if we can solve it

SchulzD
The set of equations that involved representing a line.
The system of equations suggest three unknown values for which those equations are need to be solved.
The system of linear equations in 3 variables is a set of 3 linear equations with 3 unknown values called variables.
For example,
2x+4y+7z=1x+3y+5z=−12−x+3y−3z=16


text:
If you want a general overview of the paper you can check the summary.

Here I’m going to present a summary of:

## Byte Pair Encoding

#### Context

This is an algorithm to define the tokens for which we’re going to learn vector embeddings. The simplest way to do this is consider each word and punctuation in the text as a token. The problem with this approach is that in testing we won’t have an embedding for words we didn’t see before. Some research has successfully used characters as tokens (Kim et. al 2016, Costa-Jussa et. al 2016). Byte pair encoding can be put in the middle of these two techniques.

#### The algorithm

The motivation behind the algorithm is to define a set of tokens that can be used to construct any word, but also contain the most typical words. So we can learn good representations for the most common terms but at the same time remain flexible and have some knowledge for unknown words. The algorithm then is as follows:

1. We start the tokens set with each of the possible characters plus an end-word character.
2. We determine the number of merges that we want to do.
3. For every merge, we will count the occurences of each pair of tokens in our corpus, and we’re going to add as a string the pair (the concatenation) the most frequent. Therefore, adding 1 new token to our set.

With this, the size of the vocabulary = the number of merges + the number of different characters + 1 (the end-word character). So if we define the number of merges as $\inf$ then the vocabulary is all the possible characters and all the different words.

#### Context

There are different algorithms to decode the final output sequence. This is because our model outputs a probability distribution over our vocabulary, and then we need to choose one word each time until we arrived at the end character. One option (greddy decoding) would be to choose at each step the word with the highest probability, but the problem is that this may not lead to the highest probability sentence because it’s calculated as:

#### The algorithm

Instead of being that greedy, beam search proposes to maintain beam_size hypothesis (possible sentences). Then at each step:

1. We predict the next beam_size tokens for each hypothesis
2. From all those possible sentences we take the beam_size most probable hypothesis.

We can stop when we complete $n$ sentences (arrived at the end character), or after $t$ steps. Additionally, they propose to normalize (to divide) the sentence probability by $\alpha$, so longer sentences are not less probable.

## Label smoothing

(Szegedy et. al)

This is a regularization technique that encourages the model to be less confident, therefore more adaptable.

In classifications problems we have ground truth data that follows a distribution $q$ that we usually define as a one hot vector:

If we use the softmax to calculate the output probabilities and we use cross entropy as the loss, then this labels representation can lead to overfitting, therefore this technique proposes to use smoother labels.

### Understanding the problem

In classification problems where we predict the label with a softmax as

Where $x$ is the input, $y_j$ is one of the possible labels, and $z$ the logits (the output score of our model). And we use the cross entropy loss as shown below for one example ($l$) and for all of them ($L$):

When we take the ground truth distribution discrete, that is $\delta_{y,y_i}$ (see definition above of $q$), then $q=0$ for all $y$ different than $y_i$ (the correct label for element $i$), then:

Let’s now calculate the derivative of this to find the minimum of the loss,

Thus,

Then the function is minimized (it’s derivative is zero) when $p(y_k) = q(y_k)$. Which is approachable if $z_i >> z_k \; \forall i \ne k$, in words having the correct logit way bigger than the rest. Because with these values the softmax $p$ would output 1 for the $i$ index and zero elsewhere. This can cause two problems:

1. If the model learns to output $z_i >> z_k$, then it will be overfitting the groundtruth data and it’s not guaranteed to generalize.
2. It encourages the differences between the largest logit and all others to become large, and this, combined with the fact that the gradient is between -1 and 1 , reduces the ability of the model to adapt. In other words, the model becomes too confident of its predictions.

### Proposed solution

Instead of using a one hot vector, we introduce a noise distribution $u(y)$ on the following way:

Thus we have a mixture between the old distribution $q$ and the fixed distribution $u$, with weights $(1-\epsilon)$ and $\epsilon$. We can see this as in, for a $y_j$ label we first set it to the ground truth label $\delta_{y_j,y_i}$ and then with probability $\epsilon$ we replace the label with the distribution $u$.

In the paper where this regularization was proposed they used the uniform distribution $u(y) = 1/K$. If we look at the cross entropy now, it would be:

Where the term $\epsilon H(u, p)$ is penalising the deviation of $p$ from the prior $u$, because if these two are too alike, then its cross entropy ($H(u, p)$) will be bigger and therefore the loss will be bigger.

## Dropout

(Srivastava et. al)

This is another regularization technique that is pretty simple but highly effective. It turns off neurons with a probability $(1-p)$, or in other words it keeps neurons with a probability $p$. Doing this the model can learn more relevant patterns and is less prone to overfit, therefore it can achieve better performance.

The intuition behind dropout is that when we delete random neurons, we’re potentially training exponential sub neural networks at the same time! And then at prediction time, we will be averaging each of those predictions.

In test time we don’t drop (turn off) neurons, and since it is not feasible to explicitly average the predictions from exponentially many thinned models, we approximate this by multiplying by $p$ the output of the hidden unit. So in this way the expected output of a hidden unit is the same during training and testing.

## Layer Normalization

(Lei Ba et. al 2016)

Motivation: During training neural networks converge faster if the input is whitened, that is, linearly transformed to have zero mean and unit variance and decorrelated (LeCun et. al 1998). So we can see the output of one layer as the input of another network, therefore it’s clear that normalizing the intermediate values in the network could be beneficial. The main problem is that each layer has to readjust to the changes in the distribution of the input.

This problem was presented by Ioffe et. al 2015, where they proposed Batch Normalization to overcome this issue, as a way to normalize the inputs of each layer in the network.

### Batch Normalization

In a nutshell, we can think of Batch Normalization as an extra layer after each hidden layer, that transforms the inputs for the next layer from $x$ to $y$. If we consider $\mathcal{B} = \{x_1...x_m\}$ to be the mini batch where each $x_j = (x_j^{(1)}...x_j^{(H)})$ is an input vector of a hidden layer, then the normalization of each dimension is the following:

We’ll approximate the expectation ($\mu$) and the variance ($\sigma^2$) calculating them at the mini batch level. Then the batch normalization will be:

Where $\epsilon$ is a constant added for numerical stability, and $\gamma$ and $\beta$ are parameters of this “layer”, learnt through backpropagation. These parameters are used to be able to keep the representational power of the layer, so by setting $\gamma = \sqrt{\sigma^2_\mathcal{B}}$ and $\beta = \mu$ we can recover the original output, if it were to be the optimal one.

Additionally, during inference we’ll use $\gamma$ and $\beta$ fixed and the expectation and variance will be computed over the entire population (using the first equation).

### Back to Layer Normalization

Batch normalization is not easily extendable to Recurrent Neural Networks (RNN), because it requires running averages of the summed input statistics, to compute $\mu_\mathcal{B}$ and $\sigma^2_\mathcal{B}$. However, the summed inputs in a RNN often vary with the length of the sequence, so applying batch normalization to RNNs appears to require different statistics for different time-steps. Moreover it cannot be applied to online learning tasks (with batch size = 1).

So they proposed layer normalization, that normalises the layers as follows:

Let $a^l$ be the vector of outputs of the $l^{\text{th}}$ hidden layer, and $a^l \in R^H$ (each hidden layer has $H$ hidden units), then:

This looks really similar to the above equations for $\mu_\mathcal{B}$ and $\sigma^2_\mathcal{B}$, however the equations here use only the hidden layer output whereas the ones above use the whole batch.

Similarly as BN, we’ll learn a linear function ($\gamma$ and $\beta$) or as they call it in the paper, a gain function $g$.

Unlike BN, LN is used the same way in training and test times.

#### Comparison to BN

In the paper they showed that LN works better (converges faster and it’s robust to changes in the batch size) for RNNs and feed-forward networks. However BN outperforms LN when applied to CNNs.


text:
# Shockstorm

Professor
24,189 Edits since joining this wiki
August 9, 2012
(Difference between revisions) | User:Shockstorm

Aye, the admin requests have been done, except the restoration of that page, since the reason is that the page was copied from Bulbapedia. 10:54, July 21, 2014 (UTC)

## Jobs Edit

Hi, Shockstorm. I was wondering if there are any maintenance edits you would like me to do. Ellis99 I'm feeling the flow! 16:19, July 21, 2014 (UTC)

Ok. I'll start now.

## Ah, I see...Edit

So, It was a global block? Why these global blocks exists in every wikias? These blocks made me scared :(. OK, Thanks for answering me, Shockstorm! Nectaria (talk) 17:51, July 23, 2014 (UTC)

Hah, did you really think I'd leave this place? It is true that I deserved that block, but I managed to convince the staff that I couldn't leave this place. Permanently, that is. 10:32, July 25, 2014 (UTC)

Ach, I'd rather have that stay in the past. This is not the time to speak of such things. 16:35, July 25, 2014 (UTC)

## CommentEdit

Could you comment on the battle of Skrelp vs. Floette? 21:23, July 26, 2014 (UTC)

## MapEdit

As you might've noticed, the maps feature has been enabled, as seen here. If you've got the time, maybe you can finish existing map or make new maps? If you do, don't do the Hoenn yet, since there needs to be a better quality map. 23:11, July 26, 2014 (UTC)

## Hi Shock Edit

I was wondering, if i'm not from Friday, could you do my blog please. Since I might run out of internet before then. Ellis99 I'm feeling the flow! 17:06, July 27, 2014 (UTC)

## Thanks Shock Edit

Your a life saver and I've always wanted to try XD. Ellis99 I'm feeling the flow! 05:54, July 28, 2014 (UTC)

## By the way Edit

I'll tell you when I might not be able to do blog's again in the future, so that you can then stand in for me and I'll be back doing my blogs from Monday next week and can you do it on Sunday instead due to rounding up the week's news. Ellis99 I'm feeling the flow! 06:00, July 28, 2014 (UTC)

Congratlations! It is good to have you as an admin. Well, there is still a lot of work to do. 07:03, July 29, 2014 (UTC)

Thanks. Glad to be of service here. --Shockstorm (talk) 07:05, July 29, 2014 (UTC)

## BanEdit

Ah, now I have to worry to ban vandals first. Oh well...

And, wow, you managed to get 20 000 edits already? Impressive. 07:26, July 30, 2014 (UTC)

Yeah, but a lot of it's from image categorization :p --Shockstorm (talk) 07:28, July 30, 2014 (UTC)

## Category ChangeEdit

Hey, I'm glad to hear the problem was just a template cache problem. if you notice any pages that aren't in the correct categories just let me know and I'll rerun the bot on the last 100 or so.

Hope you're having a good day!

Cheers,
«Corey» 04:29, July 31, 2014 (UTC)

## Bot Request 2Edit

Will you do me a favor, look through those photos, and make sure that they actually need to be deleted. Last time that I deleted stuff it was stuff that didn't need to be deleted. >.<

After you've checked them I'll delete them.

## Re: Sprites Edit

Thank you for directing me to that sprite page -- you saved me a lot of time! ;)

I'll try to make sure not to reupload any sprites that are already on the Wikia. Right now I'm working on fixing those learnset tables, so it'll be a while before I start on the sprites.

I usually do an image search to find sprites to make sure they haven't already been uploaded. Back sprites of certain Pokemon have been uploaded as well.

Here is an example of how I name sprites (I usually name the sprites according to the type (front, back, shiny) and game (BW, XY, etc)): "SnivyXY" for the standard front sprite from X and Y, "SnivyShinyXY" for the shiny front sprite, "SnivyBackXY" if it's a back sprite, and "SnivyBackShinyXY" if it's a shiny back sprite.

Moonlit Sylveon(talk/contribs) 00:02, August 1, 2014 (UTC)

## Bot Request 2 RE:Edit

Alright, I'll delete them soon.

## MangaEdit

Hm, do you think this is a good way? I inserted the external link to the site where I copied the image. 12:44, August 2, 2014 (UTC)

Yes, that looks good. --Shockstorm (talk) 18:09, August 2, 2014 (UTC)

## MembershipEdit

Damn. You could've let me (and other know) you would make a request. 18:03, August 3, 2014 (UTC)

Yeah, I kinda forget about it. Plus I was on vacation. --Shockstorm (talk) 00:24, August 4, 2014 (UTC)

## Trainer (DP098) Edit

There isn't a duplicate of this page, I renamed it to that from American Trainer. Ellis99 I'm feeling the flow! 07:58, August 5, 2014 (UTC)

## Doesn't matter Edit

I have found the page he was talking about. Ellis99 I'm feeling the flow! 08:05, August 5, 2014 (UTC)

## It isn't Edit

Considered vandal since it was a mistake and I think its better to have them deleted. Ellis99 I'm feeling the flow! 08:12, August 5, 2014 (UTC)

## Hey, Shockstorm!Edit

Can you please move the type pages that Ellis99 messed up? I can't do that because I'm not a rollbacker yet! I wish I should have been a rollbacker ;_;. Nectaria (talk) 09:00, August 5, 2014 (UTC)

## Hi Shockstorm Edit

This is Trainer Micah i see alot of things happening on this wikia alot so you know i have mega question's to ask but i think i vote in to say i like to keep them to myself for now so you know,

If i need any help i'll let you know,Trainer Micah (talk) 10:10, August 5, 2014 (UTC)

## Lets Edit

Agree to disagree about what has happened, is that ok? Ellis99 I'm feeling the flow! 10:42, August 6, 2014 (UTC)

Ok, sounds good. --Shockstorm (talk) 22:20, August 6, 2014 (UTC)
Good, good. Ellis99 CODE XANA 09:20, August 7, 2014 (UTC)

## Re: BW2 Sprites Edit

Thanks for your response, Shockstorm. I figured it would be best to leave the BW2 sprite sections blank for the identical animations.   02:46, August 7, 2014 (UTC)

## Shockstorm Edit

Could you upload the pics from Pokémon Mystery Dungeon Wiki. Ellis99 CODE XANA 13:01, August 7, 2014 (UTC)

## Hey Ellis99's Project... Edit

Hey Shockstorm,

it's me Trainer Micah i got your message & thank you for letting me know so you know, Ellis99 has something to share with us with his new blog if you care to check it out as a user it's called:

Projects - from him have a look at it since i already got it started a as a user in comments should be easy to find as a user,

So you know if your online let me know,

Oh and about your message i like ask what wiki is a good place to chat on can you send me some links?

So you know let me know on that as well..

Kind Regards...Trainer Micah (talk) 18:27, August 7, 2014 (UTC)

## Shock Edit

Could you upload all the MD pics from Mystery Dungeon Wiki so we can wrap up this merge. Ellis99 CODE XANA 19:29, August 7, 2014 (UTC)

Yes, I'll try to soon. I have all the remaining images saved on my computer, so it's all good. --Shockstorm (talk) 19:51, August 7, 2014 (UTC)

## "Megaevolution" Edit

Why did you rename it to...that? It was fine the way it was. Makes the Wikia look even more sloppy and lazy than it appears to be. The renaming was pretty pointless to be honest. --OmegaRasengan (talk) 06:53, August 8, 2014 (UTC)

I moved it since Adrian requested it and I trust his judgment. Of course, maybe it should be moved back. I was going to say you should ask on the talk page, but it looks like you already did :p. I'll be available later today if you all decide it should be moved back, just let me know. --Shockstorm (talk) 16:12, August 8, 2014 (UTC)

## Mystery DunegonEdit

How goes the Mystery Dungeon project? Just asking because we need to report to Yoponot to change redirects from other wikis. 17:03, August 8, 2014 (UTC)

Didn't Yoponot say the site will be shut down too, just to confirm my recollection? Ellis99 CODE XANA 17:11, August 8, 2014 (UTC)
Perhaps. But the other sites link to that Wiki, so it should be informed to redirect them to here. 17:23, August 8, 2014 (UTC)
I think you should inform that to Yoponot. Ellis99 CODE XANA 17:28, August 8, 2014 (UTC)
It can be redirected now, I have all the images that haven't been uploaded yet (which may not be very important, but I've saved them on my computer just in case). --Shockstorm (talk) 20:25, August 8, 2014 (UTC)
Could upload them on here please. Ellis99 CODE XANA 20:46, August 8, 2014 (UTC)
I already said I'll do it when I get around to it. --Shockstorm (talk) 23:46, August 8, 2014 (UTC)
The only reason why I said it is because we can wrap up the merge. Ellis99 CODE XANA 18:36, August 9, 2014 (UTC)

## CategoriesEdit

Thanks for the tip.--Kyurem147 (talk) 17:44, August 9, 2014 (UTC)

## BlockEdit

I saw you blocked Kyurem for tagging valid images for deletion. Can you show me some examples of the said violation? Well, besides the Eevee images. 10:05, August 13, 2014 (UTC)

Well, it is partly justified that his images have much bigger resolution, but that's it. Hm. 17:18, August 13, 2014 (UTC)

## I do Edit

Want to become an admin, for the right reasons because I have notice quite a lot of pages I would like to delete and delete redirects since I would like a bot of my own to correct links. Ellis99 CODE XANA 18:41, August 13, 2014 (UTC)

I have finished the Administrators page, so you can change the protection back now. Ellis99 CODE XANA 18:49, August 13, 2014 (UTC)
Ok, sounds good. In that case, I could support you. Also, I don't think you need to be an admin to use a bot. It just requires community consensus so you can have an account that's flagged as a bot. --Shockstorm (talk) 19:37, August 13, 2014 (UTC)

## Could you Edit

Sort out the broken redirects page in the special pages because I would if I had the powers to do so. Ellis99 CODE XANA 16:51, August 14, 2014 (UTC)

Ok, I've fixed the ones I can. The two blog links are a problem on Wikia's end, I'll contact them sometime about those links. --Shockstorm (talk) 17:27, August 14, 2014 (UTC)

## Mollie's Absol pageEdit

Hey thanks for helping. Can you also unprotect the Mollie's Absol page please? -- DragonSpore18 (talk) 03:51, August 17, 2014 (UTC)

I restored the page since Kyurem tried to delete it (even though it didn't need to be). I think it's unprotected now so you can edit it if you want. --Shockstorm (talk) 04:04, August 17, 2014 (UTC)

## I am sorry Edit

i am sorry for adding things like "coming soon" to pages. STaMpYsNuMbR1FaN (talk) 06:19, August 17, 2014 (UTC)

## Could you sort out Edit

Blasty's redirect problem in the broken redirects page in the special pages section of the site. Ellis99 CODE XANA 07:45, August 17, 2014 (UTC)

Hey sorry for not responding for a while there, I didn't see my messages. Don't worry though I won't be uploading any fan art. Kuzuri (talk)

## Messages from Ellis99 Edit

Going back to a conversation we had. I would use a bot since it's better at noticing link problems than a human because sometimes we can miss things. A bot is better finding links. Ellis99 CODE XANA 17:42, August 17, 2014 (UTC)

Yeah, it is more efficient. If you want you can look at how to use them (like here). Once you're ready you can start a forum thread so the community can approve the bot request and give your bot account a flag. --Shockstorm (talk) 18:04, August 17, 2014 (UTC)

## I'll remove the deletion Edit

I'll ask Moonlit to replace the current pic since it has a white background instead of a clear one. Ellis99 CODE XANA 16:20, August 18, 2014 (UTC)

Ok, I didn't realize it didn't have transparency. That's fine then. Next time just add a reason to the deletion notice with a "|" ;) --Shockstorm (talk) 21:06, August 18, 2014 (UTC)

## Hi, Shockstorm!Edit

 Nectaria TALK – 13:38, August 19, 2014 (UTC) Thanks for deleting this stupid 666 page. I knew that it was a fake not a real glitch. They should stop making these annoying 666 jokes. I can't stand of those fans -_-.

No problem, that's what I was thinking too. --Shockstorm (talk) 13:38, August 19, 2014 (UTC)

 Nectaria TALK – 13:45, August 19, 2014 (UTC) Well, I'm always angry when those fans post anything fakes like the 666 jokes to this wiki! Thanks for answering me, Shockstorm ^_^.

## Hey Shockstorm, Edit

It's me Trainer Micah hey i'm just stopping by to let you know that i am about to archive my talk page so you kinda know,

And i need someone to you know move it onto my talk page so whenever you get this i'll be done to making archive okay..

So you know oh and if you need me to do anything later or so let me know on that alright.

So you know, kind regards..Trainer Micah (talk) 16:09, August 19, 2014 (UTC)

Or Actually um can you do the "Archive" for me since my talk page doesn't have it please?

Kind Regards...Trainer Micah (talk) 16:13, August 19, 2014 (UTC)

## Rename Edit

Could you rename the admins and leader of Team Flare, example, XY Celosia, so there is a gap inbetween the "XY" and the name. Ellis99 CODE XANA 19:28, August 19, 2014 (UTC)

## Sure/ThanksEdit

Sure, I'll upload better quality pictures for those two, they're not going to be as good as the other ones, but they'll be at least better. If there are any others I somehow missed, please let me know. And thanks. $Adrian$ $Perry$ $GZ$ 21:41, August 20, 2014 (UTC)

## ImagesEdit

I know the article concept, but about the images. Which ones can I not tag?--Kyurem147 (talk) 07:17, August 21, 2014 (UTC)

## ImagesEdit

I'd would simply rename an image like dream artwork, but even I can't do that. What if an image is bigger than current one with different name. and/or different format. This move template is that like renaming how's it work? Also what's default skin, Oasis?--Kyurem147 (talk) 23:34, August 21, 2014 (UTC)

So if I want a pic or in other words renamed I use that move template and you or anyone else would move and rename it? Also the simisear images that's where my question come in. Are doubles of these kind allowed as long as its different named? Like the eevee incident (which I deeply apoligize for) you didn't like me tagginig those images. SO I didn't tag these. For example. Same size and format.--Kyurem147 (talk) 23:51, August 21, 2014 (UTC)

## CelebiEdit

Was something wrong with 251Celebi_Pokemon Colosseum?--Kyurem147 (talk) 02:47, August 22, 2014 (UTC)

It was taken another from another site? Am I gonna have to clean up sort of speak?--Kyurem147 (talk) 02:49, August 22, 2014 (UTC)

I'm sorry really didn't know! I'll help, I'll show my the pics so you can delete them.--Kyurem147 (talk) 02:52, August 22, 2014 (UTC)

<images removed>

I'm done. I removed and tagged site named ones, I cleaned up my mess. They're all in the Candidates for deletion.--Kyurem147 (talk) 03:50, August 22, 2014 (UTC)

I'm really sorry, I really had no idea that was illegal. Now I've learned something new and easy to remember Never take and add an image with a site name on it right? I just wanna say if I have made a another mess I don't know about, please tell me and I'll help fix any way I can.--Kyurem147 (talk) 05:28, August 22, 2014 (UTC)

## Could you do a News Blog Edit

for next week (not this Sunday coming up)since I'm going on holiday for a week. Ellis99 CODE XANA 11:03, August 22, 2014 (UTC)

Yep, that's the date. Ellis99 CODE XANA 20:09, August 22, 2014 (UTC)

## Template helpEdit

I tried to get this template for the Dutch pokémon wiki but i can't make the transparant border appear. I've copied the code and made the roundy template. Can you tell me what i'm doing wrong? Jantje132 (talk) 15:02, August 22, 2014 (UTC)

## ImagesEdit

I would, but could you tell me how and why? Where's the link go? Why provide a link? I'm starting to get worried here.--Kyurem147 (talk) 23:31, August 22, 2014 (UTC)

Well no, it just I'm worried the outcome I mean what happens after I put the links down. I mean I worked adding and catergorizing them. But if I have to take them off I will.

Well most of them, some are from ...well others. Man this stress is killing me I'm getting heart pain!--Kyurem147 (talk) 00:00, August 23, 2014 (UTC)

## LicensingEdit

What? How, I never thought that someone would do that. Just which user(s) has done that?

But, deleting images is not much of an option. However, it seems a project to replace images is inevitable, perhaps you, Kyurem and Moonlight Sylveon might upload (bigger) artwork (and categorise it)? 08:50, August 23, 2014 (UTC)

## ChatEdit

Could you please come to the chat? 13:12, August 23, 2014 (UTC)

Once the forum has won in favor of ridding the leaders, could you possibly make Moonlit the leader of Project Sprites. Ellis99 CODE XANA 17:41, August 23, 2014 (UTC)

## PokepowerEdit

Did you vote on the poffin poll? Got the message from X?--Kyurem147 (talk) 00:29, August 24, 2014 (UTC)

Why does this matter so much to you people? I mean, seriously. I'd appreciate if you don't bother me with this nonsense. --Shockstorm (talk) 00:30, August 24, 2014 (UTC)

Sorry my bad. I'll take break for while.--Kyurem147 (talk) 00:32, August 24, 2014 (UTC)

Ah, but we want as much as spotlighting as possible. It is why I request this voting. 08:45, August 24, 2014 (UTC)

## Pokémon Rumble UEdit

Do you have any info for this page? http://pokemon.wikia.com/wiki/Pok%C3%A9mon_Rumble_U I do not want to copy from Bulbapedia. --GamerTimeUS (talk) 03:19, August 24, 2014 (UTC)

No, I haven't played that game, sorry. --Shockstorm (talk) 03:21, August 24, 2014 (UTC)

## .css / .js scriptsEdit

Hey, do you know anything about those scripts? I have a brilliant idea, but it just requires some knowledge of those codings (which I have none). 19:59, August 24, 2014 (UTC)

No, unfortunately, I don't have any experience in that. Although Slaying might. --Shockstorm (talk) 20:19, August 24, 2014 (UTC)

Shucks. Well, I am going to contact Slaying. 20:29, August 24, 2014 (UTC)

## Hey Shockstorm hi, Edit

Well i got done chatting with Nectaria as a admin user, I left a little message for you & Energy X so you know i as a admin of pokemon answers wiki as you know i don't mind you guys or girl user's which ever it may be, I don't mind you two on becomeing a admin as well pokemon answers wiki we need all the activity on admin's we can actually get as a user...

So you know i not a very *strict* admin on there like most wikis are you know i am more like of a *relaxing* type as a admin user so you know..

So you know i do keep thing's closed eyed though to make sure that nothing bad happens, Oh and about my message on pokemon answers wiki the *secret* i need to ask when your birthday is?

So you know i'll i'll chat with you Wednesday okay,Trainer Micah (talk) 22:09, August 25, 2014 (UTC)

Thanks, but I'm not really interested. --Shockstorm (talk) 01:36, August 26, 2014 (UTC)

## ElectrodeEdit

Shock Moonlit Sylveon add electrode artwork said they're from other site. Can I add mine again?--Kyurem147 (talk) 18:11, August 26, 2014 (UTC)

Well if you both say so. He said as long as they don't violate fair use. I can't figure out what he means. I just don't make another mistake. If I do please tell me and I didn't mean too.--Kyurem147 (talk) 21:19, August 26, 2014 (UTC)

I still can't figure out what he means. He said let you explain it.--Kyurem147 (talk) 22:35, August 26, 2014 (UTC)

Really Thanks, I'll stop worrying. Never thought I (and the others) would be right.--Kyurem147 (talk) 01:35, August 27, 2014 (UTC)

## Troll Issues Edit

Hello, Shockstorm,

We are currently having a serious issue with a Troll named "ShadeTempest" who came onto this Wikia about two days ago solely to insult, harass, inform us that we are not as good as Bulbapedia, and that we should shut down The Pokemon Wiki. He refuses to stop, and he has been very rude and snarky to Nectaria, Monfernape, me, and EnergyX. He has a sock-puppet/friend (?) named "Cloudisfast" (who popped up at the same time he showed up) helping him out as well (although this sock-puppet "user" has already been blocked for extreme rudeness and harassment). I strongly believe that ShadeTempest should be banned for at least a few months, if not permanantly, because he is blatantly Trolling. He has no desire to contribute here -- only to spew rudeness and hate toward our Wiki. Please help. . . ShadeTempest needs to be banned for intimidating behaviour, harassment, and Trolling, just like his "puppet" (or friend) "Cloudisfast". ShadeTempest is clearly a Troll, and it is blatantly obvious that he is trying to stir up trouble and anger here on the Wiki.

(You can also see my and Nectaria's messages to EnergyX on his current talk page, and his 11th talk page archive, to fully assess the situation.)

Cloudisfast's contribs:

20:29, August 27, 2014 (UTC)

Sorry for the wait, I was in class. Sockpuppetry (or abusing multiple accounts) is never acceptable, so I've banned his two accounts for a long time. --Shockstorm (talk) 21:45, August 27, 2014 (UTC)
Shockstorm, you are truly a hero! Thank you so much for banning the Troll(s)! :D   21:53, August 27, 2014 (UTC)

## AccountsEdit

Ah, but how can you expect they are sockpuppets? One of them even insulted the other. 21:49, August 27, 2014 (UTC)

Energy. . . He did that (insulted himself on his own page using another account) so no one would suspect he is the same person. . . Trolls do that all the time. . . Does it really make sense that he would screech at me for reporting "ShadeTroll", and then randomly call "ShadeTroll" a "fatty"? Think about it. . .

21:54, August 27, 2014 (UTC)

Eh. Let's just drop the subject. But, if he actually is a troll, then he wouldn't complain in the Community Central... 22:06, August 27, 2014 (UTC)

Oh, yes he would. He denies he's a Troll, obviously. . . But, yes, that's all behind us now. We should drop the subject.    22:10, August 27, 2014 (UTC)

Because I've had experience with people like that, and now he's leaving irrelevant messages on my Community Central talk page. That's why. --Shockstorm (talk) 23:22, August 27, 2014 (UTC)

Okay, this guy is out of control. . . Now he's Trolling, harassing, and stalking me on Community Central. . .    00:36, August 28, 2014 (UTC)

## ZigzagoonEdit

Shock in case you're wondering the Zigzagoon thing was accident I swear. I was just loading the art, I didn't know Moonlit was doing it too.--Kyurem147 (talk) 03:59, August 28, 2014 (UTC)

I didn't notice it, but it looks like you and Moonlit have it figured out, so it's fine. --Shockstorm (talk) 04:00, August 28, 2014 (UTC)

## Music?Edit

Hey Shock, I was wondering something. Do you think, via .css (or .js), could we enable music on every page on this Wiki? It does not have to be limited only to Pokémon music, although it may be preferred. 21:55, August 29, 2014 (UTC)

Possibly, but I'm not sure how. I found two links that might help, although they're a bit old (here and here). --Shockstorm (talk) 22:16, August 29, 2014 (UTC)

Ah, I see. Well, with the right coding (and not to set it to autoplay) we might enable that. But maybe some other time. 22:33, August 29, 2014 (UTC)

## Blogs?Edit

Where are the blogs on this wikia?--Pokemon Trainer XT (talk) 22:32, August 29, 2014 (UTC)

## ArtworkEdit

Shock I made another mistake I honestly tell you. I didn't know these were already up, could delete these for me?--Kyurem147 (talk) 07:05, August 30, 2014 (UTC)

My mistake, I'll stop that. I'll try that move template you told about and could you show me how it's done?--Kyurem147 (talk) 07:11, August 30, 2014 (UTC)

I'll need help your on the move template thing. Show me it's done. You said it's way I can rename a pic.--Kyurem147 (talk) 07:15, August 30, 2014 (UTC)

Ok I'll ask at a better time. I don't when only time will tell. Moonlit got me confused when he/she said I could the artwork. She was talking about Gen III.--Kyurem147 (talk) 07:21, August 30, 2014 (UTC)

## I was wondering Edit

Since Kyurem seem to make mistakes with pictures, why don't you ask him to do something else. Ellis99 CODE XANA 07:18, August 30, 2014 (UTC)

Well, he can do what he wants, as long as he's not causing trouble. --Shockstorm (talk) 07:35, August 30, 2014 (UTC)

## PicsEdit

I remember that rule said no pics with website named. Well I think I might have a mistake. I didn't mean to load these cause I thought there was website on them. Do they have them and if do please delete. Remembered rule, but forgot why I didn't load them in the first place.--Kyurem147 (talk) 10:32, August 30, 2014 (UTC)

Those are fine, since there isn't really a website listed, plus it's from Nintendo. --Shockstorm (talk) 20:12, August 30, 2014 (UTC)

## SorryEdit

Sorry about the badge hunting thing, thank you for concerning me and I won't do it again.--Pokemon Trainer XT (talk) 12:05, August 30, 2014 (UTC)

## Re: B2W2 Sprites Edit

No, they haven't changed at all. As far as I know, all of the BW2 sprites are completely identical to the BW sprites, except for the Unova Starters and their evolutions.

19:57, August 31, 2014 (UTC)

## Last commentEdit

Shockstorm, it is time. You should make your comment very persuasive for the final FOB battle. 19:33, September 1, 2014 (UTC)

Er, didn't you read the poll? From your words, Hydreigon would battle Lilligant, but Lilligant is teamed up with Hydreigon against the other challengers, who fight separately. 20:20, September 1, 2014 (UTC)

Yeah, I tried to make sense of it, but 2 vs 1 vs 1 doesn't even happen, so whatever. I don't really care honestly. You can find someone else to do it. --Shockstorm (talk) 20:23, September 1, 2014 (UTC)
Sorry, I just have a lot of stuff to do, so I'm kinda stressed and busy. --Shockstorm (talk) 21:58, September 1, 2014 (UTC)


text:
# Easy Permutation-Combination Solved QuestionAptitude Discussion

 Q. A box contains $10$ balls out of which $3$ are red and rest are blue. In how many ways can a random sample of $6$ balls be drawn from the bag so that at the most $2$ red balls are included in the sample and no sample has all the $6$ balls of the same colour?
 ✖ A. $105$ ✔ B. $168$ ✖ C. $189$ ✖ D. $120$

Solution:
Option(B) is correct

Six balls can be selected in the following ways:

One red ball and 5 blue ball

Or
Two red balls and 4 blue balls

Total number of ways:
$= ({^3C_1} × {^7C_5}) + ({^3C_2} × {^7C_4})$

$= 63 + 105$

$= \textbf{168}$


text:
# statwt¶

statwt(vis, selectdata=True, field='', spw='', intent='', array='', observation='', scan='', combine='', timebin='1', slidetimebin=False, chanbin='spw', minsamp=2, statalg='classic', fence=- 1, center='mean', lside=True, zscore=- 1, maxiter=- 1, fitspw='', excludechans=False, wtrange=[''], flagbackup=True, preview=False, datacolumn='corrected')[source]

Compute and set weights based on variance of data.

[Description] [Examples] [Development] [Details]

Parameters
• vis (string) - Name of measurement set

• selectdata (bool=True) - Enable data selection parameters

selectdata = True
• field (string=’’) - Selection based on field names or field index numbers. Default is all.

• spw (string=’’) - Selection based on spectral windows:channels. Default is all.

• observation (string=’’) - Selection based on observation IDs. Default is all.

• intent (string=’’) - Selection based on intents. Default is all.

• array (string=’’) - Selection based on array IDs. Default is all.

• scan (string=’’) - Select data by scan numbers.

• combine (string=’’) - Ignore changes in these columns (scan, field, and/or state) when aggregating samples to compute weights. The value “corr” is also supported to aggregate samples across correlations.

• timebin ({string, int}=’1’) - Length for binning in time to determine statistics. Can either be integer to be multiplied by the representative integration time, a quantity (string) in time units

• slidetimebin (bool=False) - Use a sliding window for time binning, as opposed to time block processing?

• chanbin ({string, int}=’spw’) - Channel bin width for computing weights. Can either be integer, in which case it is interpreted as number of channels to include in each bin, or a string “spw” or quantity with frequency units.

• minsamp (int=2) - Minimum number of unflagged visibilities required for computing weights in a sample. Must be >= 2.

• statalg (string=’classic’) - Statistics algorithm to use for computing variances. Supported values are “chauvenet”, “classic”, “fit-half”, and “hinges-fences”. Minimum match is supported, although the full string must be specified for the subparameters to appear in the inputs list.

statalg = hinges-fences
• fence (double=-1) - Fence value for statalg=”hinges-fences”. A negative value means use the entire data set (ie default to the “classic” algorithm). Ignored if statalg is not “hinges-fences”.

statalg = fit-half
• center (string=’mean’) - Center to use for statalg=”fit-half”. Valid choices are “mean”, “median”, and “zero”. Ignored if statalg is not “fit-half”.

• lside (bool=True) - For statalg=”fit-half”, real data are <=; center? If false, real data are >= center. Ignored if statalg is not “fit-half”.

statalg = chauvenet
• zscore (double=-1) - For statalg=”chauvenet”, this is the target maximum number of standard deviations data may have to be included. If negative, use Chauvenet's criterion. Ignored if statalg is not “chauvenet”.

• maxiter (int=-1) - For statalg=”chauvenet”, this is the maximum number of iterations to attempt. Iterating will stop when either this limit is reached, or the zscore criterion is met. If negative, iterate until the zscore criterion is met. Ignored if statalg is not “chauvenet”.

• fitspw (string=’’) - Channels to include in the computation of weights. Specified as an MS select channel selection string.

• excludechans (bool=False) - If True: invert the channel selection in fitspw and exclude the fitspw selection from the computation of the weights.

• wtrange (doubleArray=[‘’]) - Range of acceptable weights. Data with weights outside this range will be flagged. Empty array (default) means all weights are good.

• flagbackup (bool=True) - Back up the state of flags before the run?

• preview (bool=False) - Preview mode. If True, no data is changed, although the amount of data that would have been flagged is reported.

• datacolumn (string=’corrected’) - Data column to use to compute weights. Supported values are “data”, “corrected”, “residual”, and “residual_data” (case insensitive, minimum match supported).

Description

Warning

WARNING: If not run in preview mode, this application can modify the WEIGHT, WEIGHT_SPECTRUM, SIGMA, SIGMA_SPECTRUM, FLAG, and FLAG_ROW columns of the input MS. If you want a pristine copy of the input MS to be preserved, you should make a copy of it before running this application.

This application computes values for the WEIGHT and WEIGHT_SPECTRUM (if present) columns and/or the SIGMA and SIGMA_SPECTRUM (if present) columns based on the variance of values in the CORRECTED_DATA or DATA column. If the MS does not have the specified data column, the application will fail. The following algorithm is used:

1. For unflagged data in each sample, create two sets of values, one set is composed solely of the real part of the data values, the other set is composed solely of the imaginary part of the data values.

2. Compute the weighted (by exposure time) variance of each of these sets, v $$_r$$ and v $$_i$$. The weighted variance per unit inverse exposure time, v, is computed using v = sum(e $$_i$$ * (V $$_i$$ - <V>) $$^2$$)/N, where e $$_i$$ is the exposure time for real/imaginary part of visibility V $$_i$$ and <V> = sum(e $$_i$$ * V $$_i$$)/sum(e $$_i$$) is the weighted mean of all the visibilities in the set, and N is the number of (unflagged) visibilities (see also this Knowledgebase Article)

3. Compute v $$_{eq}$$ $$=$$ (v $$_{r}$$ $$+$$ v $$_{i}$$) $$/$$ 2.

4. The associated weight of visibility V $$_i$$ is e $$_i$$ / V (seeKnowledgebase Article) <../../notebooks/memo-series.ipynb#Calculation-of-Weights-for-Data-with-Varying-Integration-Time>__. The weight will have unit of (data unit), e.g., Jy. The visibility weights are what this application computes and writes.

Data are aggregated on a per-baseline, per-data description ID basis. Data are aggregated in bins determined by the specified values of the timebin and chanbin parameters. By default, data for separate correlations are aggregated separately. This behavior can be overriden by specifying combine=”corr” (see below).

Rules regarding creating/initializing WEIGHT_SPECTRUM column

1. If run in preview mode (preview=True), no data are modified and no columns are added.

2. Else if datacolumn=’residual’ or ‘residual_data’ and a CORRECTED_DATA column exists, the WEIGHT and WEIGHT_SPECTRUM columns are not modified.

3. Else if the MS already has a WEIGHT_SPECTRUM and this column has been initialized (has values) it will always be populated with the new weights. The WEIGHT column will be populated with the corresponding median values of the associated WEIGHT_SPECTRUM array.

4. Else if the frequency interval (chanbin) is not the default (‘spw’, not to be confused with the parameter spw), the WEIGHT_SPECTRUM column will be created (if it doesn’t already exist) and the new weights will be written to it. The WEIGHT column should be populated with the corresponding median values of the WEIGHT_SPECTRUM array.

5. Otherwise the single value for each spectral window will be written to the WEIGHT column; the WEIGHT_SPECTRUM column will not be added if it doesn’t already exist, and if it does, it will remain uninitialized (no values will be written to it).

6. In cases where columns are added and initialized, the WEIGHT_SPECTRUM values will be set equal to the corresponding WEIGHT values, and the SIGMA_SPECTRUM values will be set to the corresponding SIGMA values.

In cases where columns are added and initialized, the WEIGHT_SPECTRUM values will be set equal to the corresponding WEIGHT values, and the SIGMA_SPECTRUM values will be set to the corresponding SIGMA values.

Warning

WARNING: For some cases when only a subset of data is selected and the WEIGHT_SPECTRUM and/or SIGMA_SPECTRUM columns are created, there is a known code issue in which these columns are not properly created and initialized for the specified subset of data, although they are properly initialized for the entire dataset. In such cases, an exception will be thrown. Because the columns are created for the entire dataset, the user simply needs to rerun the statwt task using the same parameters and the task should complete as expected. Should this condition occur when the user is using the ms.statwt() tool method, the user should close the ms tool, and then reopen it using the same data set and configure the same selection, and rerun ms.statwt(). The tool method should then complete as expected.

Rules for modifying WEIGHT, WEIGHT_SPECTRUM, SIGMA, and SIGMA_SPECTRUM

1. If datacolumn=’corrected’ or ‘residual’, then values are written to the WEIGHT and WEIGHT_SPECTRUM (if applicable) columns only.

2. If datacolumn=’data’ or ‘residual_data’ and the CORRECTED_DATA column does not exist, then values are written to the WEIGHT and WEIGHT_SPECTRUM (if applicable) columns and values in the SIGMA and SIGMA_SPECTRUM are set to 1/ $$\sqrt{\rm {newly\,computed\,weight}}$$. If a weight value is 0, the corresponding sigma value is -1.

3. If datacolumn=’data’ or ‘residual_data’ and the CORRECTED_DATA column does exist, then the WEIGHT and WEIGHT_SPECTRUM columns are not updated and values in the SIGMA and SIGMA_SPECTRUM are set to 1/ $$\sqrt{\rm {newly\,computed\,weight}}$$. If a weight value is 0, the corresponding sigma value is -1. In this case, you should either split out the DATA column and run statwt, or run with datacolumn=’corrected’ or ‘residual’ to update WEIGHT/WEIGHT_SPECTRUM. Otherwise the data are internally not consistent.

Note

NOTE: statwt will produce an error if the measurement set has WEIGHT_SPECTRUM and/or SIGMA_SPECTRUM columns for which some rows are initialized (have values) and other rows have no data. It is recommended to run the initweights task to completely initialize these columns if you encounter this error.

Time Binning

One of two algorithms can be used for time binning. If slidetimebin=True, then a sliding time bin of the specified width is used. If slidetimebin=False, then block time processing is used. The sliding time bin algorithm will generally be both more memory intensive and take longer than the block processing algorithm. Each algorithm is discussed in detail below.

If the value of timebin is an integer,this value represents the number of contiguous, unique time stamps (from the MS TIME column) that should be used for averaging.

The timebin parameter can also be specified as a quantity (string) that must have time conformant units.

Block Time Processing

The data are processed in contiguous time blocks in this case. This means that all WEIGHT_SPECTRUM values will be set to the same value for all data within the same time bin/channel bin/correlation bin (see the section on channel binning and description of combine=”corr” for more details on channel binning and correlation binning).

If timebin is specified as a time quantity (eg, ‘110s’), then the time bins are not necessarily contiguous and are not necessarily the same width. The start of a bin is always coincident with a value from the TIME column, So for example, if values from the TIME column are [20s, 60s, 100s, 140s, 180s, 230s], and timebin = 110s, the first bin would start at 20s and run to 130s, so that data from timestamps 20s, 60s, and 100s will be included in the first bin. The second bin would start at 140s, so that data for timestamps 140s, 180s, and 230s would be included in the second bin.

In the case where timebin is an integer, this denotes the number of contigous timestamps that should be binned together. Note that, in this case, for rows “left over” in the upper edge of the bin, their values are computed using timebin that would include rows with times earlier than them. For example, in an MS with 8 rows in one block to be processed and timebin=3, timestamps 1, 2, and 3 would be used to compute the weights of the first three three rows, and rows 4, 5, and 6 would be used to compute weights for the next three rows as expected. Rows 7 and 8 are “left over” rows, but three rows (as per the integer timebin specification) are still used to compute them. Row 7 and 8 weights are computed by combining data in rows 6, 7, and 8.

Sliding Time Window Processing

In the sliding time window case, in the case where timebin is a time quantity, the time window is always centered on the timestamp of the row in question and extends timebin 2 around that timestamp, subject the the time block boundaries. In the case where timebin is an integer, there are two cases to consider:

1. timebin is odd: In this case the target row’s data and the data from the +/-(n-1)/2 rows around the target row are also used.

2. timebin is even: In this case, the target row’s data and the data from the n/2 rows after the target row and the n/2 - 1 rows before the target row are used.

In all cases for “edge” rows, the timebin extends from the edge of the block to the corresponding timebin value of rows away from the edge, so that the timebin is not symmetrical around the target rows, but includes the number of rows specified by the timebin value.

Overriding Default Block Boundaries

Rows with the same baselines and data description IDs which are included in that window are used for determining the weight of that row. The boundaries of the time block to which the window is restricted are determined by changes in FIELD_ID, ARRAY_ID, and SCAN_NUMBER. One can override this behavior for FIELD_ID and/or SCAN_NUMBER by specifying the combine parameter (see below). Unlike the time block processing algorithm, this sliding time window algorithm requires that details of all rows for the time window in question are kept in memory, and thus the sliding window algorithm in general and the block processing row when timebin is an int, requires more memory than the block processing method when timebin is a quantity. Also, unlike the block processing method which computes a single value for all weights within a single bin, the sliding window method requires that each row (along with each channel and correlation bin) be processed individually, so in general the sliding window method will take longer than the block processing method.

Channel Binning

The width of channel bins is specified via the chanbin parameter. Channel binning occurs within individual spectral windows; bins never span multiple spectral windows. Each channel will be included in exactly one bin. The default value ‘spw’ indicates that all channels in each spectral window are to be included in a single bin.

Any other string value is interpreted as a quantity, and so should have frequency units, e.g., “1MHz”. In this case, the channel frequencies from the CHAN_FREQ column of the SPECTRAL_WINDOW subtable of the MS are used to determine the bins. The first bin starts at the channel frequency of the 0th channel in the spectral window. Channels with frequencies that differ by less than the value specified by the chanbin parameter are included in this bin. The next bin starts at the frequency of the first channel outside the first bin, and the process is repeated until all channels have been binned.

If specified as an integer, the value is interpreted as the number of channels to include in each bin. The final bin in the spectral window may not necessarily contain this number of channels. For example, if a spectral window has 15 channels, and chanbin is specified to be 6, then channels 0-5 will comprise the first bin, channels 6-11 the second, and channels 12-14 the third, so that only three channels will comprise the final bin.

Minimum required number of visibilities

The minsamp parameter allows the user to specify the minimum number of unflagged visibilities that must be present in a sample for that sample’s weight to be computed. If a sample has less than this number of unflagged points, the associated weights of all the points in the sample are set to zero, and all the points in the sample are flagged.

Warning

WARNING: Since statwt treats each baseline separately, selecting only a single channel in a spectral window will not satisfy the minimum number of samples (minsamp) if statwt is run with default parameters, leading to all the data in that spectral window being flagged. For such data, the user will need to change the default parameters in order to aggregate enough samples to satisfy minsamp (e.g., by setting combine=’corr’ if there are multiple correlation products, or timebin>1).

Aggregating data across boundaries

By default, data are not aggregated across changes in values in the columns ARRAY_ID, SCAN_NUMBER, STATE_ID, FIELD_ID, and DATA_DESC_ID. One can override this behavior for SCAN_NUMBER, STATE_ID, and FIELD_ID by specifying the combine parameter. For example, specifying combine=”scan” will ignore scan boundaries when aggregating data. Specifying combine=”field, scan” will ignore both scan and field boundaries when aggregating data. Also by default, data for separate correlations are aggregated separately. Data for all correlations within each spectral window can be aggregated together by specifying “corr” in the combine parameter. Any combination and permutation of “scan”, “field”, “state”, and “corr” are supported by the combine parameter. Other values will be silently ignored.

Statistics algorithms

The supported statistics algorithms are described in detail in the imstat and ia.statistics() help. For the current application, these algorithms are used to compute vr and vi (see above), such that the set of the real parts of the visibilities and the set of the imaginary parts of the visibilities are treated as independent data sets. Care should be taken not to tune these algorithms in a way that will discard significant portions of the tails of the underlying noise distribution (e.g., fence < 2 for the ‘HINGES-FENCES’ algorithm).

Range of acceptable weights

The wtrange parameter allows one to specify the acceptable range (inclusive, except for zero) for weights. Data with weights computed to be outside this range will be flagged. If not specified (empty array), all weights are considered to be acceptable. If specified, the array must contain exactly two non-negative numeric values. Note that data with weights of zero are always flagged. The units of the wtrange parameter will always match that of the WEIGHT column, even if the task is modifying the SIGMA column.

Including/excluding channels

Channels can be included in the computation of the weights by specifying the fitspw parameter. This parameter accepts a valid MS channel selection string. Data associated with the selected channels will be used in computing the weights; all other channels will be excluded from the computation of weights. By default (empty string), all channels are included. If the Boolean excludechans parameter is set to True, the channel selection will be inverted and exclude the selection made in fitspw.

Warning

CAUTION: Use of fitspw, when chanbin is not ‘spw’, may lead to the excluded channels being flagged for having less than the minimum number of samples (minsamp).

Preview mode

By setting preview=True, the application is run in preview mode. In this mode, no data in the input MS are changed, although the amount of data that the application would have flagged is reported.

DATA column

The datacolumn parameter can be specified to indicate which data column should be used for computing the weights. The values “corrected” for the CORRECTED_DATA column and “data” for the DATA column are supported (minimum match, case insensitive). One may specify ‘residual’ in which case the values used are the result of the CORRECTED_DATA column minus the model, or ‘residual_data’ in which case the values used are the DATA column minus the model, where model is the MODEL_DATA column if it exists, or if it doesn’t, the virtual source model if one exists, or if that doesn’t, then no model is used and the ‘residual’ and ‘residual_data’ cases are equivalent to the ‘corrected’ and ‘data’ cases, respectively. The last two options are to allow for operation on timescales or frequency ranges which are larger than that over which the sky signal is expected to be constant. This situation arises in e.g., OTF mapping, and also perhaps with sources with significant spectral structure. In cases where a necessary column doesn’t exist, an exception will be thrown and no data will be changed.

Note

NOTE: It is the user’s responsibility to ensure that a model has been set for all selected fields before using datacolumn=’residual’ or ‘residual_data’.

Return value

In all cases, the mean and variance of the set of all weights computed by the application is reported and returned in a dictionary with keys ‘mean’ and ‘variance’. Weights for which there are corresponding flags (=True) prior to running the application are excluded from the computation of these statistics. If the WEIGHT_SPECTRUM values are available, they are used to compute the statistics, otherwise, the WEIGHT values are used. The returned statistics are always computed using the ‘CLASSIC’ algorithm; the value of statalg has no impact on how they are computed. The units of the the returned statistics will always match that of the WEIGHT column, even if the task is modifying the SIGMA column.

Other considerations

Flagged values are not used in computing the weights, although the associated weights of these values are updated. If the variance for a set of data is 0, all associated flags for that data are set to True, and the corresponding weights are set to 0.

Examples

Update the weights of a MS as in the statwt task. All channels in a SPW will receive equal weight:

statwt("my.ms")

Update the weights of a MS, using a calculation that disregards visibilities in spectral window 2 between channels 7 and 16. All channels in a SPW will receive equal weight, even those disregarded in the calculation:

statwt("my.ms", fitspw='2:7~16’, excludechans=True)

Update the weights of a MS using an algorithm robust to outliers. All channels in a SPW will receive equal weight:

statwt("my.ms", statalg='chauvenet')

Update the weights of a MS using time binning of 300s. All channels in a SPW will receive equal weight, and all times within a timebin will receive equal weight:

statwt("my.ms", timebin="300s")

Update the weights of a MS using time binning of 10 integrations. Each channel and integration will receive a unique weight. The weight calculation will consider all visibilities within the time bin:

statwt("my.ms", timebin=10, slidetimebin=True, chanbin=1)

Calculate, but do not update the weights of spectral window 3 of a MS. Return statistics which summarize the calculated weights as a dictionary:

weight_stats = statwt("my.ms", preview=True, spw='3')

Development

Parameter Details

Detailed descriptions of each function parameter

vis (string) - Name of measurement set
selectdata (bool=True) - Enable data selection parameters
field (string='') - Selection based on field names or field index numbers. Default is all.
spw (string='') - Selection based on spectral windows:channels. Default is all.
intent (string='') - Selection based on intents. Default is all.
array (string='') - Selection based on array IDs. Default is all.
observation (string='') - Selection based on observation IDs. Default is all.
scan (string='') - Select data by scan numbers.
combine (string='') - Ignore changes in these columns (scan, field, and/or state) when aggregating samples to compute weights. The value “corr” is also supported to aggregate samples across correlations.
timebin ({string, int}='1') - Length for binning in time to determine statistics. Can either be integer to be multiplied by the representative integration time, a quantity (string) in time units
slidetimebin (bool=False) - Use a sliding window for time binning, as opposed to time block processing?
chanbin ({string, int}='spw') - Channel bin width for computing weights. Can either be integer, in which case it is interpreted as number of channels to include in each bin, or a string “spw” or quantity with frequency units.
minsamp (int=2) - Minimum number of unflagged visibilities required for computing weights in a sample. Must be >= 2.
statalg (string='classic') - Statistics algorithm to use for computing variances. Supported values are “chauvenet”, “classic”, “fit-half”, and “hinges-fences”. Minimum match is supported, although the full string must be specified for the subparameters to appear in the inputs list.
fence (double=-1) - Fence value for statalg=”hinges-fences”. A negative value means use the entire data set (ie default to the “classic” algorithm). Ignored if statalg is not “hinges-fences”.
center (string='mean') - Center to use for statalg=”fit-half”. Valid choices are “mean”, “median”, and “zero”. Ignored if statalg is not “fit-half”.
lside (bool=True) - For statalg=”fit-half”, real data are <=; center? If false, real data are >= center. Ignored if statalg is not “fit-half”.
zscore (double=-1) - For statalg=”chauvenet”, this is the target maximum number of standard deviations data may have to be included. If negative, use Chauvenet's criterion. Ignored if statalg is not “chauvenet”.
maxiter (int=-1) - For statalg=”chauvenet”, this is the maximum number of iterations to attempt. Iterating will stop when either this limit is reached, or the zscore criterion is met. If negative, iterate until the zscore criterion is met. Ignored if statalg is not “chauvenet”.
fitspw (string='') - Channels to include in the computation of weights. Specified as an MS select channel selection string.
excludechans (bool=False) - If True: invert the channel selection in fitspw and exclude the fitspw selection from the computation of the weights.
wtrange (doubleArray=['']) - Range of acceptable weights. Data with weights outside this range will be flagged. Empty array (default) means all weights are good.
flagbackup (bool=True) - Back up the state of flags before the run?
preview (bool=False) - Preview mode. If True, no data is changed, although the amount of data that would have been flagged is reported.
datacolumn (string='corrected') - Data column to use to compute weights. Supported values are “data”, “corrected”, “residual”, and “residual_data” (case insensitive, minimum match supported).


text:
Training Site

# Tim Jhomas Returns

Input: Standard Input (stdin)
Output: Standard Output (stdout)
Memory limit: 256 megabytes
Time limit: 2.0 seconds

Tim Jhomas, world-famous secret spy, has infiltrated the sinister K.A.O.S. organization with his network of spies.

There are $N$ spies in his network, numbered from $0$ to $N-1$. Tim Jhomas is spy number $0$. Every spy, including Tim Jhomas, has established a two-way connection with one or more other spies. Each spy also has a secret transmitter that can be used once per day - they can use this to send the secret message to one of the spies they have a connection with. Every day, Tim Jhomas wants to pass a secret message around the network to as many spies as possible. Tim starts off by transmitting the message to one of the spies he has a connection with, who can then transmit it along to another spy, and so on.

The connections have been set up so that it's possible for Tim to get the message to any other spy, although not necessarily possible for Tim to get the message to all spies. Additionally, there are a total of $N-1$ two-way connections in the network. In other words, the connections form a tree.

Tim also wants the message he sends to end up back at himself, so he know the spies have received it. For this reason, every day Tim will choose two spies to add a temporary two-way connection between. The connection is destroyed at the end of the day. If Tim chooses the connection carefully, he can allow the message to be received by the maximum number of spies before being sent back to himself.

However, the sinister K.A.O.S. organization is starting to compromise some of Tim's spies. Every day, for $D$ days, one of his spies gets compromised and becomes permanently unable to send and receive messages. Tim Jhomas will never get compromised because he's too good of a spy. For each day, what is the maximum number of spies in the network (including Tim) that can receive that day's message?

## Input

The first line contains two space-separated integers, $N$ and $D$.
$N-1$ lines follow. The $i$-th line contains two space-separated integers, $a_i$ and $b_i$, stating that there is a two-way connection between the spies $a_i$ and $b_i$. It is guaranteed that the same connection does not appear twice in the input.
$D$ lines follow. The $j$-th line contains a single integer $k$, stating that spy $k$ was compromised permanently on day $j$. No spy that has already been compromised will be compromised again.

## Output

First output a single line, containing the maximum number of spies that can receive the message on the 0-th day (i.e. before any spies have been compromised). Then, for each of the $D$ days, output a single line containing the maximum number of spies that can receive the message on that day (i.e. after a spy has been compromised that day).

## Constraints

• $2 \le N \le 50,000$
• $0 \le D \le 50,000$ and $D \le N-2$
• $0 \le a_i,b_i \lt N$ for all $i$
• $1 \le k \lt N$ for all days
• On any day it is always possible for Tim to send a message to at least one other spy.

• Subtask 1 (+15%): $a_i = i$ and $b_i = i+1$ for all connections. In other words, the network of spies forms a line with connections between 0 and 1, 1 and 2, 2 and 3 etc.
• Subtask 2 (+15%): $D = 0$.
• Subtask 3 (+20%): $N <= 1000$, $D <= 1000$.
• Subtask 4 (+25%): There is only one spy that has a two-way connection with Tim Jhomas.
• Subtask 5 (+25%): No further constraints apply.

## Sample Explanations

### Sample 1

Before any spies have been compromised, Tim can create a temporary connection between spies 3 and 4. He can then send the message to spy 3, who sends it to spy 4 over the temporary connection, who sends it to spy 1, who then sends it back to spy 0 (Tim). Therefore, a total of 4 spies (including Tim) have received the message.
On the first day spy 2 is compromised. Tim can still use the same strategy as on Day 0 to get the message to 4 spies total.
On the second day spy 4 is also compromised, so he needs to change his strategy. Tim can create a temporary connection between spies 1 and 3. He can then send the message to spy 1, who sends it to spy 3, who sends it back to him. Thus a total of 3 spies can receive the message.

### Sample 2

In this explanation $\rightarrow$ means a standard message, $\Rightarrow$ means a temporary connection was used.
Before any spies have been compromised, we can get up to 6 spies by sending the message from $0 \rightarrow 2 \rightarrow 5 \rightarrow 3 \Rightarrow 6 \rightarrow 1 \rightarrow 0$
After spy 5 gets compromised, we can only get up to 5 spies by sending the message from $0 \rightarrow 2 \rightarrow 4 \Rightarrow 6 \rightarrow 1 \rightarrow 0$
After spy 6 gets compromised, we can only get up to 4 spies by sending the message from $0 \rightarrow 2 \rightarrow 4 \Rightarrow 1 \rightarrow 0$
Spy 3 getting compromised doesn't affect our strategy, so 4 spies is still the best we can do
After spy 1 gets compromised, we can only get up to 4 spies by sending the message from $0 \rightarrow 2 \rightarrow 4 \Rightarrow 0$

• ### Sample Input 1

5 2
2 1
3 0
0 1
1 4
2
4

### Sample Output 1

4
4
3

• ### Sample Input 2

7 4
0 2
3 5
4 2
2 5
0 1
1 6
5
6
3
1

### Sample Output 2

6
5
4
4
3