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

 It is currently 20 Feb 2019, 19:44

GMAT Club Daily Prep

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

Customized
for You

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

Track

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

Practice
Pays

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

Events & Promotions

Events & Promotions in February
PrevNext
SuMoTuWeThFrSa
272829303112
3456789
10111213141516
17181920212223
242526272812
Open Detailed Calendar
• Free GMAT Prep Hour

February 20, 2019

February 20, 2019

08:00 PM EST

09:00 PM EST

Strategies and techniques for approaching featured GMAT topics. Wednesday, February 20th at 8 PM EST

February 21, 2019

February 21, 2019

10:00 PM PST

11:00 PM PST

Kick off your 2019 GMAT prep with a free 7-day boot camp that includes free online lessons, webinars, and a full GMAT course access. Limited for the first 99 registrants! Feb. 21st until the 27th.

The arithmetic mean of the even integers from 200 to 300

Author Message
TAGS:

Hide Tags

Senior PS Moderator
Joined: 26 Feb 2016
Posts: 3340
Location: India
GPA: 3.12
The arithmetic mean of the even integers from 200 to 300  [#permalink]

Show Tags

22 Dec 2017, 06:00
00:00

Difficulty:

35% (medium)

Question Stats:

73% (01:27) correct 27% (02:04) wrong based on 67 sessions

HideShow timer Statistics

The arithmetic mean of the even integers from 200 to 300 (both inclusive) is greater by what number than the arithmetic mean of the odd integers in the same range?

A. -2
B. -1
C. 0
D. 1
E. 2

Source: Experts Global

_________________

You've got what it takes, but it will take everything you've got

Intern
Joined: 30 Aug 2017
Posts: 7
WE: Supply Chain Management (Other)
Re: The arithmetic mean of the even integers from 200 to 300  [#permalink]

Show Tags

22 Dec 2017, 06:33

300-200 + 1 = 101
299-201 + 1 = 99
101 - 99 = 2
Current Student
Joined: 27 May 2014
Posts: 524
GMAT 1: 730 Q49 V41
Re: The arithmetic mean of the even integers from 200 to 300  [#permalink]

Show Tags

22 Dec 2017, 06:56
2
pushpitkc wrote:
The arithmetic mean of the even integers from 200 to 300(both inclusive) is greater by what number
than the arithmetic mean of the odd integers in the same range?

A. -2
B. -1
C. 0
D. 1
E. 2

Source: Experts Global

Lets consider a smaller range:
(1) 200 to 204
even numbers: 200, 202, 204; Avg = 202
Odd numbers: 201, 203; Avg = (201+203)/2 = 202
Difference = 0

(1) 200 to 210
even numbers: 200, 202, 204, 206, 208, 210; Avg = (204+206)/2 = 205
Odd numbers: 201, 203, 205, 207, 209 Avg = (201+203+205+207+209)/5 = 205
Difference = 0

Ans: C.
_________________
examPAL Representative
Joined: 07 Dec 2017
Posts: 889
Re: The arithmetic mean of the even integers from 200 to 300  [#permalink]

Show Tags

22 Dec 2017, 06:57
Writing down the first few elements of the two sequences can help us understand what we're dealing with.
This is a Logical approach.

The even numbers between 200 to 300 are 200, 202, 204..... 296, 298, 300.
As usual for sequences on the GMAT, the difference between each two terms is constant.
So, the sum of the first and last terms (200+300) equals the sum of the second and second-last terms (202+298) and so on.
Then the average of this sequence is just (200+300)/2=250.

Similarly, the odd sequence is 201, 203, 205....295, 297, 299.
Once again, the sum of the first and last (201+299) is the same as the sum of the second and second-last (203 + 297) and so on.
Then the average of this sequence is (201+299)/2=250.

Therefore the difference between averages is 0.
_________________
Senior SC Moderator
Joined: 22 May 2016
Posts: 2489
The arithmetic mean of the even integers from 200 to 300  [#permalink]

Show Tags

22 Dec 2017, 08:54
pushpitkc wrote:
The arithmetic mean of the even integers from 200 to 300(both inclusive) is greater by what number
than the arithmetic mean of the odd integers in the same range?

A. -2
B. -1
C. 0
D. 1
E. 2

Source: Experts Global

Evenly spaced sequence

The arithmetic mean of an arithmetic sequence is
$$\frac{FirstTerm + LastTerm}{2}$$

Even integers, arithmetic mean:
$$\frac{200+300}{2} = 250$$

Odd integers, arithmetic mean:
$$\frac{201 + 299}{2} = 250$$

Difference: 0

Small sample
As posters above demonstrate, to use a small sample is often shrewd.
Yet another way to take a small sample:

Replicate the pattern of the numbers in the prompt
• begin and end with even numbers
• if you're not sure, use integers that end in the same units digit (here, 0), and
• if you're going to do all the math, choose small numbers

The arithmetic mean of the even integers from 0 to 10, inclusive
$$0, 2, 4, 6, 8, 10$$, where $$A =\frac{S}{n} = \frac{30}{6} = 5$$

Arithmetic mean of odd integers from 0 to 10, inclusive
$$1, 3, 5, 7, 9$$, where $$A=\frac{S}{n} = \frac{25}{5} = 5$$
Difference: 0

_________________

To live is the rarest thing in the world.
Most people just exist.

Oscar Wilde

The arithmetic mean of the even integers from 200 to 300   [#permalink] 22 Dec 2017, 08:54
Display posts from previous: Sort by

format: plain


text:
Finite field extension

How can one recover the coefficients of the polynomial representation of a number field element when the number field is not prime?

In the following example,

F = GF(p)
R.<x> = F[]
K.<t>  = GF(p^2, modulus=x^2 + 1)
a = K.random_element()

say the value of a obtained is 364*t + 214.

How can I read from Sage the integer values (364, 214), I need them for manipulation, I do not want the t there.

edit retag close merge delete

Sort by » oldest newest most voted
sage: P=127
sage: F = GF(P)
sage: R.<x> = F[]
sage: K.<t> = GF(P^2, modulus = x^2 + 1)
sage: a = K.random_element()
sage: a.polynomial().coeffs()
[5, 42]

more

This updates the answer by @achrzesz, as coeffs is no longer available.

The polynomial method of a number field element gives the associated polynomial. The list method of that polynomial gives its coefficients.

Beware that polynomials also have a coefficients method but by default it only gives the nonzero coefficients, so one should prefer list.

Define the number field:

sage: p = 127
sage: x = polygen(GF(p))
sage: K.<t> = GF(p^2, modulus=x^2 + 1)

Find the coefficients of some elements expressed as polynomials in the number field generator:

sage: a = 364*t + 214
sage: a
110*t + 87
sage: a.polynomial()
110*t + 87
sage: a.polynomial().list()
[87, 110]

sage: b = 16*t
sage: b
16*t
sage: b.polynomial()
16*t
sage: b.polynomial().list()
[0, 16]

sage: c = K(16)
sage: c
sage: c.polynomial()
16
sage: c.polynomial().list()
[16]

The coefficients method is error-prone:

sage: a.polynomial().coefficients()  # also works here
[87, 110]
sage: b.polynomial().coefficients()
[16]
sage: c.polynomial().coefficients()
[16]

unless one is specific about including zeros:

sage: b.polynomial().coefficients(sparse=False)
[0, 16]
sage: c.polynomial().coefficients(sparse=False)
[16]

Another option is to go through the integer representation:

sage: ZZ(a.integer_representation()).digits(base=p)
[87, 110]
sage: ZZ(b.integer_representation()).digits(base=p)
[0, 16]
sage: ZZ(c.integer_representation()).digits(base=p)
[16]

There, one can also pad with zeros so that the number of "p-adic digits" matches the degree:

sage: ZZ(c.integer_representation()).digits(base=p, padto=2)
[16, 0]

I answered the question with p = 127 as @achrzesz did, but the value of p the original poster had in mind was likely greater than 364.

When trying the above with p = 367, the integer_representation method is not available. Making it available independent of the finite field implementation is now tracked at

more


text:
# CAT Quant Questions with Video Solutions

Note: These Quant questions have been selected from 1000+ CAT Quant Practice Problems with video solutions of Bodhee Prep’s Online CAT Quant Course
Question 21:
A, B, C, D, and E are five friends. The sums of the weights of each group of four of them are 132, 138, 113, 131, and 126. What is the positive difference of the weights of the heaviest and lightest among them?
Topic: averages

[1] 25
[2] 26
[3] 27
[4] None of these

Question 22:
In the figure given below, O is the center and AB is the diameter of the circle of radius 15. From point D, two tangents DC and DB are drawn to the circle. If AC is parallel to OD and AC+OD=43, find the length of CD given CD is positive integer

Topic: circles

Question 23:
If $x+y+z=2,\ {{x}^{2}}+{{y}^{2}}+{{z}^{2}}=6,\ and\ {{x}^{3}}+{{y}^{3}}+{{z}^{3}}=8$, find the value of ${{x}^{4}}+{{y}^{4}}+{{z}^{4}}$ ?
Topic: basic algebra

[1] $8\sqrt{5}$
[2] 18
[3] $18\sqrt{3}$
[4] 16

Question 24:
Two friends Ankit and Brijesh are approaching towards each other, each one at 1 kmph. Ankit is walking with a dog, which can run at speed of 9 kmph. The dog leaves Ankit and runs towards Brijesh when Ankit and Brijesh are 10 km apart. After reaching Brijesh the dog immediately runs back to Ankit. Find the distance travelled by Ankit between the time the dog leaves him and comes back to him.
Topic: speed time and distance

[1] 1.6 km
[2] 1.8 km
[3] 1.2 km
[4] 1.4 km

Question 25:
The lines $x = \frac{1}{4}y + a$ and $y = \frac{1}{4}x + b$ intersect at the point $\left( 1,2 \right)$. What is a + b?
Topic: coordinate geometry

[1] 0
[2] $\frac{3}{4}$
[3] 1
[4] $\frac{9}{4}$

### CAT Quant Practice Sets [Video Explanations]

CAT Quant Questions Set 01
CAT Quant Questions Set 02
CAT Quant Questions Set 03
CAT Quant Questions Set 04
CAT Quant Questions Set 06

#### CAT Quant Online Course

• 1000+ Practice Problems
• Detailed Theory of Every Topics
• Online Live Sessions for Doubt Clearing
• All Problems with Video Solutions

### 8 thoughts on “CAT Quant Questions with Video Solutions”

1. MAHESH AGGARWAL says:

do you have exclusive PACKAGE OF video solutions of last 10-15 years CAT EXAMS? I AM INTERESTED IN JUST THAT. I AM HELPING A GIRL APPEARING FOR CAT 2019 EXAM

We have already included all the good questions from CAT and other MBA entrance exams in our course.
All these questions are with Video explanations

• Pavani says:

If f is 3
F(3)
6+3+2 is 11

2. Rajaraman says:

Can you tell the name of the theorem that you said in the first quetion

3. Abinash says:

Sir, for question no. 23:- we can do as x+y=2-z
=> cubing both sides:- x3+y3+z3=8-(2-z)(6z+3xy)
=>as given that x3+y3+z3=8, then (2-z)(6z+3xy)=0 => z=2(considering an integer value for easy output) ,now putting z value in every eqn given :- x+y=0
x2+y2=2
x3+y3=0
from the above three eqns we find that if one of x or y is +ve then another ll be -ve but both ll be of same magnitude i.e. (+-)1….thus x4+y4+z4=18

4. Siddharth says:

Set 1 Question 5.

I want to know the below logic would be wrong.

Distance is constant. If the Speed increases by 10km/hr, the time decreases by 4 hours.
So to decrease time by 2 hours, Speed can be increased by 5km/hr.

20 + 5= 25 kmph.

I understand something might be wrong with this logic but could someone help pinpoint that?

• shaswat says:

the assumption of “to decrease time by 2 hours, speed can be increase by 5km/hr” is wrong. it would be right if you know the initial time and consider from the start but since the journey is already going on, u can’t do that.


text:
# How are we doing?

The site approaching its 500-th question and the end of the first 90 days imminent, I thought it might be a good time to create a thread for collective discussion about the development of the site so far.

The intent here is not so much to gather ideas for activity, but rather to get a sense of how everybody sees what happened so far (which then might, as a next step, inform future activity).

What went well, what not so well?

How did your expectations of the site compare against reality: what were pleasant surprises? what is a disappointment?

And so on. All kind of feedback is solicited (with the obvious restriction that even if critical, it should still be constructive).

Questions: Most of the questions are good. Many can be edited into something good. The site needs more to thrive.

Answers: I've refrained from saying "tl;dr", but I'd enjoy more concise answers, and think they'd often be more useful.

Pleasant surprise: People talking about math education online! I didn't know how much I would enjoy it until it existed.

Disappointment: I expected an online community thinking seriously about math education to favor more reform.

Maybe it's worth collecting my ideas on curricular reform for high school and college math in one place: Less factoring, less trigonometry, less epsilons and deltas in calculus, less symbolic integration; less Galois theory; less proofs; more numerical calculations, more calculators and smartphones, more computers, more statistics, more applications. For anyone else who sympathizes, at least now I have these ideas written down.

• Sadly, discussing such (rather radical) reform ideas isn't the staple of SE... Jun 15 '14 at 3:42
• Discussion is not encouraged at SE, but carefully-phrased questions on reform issues could be acceptable, I would expect.
– J W
Jun 17 '14 at 7:42
• Thanks for the answer. Your remark on "answers" is intriguing. Personally, I am positively impressed by the effort some frequently put into their answers. But nevertheless I find your remark interesting.
– quid Mod
Jun 17 '14 at 21:43

Since this is a Q&A site, I will structure my response accordingly.

Questions:

I see that the number of visitors per day has dropped off somewhat substantially. Still, with 628 visits/day (at the time of my writing - edit: now 494; a precipitous drop...) that seems like quite a bit considering that over the past week we have had an average of about 3 questions/day (edit: converging to zero).

My sense is that the main issue right now is obtaining high-quality users. Where are they and how can we recruit them? Perhaps by identifying the locations of such potential users, current MESE participants could try their own hands at recruitment. Here are some potential locales, and, if you know math educators from these places (or others), then perhaps you could recommend they ask a question!

1. Schools, including: public schools, private schools, charter schools, parochial schools, international schools, home schools; pre-K, early elementary, primary, middle, secondary, tertiary, graduate.

Question: Can those of you who are teachers ask your colleagues to consider joining the site?

2. Bloggers. There seem to be many math educators who have their own blogs. I am not in touch with this world of Math Ed blogging, but I believe some MESE users are.

Question: Can those of you who are blogging actively or responding to / reading blog-posts or otherwise aware of blogging endeavors ask Math Education bloggers to consider joining the site or posting about it on their blogs?

3. Graduate Programs in Math/Education/Math Education. There seem to be a number of users who are currently students or professors in one of these three disciplines, and having research based answers to complement practice based answers is an important aspect of the site.

Question: Can those of you who are involved with graduate programs in Math/Education/Math Education ask your colleagues to consider joining the site?

4. Other sites, including: MO and MSE, but also reddit (e.g., /r/math, /r/matheducation), and The Mathematics Teaching Community, as well as others of which I am probably unaware.

Question: Can those of you who contribute to these sites try to use them to spread the word that MESE exists?

I think to make a real dent we would need somehow to become better known within entire institutions or perhaps even school districts. There is a definite paucity of $\leq$ secondary instructors. Meanwhile, with our answer rate hovering around 100%, and a per-day visit rate at over 200 times the rate of new questions asked, I think MESE users would welcome the challenge of trying to tackle more problems.

Can you recruit at least one math educator to pose at least one (good) question?

I'm still not sure quite how to use community wiki vs. comments vs. answers vs. no response at all. Here is my own personal feeling with a request. Rather than down-vote me if you disagree, perhaps you can post your own feelings: in a separate response, in a comment, or even by editing my answer (but please make it clear where your edit begins and ends).

My feeling is that if an answer can be fit into a comment then it should be left as one, unless it is a canonical answer. In the latter case, then I would certainly say you should post it (example of a question with an actual answer: The “water triangle” proportional reasoning task). Mostly, though, the questions here have plenty of potential answers. In my mind, if you are going to post an answer, then it should be descriptive/detailed, with either links to research (ideally with some brief summary of what you are linking to) or notes about your own personal experience (again: descriptive and detailed!).

Again, in my opinion, there are too many "answers" here that are just a couple of sentences long. If the question is good enough to stay open, then (with the exception of something like a reference request) it should be amenable to answers longer than would fit as a single comment.

Separately: I must admit I am a bit worried about the naming conventions for some of the questions. More precisely, I am concerned that some of the questions have such general names that it seems like it would not be possible to accept a single answer. Here are just five titles that have accepted answers:

1. How to handle the situation where a student insists I am wrong during the class?

2. How do I motivate my students to go to office hours?

3. Student: Why not use calculator?

4. What to do when you get “the empty stare”?

5. What to do with students who think they “already know it,” but actually don't?

Surely not one of these has a single answer that is correct. Is the "single answer" the best way to determine whether or not you give a response the green check? I'm not sure, but it feels to me like doing so suggests site users have figured out a canonical answer for extremely nebulous (yet often common) questions among math educators. Do we really know how to motivate students to go to office hours? No, we really don't. Do we have some good ideas about things to try? Yes, I think answers on that post and others provide some quality guidance.

More generally, I suppose this re-focuses on the question of when to accept an answer - a decision that I readily admit is totally up to the question poser, but, still, I think this is a consideration worthy of further discussion.


text:
# Logistic Regression¶

### Classification¶

In a classification problem a classifier (a piece of software) maps the inputs to a small and discrete set of outputs. For example, classifying incoming emails into (i) the spam folder, or (ii) the inbox folder.

In a Binary classification problem there are only two possible outputs. We can label these groups as 1 (positive class) and 0 (negative class), $y\in \{0,1\}$. For instance, a binary classification problems can be

• Email: Spam/Not Spam?
• Tumor: Malignant/Benign?

Since classification is not a linear function, using linear regression to solve a classification can be a bad choice.

### Hypothesis representation¶

We are going to use logistic regression to solve calssification problems. Logistic regression hypothesis accepts arbitrary inputs and bounds the output between zero and one, $0 \leq y \leq 1$.

The logistic regression hypothesis function is constructed by feeding a sigmoid (or logistic) function a linear model. A sigmoid function ($g(z)=\frac{1}{1+e^-z}$) has the following shape

By replacing $z$ with a linear (or polynomial) function $\theta_0 + \theta_1 x_1 + \dots$ (written in linear algebra notation as $\theta^Tx$) we construct the logistic regression hypothesis function, $$h_{\theta}(x) = \frac{1}{1+e^{-\theta^Tx}}$$

As it can bee seen from the figure and the function form above our new hypothesis takes any number of features and any input values and bounds the output between $0$ and $1$.

To turn this hypothesis function into a binary classifier we need to set a boundary and map some of the output interval to $1$ and the rest to 0. Choosing 0.5 as the boundary result in

• any positive input will be mapped to the output $1$ (positive class),
• any negative input will be mapped to the output $0$ (negrative class), and $h_{\theta}(0)$ draws the decision boundary and separates the area where $y=0$ and where $y=1$. The decision boundary itself can considered as part of the area where $y=0$ or $y=1$, here we choose to make it belong to the area where $y=1$.

### Cost Function¶

The squared error cost function, used with linear regression, results in many local minimum when applied to logistic regression. This prevents gradient descent from finding the global minimum of the cost function. Therefore, we will choose the following cost function which can be shown using maximum likelyhood theory from that it is a convex function--a bow function with a single (global) minimum.

$$J(\theta) = -\frac{1}{m} \sum_{i=1}^m[- y^{(i)} \log(h_{\theta}(x^{(i)})) + (1 - y^{(i)}) \log(1- h_{\theta}(x^{(i)}))]$$

The intuition behind choosing this cost function. Since the output $y$ is either $1$ or $0$ this cost function will be in one of the following two cases:

• case 1: where $y=0$

$$J(\theta) = -\frac{1}{m} \sum_{i=1}^m \log(1-h_{\theta}(x^{(i)}))$$

As we can see from the figure above, when $h_{\theta}(x)$ output $\approx 0$, the error $\approx 0$ also, and when the prediction of $h_{\theta}(x)$ approaches $1$ the error approaches $\infty$

• case 2: where $y=1$

$$J(\theta) = -\frac{1}{m} \sum_{i=1}^m \log(h_{\theta}(x^{(i)}))$$

Using analogous arguement we can see that, in case 2, when $h_{\theta}(x)$ output $\approx 1$, the error $\approx 0$ and when $h_{\theta}(x)$ output $\approx 0$, the error $\approx \infty$

repeat:{ \begin{equation*} \theta_j = \theta_j - \alpha \frac{\partial}{\partial \theta_j} J(\theta) \end{equation*} }.

We can work out the derivative$^1$</sup> using Calculus to get:

repeat:{ \begin{equation*} \theta_j = \theta_j - \frac{\alpha}{m} \sum^m_{i=1}(h_{\theta}(x^{(i)}) - y^{(i)} )x^{(i)}_j \end{equation*} }.

A vectorized implementation of Gradient Descent is:

$$\theta=\theta - \frac{\alpha}{m}X^T(g(X\theta) - \overrightarrow{y})$$

1. Working out the derivative can be found though this here and here

## Logistic Regression for Multi-class classification problem¶

Some examples of multi-class classification problems include

• Email tagging: tag incoming emailt with labels like 'friends', 'work', 'hobby'.
• Classifying patients with stuffy nose to fine, cold, and flu.

Using the One-vs-all method we can turn a multi-class classification prblem into a set of binary classification problems. Let us consider the email tagging problem. We need to find, using the same procedure for the binary classification problems, three hypotheses (i) one to classify friends vs the rest, (ii) one to classify work vs the rest, and (iii) the last one to classify hobby vs the rest. Any testing input is fed to the three classifiers (hypotheses). The hypothesis that produces the highest output value (as the output of a logistic regression funciton is bounded between 1 and 0) classify the input to its group.

## Regularization¶

Overfitting refers to the problem of generating too complex hypothesis funciton that fits the training data very well, but it does not generalize for new testing data becuase the hypothesis line is very wavy.

TODO use figures to explain

This terminology is applied to both linear and logistic regression. There are two main options to address the issue of overfitting problem:

1) Reduce the number of features:

• Manually select which features to keep.
• Use a model selection algorithm (studied later in the course).

2) Regularization

• Keep all the features, but reduce the magnitude of parameters $\theta_j$.
• Small values of $\theta$ leads to simpler hypothesis which is, in turn, less prone to overfitting.
• Regularization works well when we have a lot of slightly useful features.

### Regularized cost function $$J(\theta) = \frac{1}{2m} \bigg[\sum_{i=1}^m cost(h_{\theta}(x)-y) + \lambda \sum_{j=1}^n\theta^2_j \bigg]$$ where $cost(h_{\theta}(x)-y)$ can be the part of cost function of linear regression or logistic regression. $\lambda$ is the regularization parameter that controls $\theta$ adaptation.

In this section, we show how to use more advanced optimization algorithms like Conjugate gradient, BFGS, and L-BFGS. Octave( or Matlab) provides well developed implementations of these algorithms. These algorithms requires a function that compute the cost function and its partial derivatives. Consider the following example to see how to apply these algorithms.

Example:

Minimize the following cost function $J(\theta)=(\theta_1-5)^2 + (\theta_2-5)^2$ over $\theta=\begin{bmatrix} \theta_1 \\ \theta_2 \end{bmatrix}$, ($\displaystyle \min_{\theta} J(\theta)$).

To use the advanced optimization algorithms we need to follow the following procedures:

1) write a function that takes $\theta$ and returns the value of the cost function and its partial derivatives at the given $\theta$.

function [Jval, gradient] =  costFunction(theta)
Jval =  (theta(1) - 5)^2 + (theta(2) -5)^2;
gradient(1) = 2 * (theta(1) - 5);
gradient(2) = 2 * (theta(2) - 5);

2) Set the maximum number of iterations, the initial $\theta$ values and enable the gradient optimization.

options = optimset('GradObj', 'on', 'MaxIter', '100');
initialTheta = zeros(2,1)

3) Call fminunc (stands for function minimization unconstained). @costFunction is a poiner to the costFunction() function.

[optTheta, functionVal, exitFlag]=fminunc(@costFunction, initialTheta, options);

In [12]:
## Plotting the sigmoid function
import math as m
import matplotlib.pyplot as plt
import numpy as np

%matplotlib inline

y=[]
x=np.arange(-10,10,0.2)
for i in x:
y.append(1/(1+m.exp(-i)))

plt.figure(figsize=(8,3))
plt.plot(x,y)
plt.grid()
plt.savefig('sigmoid.png')

In [24]:
## Plotting the log functions
import math as m
import matplotlib.pyplot as plt
import numpy as np

%matplotlib inline

y=[]
x=np.arange(0.01,1,0.01)
for i in x:
y.append(-m.log(i))

plt.figure(figsize=(8,5))
plt.plot(x,y)
plt.grid()
plt.xlabel(r'$h_{\theta}(x)$', fontsize=20)
plt.savefig('minusLog.png')

In [25]:
## Plotting the log functions
import math as m
import matplotlib.pyplot as plt
import numpy as np

%matplotlib inline

y=[]
x=np.arange(0,1,0.01)
for i in x:
y.append(-m.log(1-i))

plt.figure(figsize=(8,5))
plt.plot(x,y)
plt.grid()
plt.xlabel(r'$h_{\theta}(x)$', fontsize=20)
plt.savefig('oneMinusLog.png')


text:
# Forward azimuthal correlations in 200 GeV p+p and d+Au collisions at STAR

@inproceedings{Li2012ForwardAC,
title={Forward azimuthal correlations in 200 GeV p+p and d+Au collisions at STAR},
author={Xuan You Li and The Star Collaboration},
year={2012}
}
Forward particle production and correlation measurements at RHIC can probe low-$x$ gluons. The suppression observed in back-to-back forward $\pi^{0}$+forward $\pi^{0}$ correlations at STAR in central d+Au collisions at STAR is consistent with a prediction of the Color Glass Condensate (CGC) calculation, indicating the gold nucleus probed at such low-$x$ is in a dense gluon state. The forward $\pi^{0}$ + near-forward jet-like cluster azimuthal correlations in 200 GeV p+p and d+Au collisions at… CONTINUE READING


text:
111 views

### How to evaluate only arguments, but leave topmost expression unevaluated? [duplicate]

I want to represent expressions mostly in unevaluated form, but being able to evaluate it's subparts. For example, how to evaluate only arguments, but leave topmost expression unevaluated? For ...
52k views

### Where can I find examples of good Mathematica programming practice?

I consider myself a pretty good Mathematica programmer, but I'm always looking out for ways to either improve my way of doing things in Mathematica, or to see if there's something nifty that I haven't ...
2k views

### How to apply or map a list of functions to a list of data?

Say I have a group of functions: f1[a_] := a * -1; f2[a_] := a * 100; f3[a_] := a / 10.0; and some data in a list: ...
971 views

### How do you check if there are any equal arguments(even sublist) in a list?

I would like to set up a function which has to return True if at least two arguments of a given List are equal. So if I give {1,4,6,2} to the function it has to ...
1k views

### Compiling more functions that don't call MainEvaluate

I would like to use Compile with functions defined outside Compile. For example if I have the two basic functions F and G F[x_] := x + 2 G[x_] := x And I want ...
603 views

### Elegantly split a matrix into positive and negative parts?

I have a matrix $M$ of real components, and I want to split it into two matrices $M^+$ and $M^-$ of the same dimensions as $M$, where $M^+$ contains the positive components of $M$ (the remaining ...
510 views

### Convert head Times to List

I can convert an expression with the head of Times,for example, 12*12.5*13*13.5*14*14.5 to {12, 12.5, 13, 13.5, 14, 14.5} by ...
452 views

### Implementing a safe ValueQ that does not evaluate its argument

Mathematica has a built-in function ValueQ. Quoting the docs, ValueQ[expr] gives True if ...
396 views

### Is it possible to define new PlotTheme?

In version 10 one can define, say, \$PlotTheme = "Scientific" Which changes the appearance of all plots. This is fantastic because on the one hand, I can have ...
471 views

### How to access new colour schemes in version 10?

Many colour schemes and colour functions can be accessed using ColorData. Version 10 introduced new default colour schemes, and a new customization option using ...
607 views

### Extract function arguments

Is there a way to extract the arguments of a function? Consider the following example: I have this sum ...
471 views

### Join lists in a list of lists

What's the best way to join two consecutive lists in a list of lists ? For example if I have the list x = {{1}, {2}, {3}, {4}} and I want to get in x ...
471 views

### Threading a compiled function over multiple arguments of different lengths

I am interested in threading a compiled function over multiple argument lists of different lengths. I will explain this in two steps: Suppose f is some function. Then one can define another ...


text:
# gauss.hermite

0th

Percentile

##### Gauss-Hermite Quadrature Approximation to Expectation for Normal Distribution

Calculates an approximation to the expected value of any function of a normally-distributed random variable, using Gauss-Hermite quadrature.

Keywords
math
##### Usage
gauss.hermite(f, mu = 0, sd = 1, ..., order = 5)
##### Arguments
f

The function whose moment should be approximated.

mu

Mean of the normal distribution.

sd

Standard deviation of the normal distribution.

Additional arguments passed to f.

order

Number of quadrature points in the Gauss-Hermite quadrature approximation. A small positive integer.

##### Details

This algorithm calculates the approximate expected value of f(Z) when Z is a normally-distributed random variable with mean mu and standard deviation sd. The expected value is an integral with respect to the Gaussian density; this integral is approximated using Gauss-Hermite quadrature.

The argument f should be a function in the R language whose first argument is the variable Z. Additional arguments may be passed through …. The value returned by f may be a single numeric value, a vector, or a matrix. The values returned by f for different values of Z must have compatible dimensions.

The result is a weighted average of several values of f.

##### Value

Numeric value, vector or matrix.

##### Aliases
• gauss.hermite
##### Examples
# NOT RUN {
gauss.hermite(function(x) x^2, 3, 1)
# }

Documentation reproduced from package spatstat, version 1.63-0, License: GPL (>= 2)

### Community examples

Looks like there are no examples yet.


text:
## Access

You are not currently logged in.

Access JSTOR through your library or other institution:

## If You Use a Screen Reader

This content is available through Read Online (Free) program, which relies on page scans. Since scans are not currently available to screen readers, please contact JSTOR User Support for access. We'll provide a PDF copy for your screen reader.

# Pollen Production by Pinus taeda Growing in Elevated Atmospheric CO2

S. L. Ladeau and J. S. Clark
Functional Ecology
Vol. 20, No. 3 (Jun., 2006), pp. 541-547
Stable URL: http://www.jstor.org/stable/3806546
Page Count: 7
Preview not available

## Abstract

1. Rising concentrations of atmospheric CO2 may have important consequences for reproductive allocation in forest trees. Changes in pollen production could influence population dynamics and is likely to have important consequences for human health. This is the first study to evaluate pollen production by forest trees in response to rising atmospheric CO2. 2. Our research objective was to quantify pollen production by Loblolly Pine (Pinus taeda L.) trees growing in elevated CO2 (ambient + $200 \mu l l^{-1}$) since 1996. 3. Trees grown in $high-CO_2$ plots first began producing pollen while younger and at smaller sizes relative to ambient-grown trees. Pollen cone and airborne pollen grain abundances were significantly greater in the fumigated stands. We conclude that the greater number of mature trees in $high-CO_2$ plots resulted in greater pollen production at the stand level. 4. Precocious pollen production has important implications for fertilization and pollen dispersal from young, dense stands. Increasing levels of airborne pollen raise concerns for escalating rates of human respiratory disease.

• 541
• 542
• 543
• 544
• 545
• 546
• 547


text:
# Isomorphism with Directional Graphs

I was told isomorphism was when two graphs are the same but have different forms. In order for it to be the same two vertices must be adjacent across the graphs. So if vertex1 is adjacent to vertex2 and vertex3 in one graph, than it must do so in the other. Also that isomorphism can easily be applied to other varietys of graphs.

The simple graphs $G1 = (V_1, E_1)$ and $G2 = (V_2, E_2)$ are isomorphic if there exists a one-to-one and onto function $f:V_1\to V_2$ with the property that $a$ and $b$ are adjacent in $G_1$ if and only if $f(a)$ and $f(b)$ are adjacent in $G_2$, for all $a$ and $b$ in $V_1$. Such a function $f$ is called an isomorphism. ∗ Two simple graphs that are not isomorphic are called nonisomorphic.

Are these two graphs isomorphic? They retain the same shape, but the direction of the edge from vertex1 to vertex4 changes between the two, so it cant be isomorphic, right? Well, I was told it was without an explanation. Are they wrong, or am I missing something? Any help would be appreciated.

In the original graph, vertices have following degrees.

$1$ — $2$ outs, $1$ in.

$2$ — $1$ out, $2$ ins.

$3$ — $2$ outs, $1$ in.

$4$ — $1$ out, $2$ ins.

Let's give the names to the vertices of the second graph:

Here's their degrees:

$A$ — $1$ out, $2$ ins.

$B$ — $2$ outs, $1$ in.

$C$ — $2$ outs, $1$ in.

$D$ — $1$ out, $2$ ins.

Let's try to assign numbers to the letters. For vertex $A$, we have only two options: either $A$ is $2$ or $4$.

Suppose $A$ is $2$. Then $D$ can only be $4$ (can you see why?) and $C$ is $3$. Then $B$ is $1$, which it absolutely can be, since it has the same degree and is adjacent to the same vertices. By showing the isomorphism, we effectively prove its existence.

So the error was here:

They retain the same shape, but the direction of the edge from vertex1 to vertex4 changes between the two, so it cant be isomorphic

On the second graph, there are no named vertices, so you can't just say that the direction between some named vertices changed. You need to have a more rigorous method of proving that, and often the one I've described above will suffice.

• I'm a fool, I can't believe I didn't see it this way first. I understand it now, I appreciate the help. – pudge Nov 10 '16 at 19:51


text:
# Geometry

## Transpose

The transpose of a matrix $$M$$ is another matrix that we write using the following convention: $$M^T$$ (with the superscript T). We can describe the process of transposing a matrix in different ways. It can be seen as reflecting $$M$$ over its main diagonal (from left to right, top to bottom) to obtain $$M^T$$, writing the rows of $$M$$ as the columns of $$M^T$$ or reciprocally, writing the columns of $$M$$ as the rows of $$M^T$$. Computing the transpose of a matrix can be done with the following code:

Matrix44 transpose() const
{
Matrix44 transpMat;
for (uint8_t i = 0; i < 4; ++i) {
for (uint8_t j = 0; j < 4; ++j) {
transpMat[i][j] = m[j][i];
}
}

return transpMat;
}

The idea is to swap the rows and columns, and since this operation can't be done in place, we need to assign the result to a new matrix returned by the function. Transposing matrices can be helpful when you want to convert matrices from a 3D application using row-major matrices to another using a column-major convention (and vice versa).

## Inverse

If multiplying point A by the Matrix M gives point B, multiplying point B by the inverse of the matrix M gives point A. In mathematics, a matrix inversion is usually written using the following notation:

$$M^{-1}$$

From this observation, we can write that:

$$MM^{-1}=I$$

Where I is the identity matrix, multiplying a matrix by its inverse gives the identity matrix.

In the chapter How Does a Matrix Work, we have mentioned the case of the orthogonal matrix, which inverse can easily be obtained from computing its transpose. An orthogonal matrix is a square matrix with real entries whose columns and rows are orthogonal unit vectors. We will use this critical property to learn how to transform normals.

Matrix inversion is an essential process in 3D. We can use point- or vector-matrix multiplication to convert points and vectors. Still, moving the transformed points or vectors back into the coordinate system they were initially defined is sometimes helpful. For example, it is often necessary to transform the ray direction and origin in object space to test for a primitive-ray intersection. If there is an intersection, the resulting hit point is in object space and needs to be converted back into world space to be usable.

The lesson Matrix Inverse will teach how to calculate the inverse of a matrix (only available in the old version of Scratchapixel for now). Developing even a basic renderer without being able to use matrices and their inverse would be limited, so we will be providing some code in this lesson for doing so. You can use this code without worrying too much about how it works and read this advanced lesson another time if you need more time to feel ready.

## Determinant of a Matrix

This part of the lesson will be written later.


text:
## Algebra 1

$x=\frac{p}{m+n}$
We are trying to isolate the variable $x$ in the equation $mx+nx=p$ To do this, first we will factor out the $x$ using the distributive property: $x(m+n)=p$ Then, we will divide by $m+n$ to isolate $x$: $x=\frac{p}{m+n}$


text:
# Introduction to Power Series

## Key Questions

• Taylor Series centered at c

f(x)=sum_{n=0}^infty {f^{(n)}(c)}/{n!}(x-c)^n

I hope that this was helpful.

• Useful Maclaurin Series

$\frac{1}{1 - x} = {\sum}_{n = 0}^{\infty} {x}^{n}$

e^x=sum_{n=0}^infty{x^n}/{n!}

sinx=sum_{n=0}^infty(-1)^n{x^{2n+1}}/{(2n+1)!}

cosx=sum_{n=0}^infty(-1)^n{x^{2n}}/{(2n)!}#

I hope that this was helpful.

• You can thing of a power series as a polynomial function of infinite degree since it looks like this:

${\sum}_{n = 0}^{\infty} {a}_{n} {x}^{n} = {a}_{0} + {a}_{1} x + {a}_{2} {x}^{2} + {a}_{3} {x}^{3} + \cdots$

I hope that this was sufficient.


text:
## Upper bounds on Weight Hierarchies of Extremal Non-Chain Codes

#### Abstract

The weight hierarchy of a linear $[n,k;q]$ code \code\ over \GF\ is the sequence $(d_1,d_2,\ldots,d_k)$ where $d_r$ is the smallest support size of an $r$-dimensional subcode of \code. The difference sequence \DS\ is defined by $\delta_i=d_{k-i}-d_{k-i-1}$. An $[n,k;q]$ code is extremal non-chain if for any $r$ and $s$, where \$1\le rWe give upper bounds on difference sequences of such codes, give some general results about codes meeting these bounds with equality, and finally construct five-dimensional codes meeting the bounds with equality.


text:
Text Summarization with NLTK in Python

# Text Summarization with NLTK in Python

### Introduction

As I write this article, 1,907,223,370 websites are active on the internet and 2,722,460 emails are being sent per second. This is an unbelievably huge amount of data. It is impossible for a user to get insights from such huge volumes of data. Furthermore, a large portion of this data is either redundant or doesn't contain much useful information. The most efficient way to get access to the most important parts of the data, without having to sift through redundant and insignificant data, is to summarize the data in a way that it contains non-redundant and useful information only. The data can be in any form such as audio, video, images, and text. In this article, we will see how we can use automatic text summarization techniques to summarize text data.

Text summarization is a subdomain of Natural Language Processing (NLP) that deals with extracting summaries from huge chunks of texts. There are two main types of techniques used for text summarization: NLP-based techniques and deep learning-based techniques. In this article, we will see a simple NLP-based technique for text summarization. We will not use any machine learning library in this article. Rather we will simply use Python's NLTK library for summarizing Wikipedia articles.

### Text Summarization Steps

I will explain the steps involved in text summarization using NLP techniques with the help of an example.

The following is a paragraph from one of the famous speeches by Denzel Washington at the 48th NAACP Image Awards:

So, keep working. Keep striving. Never give up. Fall down seven times, get up eight. Ease is a greater threat to progress than hardship. Ease is a greater threat to progress than hardship. So, keep moving, keep growing, keep learning. See you at work.

We can see from the paragraph above that he is basically motivating others to work hard and never give up. To summarize the above paragraph using NLP-based techniques we need to follow a set of steps, which will be described in the following sections.

#### Convert Paragraphs to Sentences

We first need to convert the whole paragraph into sentences. The most common way of converting paragraphs to sentences is to split the paragraph whenever a period is encountered. So if we split the paragraph under discussion into sentences, we get the following sentences:

1. So, keep working
2. Keep striving
3. Never give up
4. Fall down seven times, get up eight
5. Ease is a greater threat to progress than hardship
6. Ease is a greater threat to progress than hardship
7. So, keep moving, keep growing, keep learning
8. See you at work

#### Text Preprocessing

After converting paragraph to sentences, we need to remove all the special characters, stop words and numbers from all the sentences. After preprocessing, we get the following sentences:

1. keep working
2. keep striving
3. never give
4. fall seven time get eight
5. ease greater threat progress hardship
6. ease greater threat progress hardship
7. keep moving keep growing keep learning
8. see work

#### Tokenizing the Sentences

We need to tokenize all the sentences to get all the words that exist in the sentences. After tokenizing the sentences, we get list of following words:

['keep',
'working',
'keep',
'striving',
'never',
'give',
'fall',
'seven',
'time',
'get',
'eight',
'ease',
'greater',
'threat',
'progress',
'hardship',
'ease',
'greater',
'threat',
'progress',
'hardship',
'keep',
'moving',
'keep',
'growing',
'keep',
'learning',
'see',
'work']

#### Find Weighted Frequency of Occurrence

Next we need to find the weighted frequency of occurrences of all the words. We can find the weighted frequency of each word by dividing its frequency by the frequency of the most occurring word. The following table contains the weighted frequencies for each word:

Word Frequency Weighted Frequency
ease 2 0.40
eight 1 0.20
fall 1 0.20
get 1 0.20
give 1 0.20
greater 2 0.40
growing 1 0.20
hardship 2 0.40
keep 5 1.00
learning 1 0.20
moving 1 0.20
never 1 0.20
progress 2 0.40
see 1 0.20
seven 1 0.20
striving 1 0.20
threat 2 0.40
time 1 0.20
work 1 0.20
working 1 0.20

Since the word "keep" has the highest frequency of 5, therefore the weighted frequency of all the words have been calculated by dividing their number of occurances by 5.

#### Replace Words by Weighted Frequency in Original Sentences

The final step is to plug the weighted frequency in place of the corresponding words in original sentences and finding their sum. It is important to mention that weighted frequency for the words removed during preprocessing (stop words, punctuation, digits etc.) will be zero and therefore is not required to be added, as mentioned below:

Sentence Sum of Weighted Frequencies
So, keep working 1 + 0.20 = 1.20
Keep striving 1 + 0.20 = 1.20
Never give up 0.20 + 0.20 = 0.40
Fall down seven times, get up eight 0.20 + 0.20 + 0.20 + 0.20 + 0.20 = 1.0
Ease is a greater threat to progress than hardship 0.40 + 0.40 + 0.40 + 0.40 + 0.40 = 2.0
Ease is a greater threat to progress than hardship 0.40 + 0.40 + 0.40 + 0.40 + 0.40 = 2.0
So, keep moving, keep growing, keep learning 1 + 0.20 + 1 + 0.20 + 1 + 0.20 = 3.60
See you at work 0.20 + 0.20 = 0.40

#### Sort Sentences in Descending Order of Sum

The final step is to sort the sentences in inverse order of their sum. The sentences with highest frequencies summarize the text. For instance, look at the sentence with the highest sum of weighted frequencies:

So, keep moving, keep growing, keep learning

You can easily judge that what the paragraph is all about. Similarly, you can add the sentence with the second highest sum of weighted frequencies to have a more informative summary. Take a look at the following sentences:

So, keep moving, keep growing, keep learning. Ease is a greater threat to progress than hardship.

These two sentences give a pretty good summarization of what was said in the paragraph.

### Summarizing Wikipedia Articles

Now we know how the process of text summarization works using a very simple NLP technique. In this section, we will use Python's NLTK library to summarize a Wikipedia article.

#### Fetching Articles from Wikipedia

Before we could summarize Wikipedia articles, we need to fetch them from the web. To do so we will use a couple of libraries. The first library that we need to download is the beautiful soup which is very useful Python utility for web scraping. Execute the following command at the command prompt to download the Beautiful Soup utility.

$pip install beautifulsoup4  Another important library that we need to parse XML and HTML is the lxml library. Execute the following command at command prompt to download lxml: $ pip install lxml

Now lets some Python code to scrape data from the web. The article we are going to scrape is the Wikipedia article on Artificial Intelligence. Execute the following script:

import bs4 as bs
import urllib.request
import re

scraped_data = urllib.request.urlopen('https://en.wikipedia.org/wiki/Artificial_intelligence')

parsed_article = bs.BeautifulSoup(article,'lxml')

paragraphs = parsed_article.find_all('p')

article_text = ""

for p in paragraphs:
article_text += p.text

In the script above we first import the important libraries required for scraping the data from the web. We then use the urlopen function from the urllib.request utility to scrape the data. Next, we need to call read function on the object returned by urlopen function in order to read the data. To parse the data, we use BeautifulSoup object and pass it the scraped data object i.e. article and the lxml parser.

## Free eBook: Git Essentials

Check out our hands-on, practical guide to learning Git, with best-practices, industry-accepted standards, and included cheat sheet. Stop Googling Git commands and actually learn it!

In Wikipedia articles, all the text for the article is enclosed inside the <p> tags. To retrieve the text we need to call find_all function on the object returned by the BeautifulSoup. The tag name is passed as a parameter to the function. The find_all function returns all the paragraphs in the article in the form of a list. All the paragraphs have been combined to recreate the article.

Once the article is scraped, we need to to do some preprocessing.

#### Preprocessing

The first preprocessing step is to remove references from the article. Wikipedia, references are enclosed in square brackets. The following script removes the square brackets and replaces the resulting multiple spaces by a single space. Take a look at the script below:

# Removing Square Brackets and Extra Spaces
article_text = re.sub(r'$[0-9]*$', ' ', article_text)
article_text = re.sub(r'\s+', ' ', article_text)

The article_text object contains text without brackets. However, we do not want to remove anything else from the article since this is the original article. We will not remove other numbers, punctuation marks and special characters from this text since we will use this text to create summaries and weighted word frequencies will be replaced in this article.

To clean the text and calculate weighted frequences, we will create another object. Take a look at the following script:

# Removing special characters and digits
formatted_article_text = re.sub('[^a-zA-Z]', ' ', article_text )
formatted_article_text = re.sub(r'\s+', ' ', formatted_article_text)

Now we have two objects article_text, which contains the original article and formatted_article_text which contains the formatted article. We will use formatted_article_text to create weighted frequency histograms for the words and will replace these weighted frequencies with the words in the article_text object.

#### Converting Text To Sentences

At this point we have preprocessed the data. Next, we need to tokenize the article into sentences. We will use thearticle_text object for tokenizing the article to sentence since it contains full stops. The formatted_article_text does not contain any punctuation and therefore cannot be converted into sentences using the full stop as a parameter.

The following script performs sentence tokenization:

sentence_list = nltk.sent_tokenize(article_text)

#### Find Weighted Frequency of Occurrence

To find the frequency of occurrence of each word, we use the formatted_article_text variable. We used this variable to find the frequency of occurrence since it doesn't contain punctuation, digits, or other special characters. Take a look at the following script:

stopwords = nltk.corpus.stopwords.words('english')

word_frequencies = {}
for word in nltk.word_tokenize(formatted_article_text):
if word not in stopwords:
if word not in word_frequencies.keys():
word_frequencies[word] = 1
else:
word_frequencies[word] += 1

In the script above, we first store all the English stop words from the nltk library into a stopwords variable. Next, we loop through all the sentences and then corresponding words to first check if they are stop words. If not, we proceed to check whether the words exist in word_frequency dictionary i.e. word_frequencies, or not. If the word is encountered for the first time, it is added to the dictionary as a key and its value is set to 1. Otherwise, if the word previously exists in the dictionary, its value is simply updated by 1.

Finally, to find the weighted frequency, we can simply divide the number of occurances of all the words by the frequency of the most occurring word, as shown below:

maximum_frequncy = max(word_frequencies.values())

for word in word_frequencies.keys():
word_frequencies[word] = (word_frequencies[word]/maximum_frequncy)

#### Calculating Sentence Scores

We have now calculated the weighted frequencies for all the words. Now is the time to calculate the scores for each sentence by adding weighted frequencies of the words that occur in that particular sentence. The following script calculates sentence scores:

sentence_scores = {}
for sent in sentence_list:
for word in nltk.word_tokenize(sent.lower()):
if word in word_frequencies.keys():
if len(sent.split(' ')) < 30:
if sent not in sentence_scores.keys():
sentence_scores[sent] = word_frequencies[word]
else:
sentence_scores[sent] += word_frequencies[word]

In the script above, we first create an empty sentence_scores dictionary. The keys of this dictionary will be the sentences themselves and the values will be the corresponding scores of the sentences. Next, we loop through each sentence in the sentence_list and tokenize the sentence into words.

We then check if the word exists in the word_frequencies dictionary. This check is performed since we created the sentence_list list from the article_text object; on the other hand, the word frequencies were calculated using the formatted_article_text object, which doesn't contain any stop words, numbers, etc.

We do not want very long sentences in the summary, therefore, we calculate the score for only sentences with less than 30 words (although you can tweak this parameter for your own use-case). Next, we check whether the sentence exists in the sentence_scores dictionary or not. If the sentence doesn't exist, we add it to the sentence_scores dictionary as a key and assign it the weighted frequency of the first word in the sentence, as its value. On the contrary, if the sentence exists in the dictionary, we simply add the weighted frequency of the word to the existing value.

#### Getting the Summary

Now we have the sentence_scores dictionary that contains sentences with their corresponding score. To summarize the article, we can take top N sentences with the highest scores. The following script retrieves top 7 sentences and prints them on the screen.

import heapq
summary_sentences = heapq.nlargest(7, sentence_scores, key=sentence_scores.get)

summary = ' '.join(summary_sentences)
print(summary)

In the script above, we use the heapq library and call its nlargest function to retrieve the top 7 sentences with the highest scores.

The output summary looks like this:

Artificial intelligence (AI), sometimes called machine intelligence, is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans and other animals. Many tools are used in AI, including versions of search and mathematical optimization, artificial neural networks, and methods based on statistics, probability and economics. The traditional problems (or goals) of AI research include reasoning, knowledge representation, planning, learning, natural language processing, perception and the ability to move and manipulate objects. When access to digital computers became possible in the middle 1950s, AI research began to explore the possibility that human intelligence could be reduced to symbol manipulation. One proposal to deal with this is to ensure that the first generally intelligent AI is 'Friendly AI', and will then be able to control subsequently developed AIs. Nowadays, the vast majority of current AI researchers work instead on tractable "narrow AI" applications (such as medical diagnosis or automobile navigation). Machine learning, a fundamental concept of AI research since the field's inception, is the study of computer algorithms that improve automatically through experience.

Remember, since Wikipedia articles are updated frequently, you might get different results depending upon the time of execution of the script.

#### Conclusion

This article explains the process of text summarization with the help of the Python NLTK library. The process of scraping articles using the BeautifulSoap library has also been briefly covered in the article. I will recommend you to scrape any other article from Wikipedia and see whether you can get a good summary of the article or not.

Last Updated: September 4th, 2018

Get tutorials, guides, and dev jobs in your inbox.

Usman MalikAuthor

Programmer | Blogger | Data Science Enthusiast | PhD To Be | Arsenal FC for Life

## Prepping for an interview?

• Improve your skills by solving one coding problem every day
• Get the solutions the next morning via email
• Practice on actual problems asked by top companies, like:

## Better understand your data with visualizations

With over 330+ pages, you'll learn the ins and outs of visualizing data in Python with popular libraries like Matplotlib, Seaborn, Bokeh, and more.


text:
## Questions about Varnish and magento 2

• Is it true that varnish doesn’t work with HTTPS?
• Is there an alternative that works well with magento 2? For two reasons, one I don’t think it works with HTTPS, and two it’s causing me too much trouble and breaking my site.

anti social behaviour essay how to write an analytical essay example of an informal essay persuasive essay on domestic violence john proctor the crucible essay essay about nursing career heroism essay example essay writers online interpretation essay example good essay titles
problem solution essay examples…

## How do Course Aggregating sites like ClassCentral & CourseRoot gather data about courses? [on hold]

I am trying to understand How these course aggregator sites gather data about courses. Do they use API to get access to data or use web crawlers.

## I have a question about domain transfer

Hi,
this may seem a newbie question but this is confusing for me.
If anyone can explain this, I would be greatful.

I have this website (domain+hosting) with a company. registered on Sep 18, 2018 for one year.
The hosting package + domain is going to expire on Sep 17, 2019.
I want to keep this domain but not with this company.
So do I have to transfer this domain or renew with another company?
And when?
If I transfer this domain to new company, today on June 23, 2019.
Will it be…

I have a question about domain transfer

## About an argument in the paper “Commutators on $\ell_\infty$” by Dosev and Johnson

In the paper “Commutators on $$\ell_\infty$$” by Dosev and Johnson, in Lemma 4.2 Cas II, the authors have said that “There exists a normalized bock basis $$\{u_i\}$$ of $$\{x_i\}$$ and a normalized block basis $$\{v_i\}$$ of $$\{y_i\}$$ such that $$\|u_i-v_i\|<\frac{1}{i}.$$ Does anyone have any idea to prove this?

More elaborately, we have two subspaces $$X$$ and $$Y$$ of $$\ell_\infty$$ both isomorphic to $$c_0.$$ $$\{x_i\}$$ and $$\{y_i\}$$ are bases of $$X$$ and $$Y$$ respectively which are equivalent to standard base of $$c_0$$. We have also $$X\cap Y=\{0\}$$ and $$d(X,Y):=\inf\{\|x-y\|:x\in X,y\in Y, \|x\|=1\}=0.$$ Now how to show “There exists a normalized bock basis $$\{u_i\}$$ of $$\{x_i\}$$ and a normalized block basis $$\{v_i\}$$ of $$\{y_i\}$$ such that $$\|u_i-v_i\|<\frac{1}{i}.$$” ?

## Would this pure class theory about ordinals and their relations raise concerns about its arithmetic soundness?

The following theory is a class theory, where all classes are either classes of ordinals, or relations between classes of ordinals, i.e. classes of Kuratowski ordered pairs of ordinals, or otherwise classes of unordered pairs of ordinals. However, the size of its universe is weakly inaccessible. Ordinals are defined as von Neumann ordinals. The theory is formalized in first order logic with equality and membership.

Extensionality: $$\forall z (z \in x \leftrightarrow z \in y) \to x=y$$

Comprehension: if $$\phi$$ is a formula in which the symbol $$“x”$$ is not free, then all closures of: $$\exists x \forall y (y \in x \leftrightarrow \exists z(y \in z) \land \phi)$$; are axioms.

Ordinal pairing: $$\forall \text{ ordinals } \alpha \beta \ \exists x (\{\alpha,\beta\} \in x)$$

Define: $$\langle \alpha \beta \rangle = \{\{\alpha\},\{\alpha,\beta\}\}$$

Ordinal adjunction:: $$\forall \text { ordinal } \alpha \ \exists x (\alpha \cup \{\alpha\} \in x)$$

Relations: $$\forall \text{ ordinals } \alpha \beta \ \exists x (\langle \alpha, \beta \rangle \in x)$$

Elements: $$\exists y (x \in y) \to ordinal(x) \lor \exists \text{ ordinals } \alpha \beta \ (x=\langle \alpha,\beta \rangle \lor x=\{\alpha,\beta\})$$

Size: $$ORD \text { is weakly inaccessible}$$

Where $$ORD$$ is the class of all element ordinals.

/Theory definition finished.

Now this theory clearly can define various extended arithmetical operations on element ordinals. Also it proves transfinite induction over element ordinals. In some sense it can be regarded as stretching arithmetic to the infinite world. Of course $$PA$$ is interpretable in the finite segment of this theory.

In this posting Nik Weaver in his answer raised the concern of ZFC being arithmetically unsound.

My question: assuming this theory to be consistent, is the concern of it being arithmetically unsound is the same as that with ZFC?

The motive for this question is that it appears to me that the above theory is just a naive extension of numbers to the infinite world, it has no power set axiom nor the alike. One can say that this theory is in some sense purely mathematical in the sense that it’s only about numbers and their relations. Would this raise the same kind of suspicion about arithmetic unsoundness that is raised with ZFC.

My reasoning about that is that generally speaking when one raises the concern of arithmetic unsoundness of some theory, especially if that theory is well received by mathematicians working in set theory and foundations, then there must be some technical or intuitive argument behind that suspicion, otherwise that suspicion would be unfounded. The suspicion must not depend merely on the strength of the theory in question. Otherwise we’d not define any theory stronger than $$PA$$ based on such concerns.

From Nik Weaver’s answer it appears to me that his concern is based on ZFC not capturing a clear concept intuitively speaking. Now this theory is based on an intuitive concept that is generally similar to the one behind defining arithmetic for finite sets. It extends it in a very clear intuitive manner, higher ordinals are defined from prior ones in successive manner, and it doesn’t generally feel to be so different from the intuitive underpinnings of arithmetic in the finite world. So the question here is about if this theory still fall a prey to the arguments upon which the concerns about arithmetic unsoundness of ZFC are based.

## What’s the point of DHS warning passengers about Manila airport?

I’ve seen the following warning printed next to all TSA checkpoints in a US airport:

The Department of Homeland Security (DHS) today announced the determination that aviation security at Ninoy Aquino International Airport (MNL), which serves as a last-point-of-departure airport for flights to the United States, does not maintain and carry out effective security consistent with the security standards established by the International Civil Aviation Organization (ICAO).

What is the point of this warning? Are they warning passengers that direct flights to Manila will be cancelled soon? Or is it just a generic warning designed to force Manila airport to improve their security?

## Proof of lemma from Hong’s article about multi-threaded max flow algorithm

I’m struggling to prove Lemma 3 and Lemma 4 from an article about parallel version of push-relabel algorithm: A lock-free multi-threaded algorithm for the maximum flow problem.

Lemma 3. Any trace of two push and/or lift operations is equivalent to either a stage-clean trace or a stage-stepping trace.

And

Lemma 4. For any trace of three or more push and/or lift operations, there exists an equivalent trace consisting of a sequence of non-overlapping traces, each of which is either stage-clean or stage-stepping.

## I’m travelling from Canada with a criminal record. Which countries are sticky about criminal records?

I’m wondering which countries may not let me in with a criminal record.

I’m planning on doing a bunch of travelling in the next few years and I wanna know which countries might give me a hard time getting in and which ones won’t. and which charges these countries care about.

Thanks!

## European airport policy about certain chemical substances [on hold]

As title tells, i want to know if airports are restricted on some chemical reagents, including: iodine, potassium nitrate, sulfur, silver, copper hydroxide, copper metal, carbon electrodes, potassium bisulfite and simillar things. I want to mention that listed stuff is all solid stuff that is allowed to non licensed trade like on eBay and so on, only some of them are on watchlist due to drug and explosives manufacture, like iodine, potassium nitrate and sulfur. I know that they got tendency to freak out with liquids and anything that even looks little bit suspicious, im gonna proper pack & label everything and if additional questions are needed, im able to answear them all. Is it possible?

For example, if i want to travel from EU to UK by aircraft, and i have my goods in small quantities in original packing that are all inside my backpack in a box. None of them are illegal, some are watched, none of them are liquids, none of them are really hazardous, poisonous or corrosive. For example they scan my luggage and decide to ask me some questions, i got nothing to hide so ill answer them all. My three additional questions are, -Can they still turn me back and not let me in, even if my ticket is already booked? -If yes, is there any way to avoid it by early declaration about my “special” possibly hazardous stuff? -If yes, would it cost much more? (i imagine yes)


text:
## Groverburger's 3D Engine (g3d) v1.4 Release

grump
Party member
Posts: 776
Joined: Sat Jul 22, 2017 7:43 pm

### Re: Groverburger's 3D Engine (g3d) v1.1 Release

groverburger wrote: Thu Jan 21, 2021 12:12 am grump, there does appear to be some default depth buffer.
Huh, that's weird. There are three ways to enable a depth buffer: in conf.lua, or with a setMode call, or with a depth-enabled Canvas setup. To the best of my knowledge, there is none by default and there shouldn't be one if it wasn't explicitly enabled.

If there really is one on your system by default, then I'm 99% sure it's either a driver bug or a bug in LÖVE.
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

I just checked, if I put in my conf.lua : t.window.depth = 16 then I don't need to draw on a canvas and
g3d.camera.firstPersonLook(dx,-dy)
is not reversed.

I believe it's because a canvas is drawn bottom up.
groverburger
Prole
Posts: 38
Joined: Tue Oct 30, 2018 9:27 pm

### Re: Groverburger's 3D Engine (g3d) v1.1 Release

grump wrote: Thu Jan 21, 2021 12:24 am If there really is one on your system by default, then I'm 99% sure it's either a driver bug or a bug in LÖVE.
4vZEROv wrote: Thu Jan 21, 2021 1:34 am I just checked, if I put in my conf.lua : t.window.depth = 16 then I don't need to draw on a canvas and
g3d.camera.firstPersonLook(dx,-dy)
is not reversed.

I believe it's because a canvas is drawn bottom up.
Interesting... I've tested my current implementation without a depth canvas or explicit depth setting on both my windows and mac and they both work as intended. It couldn't be a driver problem then (or that would at least be a weird coincidence).

Maybe the best course of action here is to add a conf.lua with a depth value of 16 to the demo?
I just tried it, and my mouse still works uninverted -- nothing appears to have changed. But it might fix this problem for people who would otherwise come across it. I'm not certain.
4aiman
Party member
Posts: 253
Joined: Sat Jan 16, 2016 10:30 am

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

Hey-hey!
Conf.lua really helped to fix the issue w/o changing *anything* inside the code of a test project or the demo one.
And now I don't have to invert anything as well.

HUGE thanks to both of you, 4vZEROv, groverburger!

P.S. The 1.2 release doesn't contain the conf.lua, although it's in the repository
groverburger
Prole
Posts: 38
Joined: Tue Oct 30, 2018 9:27 pm

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

4aiman wrote: Thu Jan 21, 2021 9:15 am Hey-hey!
Conf.lua really helped to fix the issue w/o changing *anything* inside the code of a test project or the demo one.
And now I don't have to invert anything as well.

HUGE thanks to both of you, 4vZEROv, groverburger!

P.S. The 1.2 release doesn't contain the conf.lua, although it's in the repository
That's great news!
I guess I'll make version 1.2.1
pgimeno
Party member
Posts: 2687
Joined: Sun Oct 18, 2015 2:58 pm

### Re: Groverburger's 3D Engine (g3d) v1.1 Release

groverburger wrote: Thu Jan 21, 2021 12:12 am grump, there does appear to be some default depth buffer.
Only in some graphics drivers, I believe.
Davidobot
Party member
Posts: 1214
Joined: Sat Mar 31, 2012 5:18 am
Location: Cambridge, UK
Contact:

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

4aiman wrote: Thu Jan 21, 2021 9:15 am Hey-hey!
Conf.lua really helped to fix the issue w/o changing *anything* inside the code of a test project or the demo one.
And now I don't have to invert anything as well.

HUGE thanks to both of you, 4vZEROv, groverburger!

P.S. The 1.2 release doesn't contain the conf.lua, although it's in the repository
Oh, that's neat to know. The G3D demo I use for love.js has a problem whereby the 3D model's normals seem to be inverted on Firefox but are just fine in Chromium. I wonder if this conf.lua change will fix it.

EDIT: the config change did indeed fix the normal problem with Firefox! Super!
My projects: Raycaster, love.js v11.3 port
My library: LovelyMoon
4aiman
Party member
Posts: 253
Joined: Sat Jan 16, 2016 10:30 am

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

Been tinkering with the engine for quite a while and wanted to add some light sources, but have no idea of how to.

By default there's no light sources at all, right?
I've looked at the Flamerunner's source code and found the shaders used fol lighting there.

The problem is, I'm a total noob with shaders and (what's worse) too dumb to comprehend the math beyond those shaders on my own.
All I can really do at the moment is to try to use the shaders from Flamerunner "as is".

Actually, I just copied part of the shaders (self.meshShader from scene.lua, line #158), added something by myself as well, added a pointlight, updated it once, sending stuff to a shader.

Here's my "light source":

Code: Select all

PointLight = {
index = 1,
color = {1,1,1},
pos = {30*6,1,16*6},
specularity = 1,
diffuse = 1,
constant = 1,
linear = 0.001,
}

function plu(self)
local i = self.index
self.shader:send("pointLights[" .. i .. "].position", self.pos)
self.shader:send("pointLights[" .. i .. "].color", self.color)
self.shader:send("pointLights[" .. i .. "].specularity", self.specularity)
self.shader:send("pointLights[" .. i .. "].diffuse", self.diffuse)

self.shader:send("pointLights[" .. i .. "].constant", self.constant)
self.shader:send("pointLights[" .. i .. "].linear", self.linear)
end

Code: Select all

    uniform mat4 projectionMatrix;
uniform mat4 modelMatrix;
uniform mat4 viewMatrix;

varying vec4 vertexColor;

// ambient
float ambientStrength = 0.2;
vec4 ambient = ambientStrength * vertexColor;

struct PointLight{
vec3 position;
vec3 color;
float diffuse;
float specularity;

float constant;
float linear;
};

#define LIGHTS 16 uniform PointLight pointLights[LIGHTS];

#ifdef VERTEX
vec4 position(mat4 transform_projection, vec4 vertex_position)
{
vertexColor = VertexColor;
return projectionMatrix * viewMatrix * modelMatrix * vertex_position;
}
#endif

#ifdef PIXEL

vec3 CalcPointLight(PointLight light, vec3 normal, vec3 fragPos, vec3 viewDir, vec4 texcolor)
{
vec3 lightDir = normalize(light.position - fragPos);

float diff = max(dot(normal, lightDir), 0.0);

vec3 reflectDir = reflect(-lightDir, normal);
float spec = pow(max(dot(viewDir, reflectDir), 0.0), 0.1);

// attenuation
float distance = length(light.position - fragPos);
float attenuation = 1 / (light.constant + light.linear * distance + light.quadratic * (distance * distance));

// combine results
vec3 ambient = ambientStrength  * vec3(texcolor);
vec3 diffuse = light.diffuse  * diff * vec3(texcolor);
vec3 specular = light.specularity * spec * vec3(texcolor);
ambient *= attenuation;
diffuse *= attenuation;
specular *= attenuation;
return (ambient + diffuse + specular)*light.color;
}

vec4 effect(vec4 color, Image tex, vec2 texcoord, vec2 pixcoord)
{
vec4 texcolor = Texel(tex, texcoord);
if (texcolor.a == 0.0) { discard; }

// saving alpha for later usage
float texalpha = texcolor.a;
vec4 result = (texcolor)*color*ambientStrength*vertexColor;
// restored alpha
result.a = texalpha;
return result;
}
#endif
If I leave only ambient, it works fine.
But as soon as I'm trying to send things to a shader, I'm getting this:

Code: Select all

Shader uniform 'pointLights[0].position' does not exist.
A common error is to define but not use the variable.
I don't get what's wrong
The array is there in the shader, it clearly has a position attribute...
Moreover, any other field is missing too (e.g. I can't set color or diffuse as well).

And yes, I know, I don't actually do anything with sent values in the effect, but I can't even send those values.
(I mean, there's no for (int i=0; i<LIGHTS; i++) etc)

Could anyone help me with this?
Or, better yet, could anyone give an example of just one working pointlight?
4vZEROv
Party member
Posts: 126
Joined: Wed Jan 02, 2019 8:44 pm

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

"A common error is to define but not use the variable."
pgimeno
Party member
Posts: 2687
Joined: Sun Oct 18, 2015 2:58 pm

### Re: Groverburger's 3D Engine (g3d) v1.2 Release

I'm not sure you pass arrays of uniforms like that, though. See docs for Shader:send for examples.

Also in my graphics card, the uniform is optimized out (removed) when it's not used, causing that error.

### Who is online

Users browsing this forum: No registered users and 12 guests


text:
Address 8 Great Works Dr, South Berwick, ME 03908 (207) 618-1966 http://www.yocs.net

# exponential error Eliot, Maine

What are Imperial officers wearing here? Plotting exp(-1/(5-x)), for example, from 0 to 5, shows that the value approaches 0 "from the left." Plotting this function from 0 to 10, for example, means that you pass the What was the reaction when you revealed the answer? Previous Day | This starter is for 1 August | Next Day Answers The word mistake is spelled incorrectly (that is the mistake!) Teacher, do your students have access to

It is a standard fact that this is $$\int_0^\infty x\lambda e^{-\lambda x}dx$$ Integrate (by parts), or if you are in a pre-integration phase, accept the fact that this integral is equal At T=Tg, the exponential value should be zero but it was infinity. The following pseudo code shows one way to poll for a status using an incremental delay.Do some asynchronous operation. ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: http://0.0.0.9/ Connection to 0.0.0.9 failed.

exponential function error Topics: 4.0a Thread index | Previous thread | Next thread | Start a new discussion RSS feed | Turn on email notifications | 11 retry = false; } } while (retry && (retries++ < MAX_RETRIES)); } catch (Exception ex) { } } /* * Returns the next wait interval, in milliseconds, using an exponential * Thread.sleep(waitTime); // Get the result of the asynchronous operation. retry = false END IF retries = retries + 1 WHILE (retry AND (retries < MAX_RETRIES))The following code demonstrates how to implement this incremental delay in Java.public enum Results { SUCCESS,

National Library of Medicine 8600 Rockville Pike, Bethesda MD, 20894 USA Policies and Guidelines | Contact 23 = 8 32 = 9 24 = 16 42 = 16 43 = 64 I wouldn't convert 95% into decimals and use it as P... For example, lets say we are using a UV-Vis Spectrophotometer to determine the molar absorptivity of a molecule via Beer's Law: A = ε l c. For more information, see the blog post for Exponential Backoff and Jitter.

Unsourced material may be challenged and removed. (October 2011) (Learn how and when to remove this template message) The graph illustrates how an exponential growth surpasses both linear and cubic growths. Of course this starter would also be suitable for older pupils who already know about indices less than one. What I've done so far: First note: $$e^x = \sum_{k = 0}^\infty \frac{x^k}{k!} = 1 + x + \frac{x^2}{2!} + \dots \frac{x^n}{n!} + O\left(\frac{1}{(n+1)^{(n+1)}}\right)$$ and $$\left( 1 + \frac{x}{n} \right) ^ You should implement a maximum delay interval, as well as a maximum number of retries. Guidance on when this is acceptable practice is given below: If the measurements of a and b are independent, the associated covariance term is zero. I've solved that problem. It can be written that $$x$$ is a function of these variables: $x=f(a,b,c) \tag{1}$ Because each measurement has an uncertainty about its mean, it can be written that the uncertainty of SOLUTION Since Beer's Law deals with multiplication/division, we'll use Equation 11: $\dfrac{\sigma_{\epsilon}}{\epsilon}={\sqrt{\left(\dfrac{0.000008}{0.172807}\right)^2+\left(\dfrac{0.1}{1.0}\right)^2+\left(\dfrac{0.3}{13.7}\right)^2}}$ $\dfrac{\sigma_{\epsilon}}{\epsilon}=0.10237$ As stated in the note above, Equation 11 yields a relative standard deviation, or a percentage of the Generated Sat, 15 Oct 2016 11:42:17 GMT by s_ac15 (squid/3.5.20) However, if the variables are correlated rather than independent, the cross term may not cancel out. It appears to me that I do not have a single value \lambda to work with. –shino Apr 30 '11 at 18:01 @shino: There are generalizations of the exponential Please help improve this article by adding citations to reliable sources. Starter of The Day Transum Mathematics Privacy Policy Tweet about this starter Share Topics: Starter | Indices Transum, At the time of writing this is a new starter idea. But the variance of a sum of independent random variables is the sum of the variances, so the variance of Y is$$(1/N^2)(N/\lambda^2)$$which is 1/(N\lambda^2). Reply | Reply with Quote | Send private message | Report Abuse Amir Fadel March 31, 2011 12:21pm UTC in response to JiYoung Park Re: exponential function error Hi, If you Since at least two of the variables have an uncertainty based on the equipment used, a propagation of error formula must be applied to measure a more exact uncertainty of the The mortgage company is trying to force us to make repairs after an insurance claim Game of Life, a shorter story Why is it a bad idea for management to have All rights reserved.Did this page help you?YesNoFeedbackJavascript is disabled or is unavailable in your browser. To use the AWS Documentation, Javascript must be enabled. Since \xi>0 in (2), we have$$ 0

At first I was afraid I'd be petrified Is the mass of an individual star almost constant throughout its life? Hot Network Questions Which option did Harry Potter pick for the knight bus? And for the integral of the density function from $0$ to infinity to be $1$, you need $A=\lambda$. Article type topic Tags Upper Division Vet4 © Copyright 2016 Chemistry LibreTexts Powered by MindTouch Warning: The NCBI web site requires JavaScript to function.

Or else accept from your notes that this is the case. Browse other questions tagged numerical-methods approximation exponential-function or ask your own question. How do I help minimize interruptions during group meetings as a student? You gotta use this exponential formula: y=Pe^rt (to the 'rt' power) .

Is accuracy a binary? Browse other questions tagged statistics average or ask your own question. SOLUTION To actually use this percentage to calculate unknown uncertainties of other variables, we must first define what uncertainty is. What's the most recent specific historical element that is common between Star Trek and the real world?

If you're not using an AWS SDK, you should retry original requests that receive server (5xx) or throttling errors. Let's say we measure the radius of a very small object. Since we are given the radius has a 5% uncertainty, we know that (∆r/r) = 0.05. Disadvantages of Propagation of Error Approach Inan ideal case, the propagation of error estimate above will not differ from the estimate made directly from the measurements.

You will get $$\frac{1}{\lambda\sqrt{N}}$$ You may have to adapt the reasoning to the particular tools, and language, that you are expected to use. Thank you!! What is the mean of $X$? up vote 1 down vote favorite What is the standard error of the mean of an exponential distribution of the form $Ae^{Bx}$ with $N$ measurements?

By a standard fact, this is $E(X^2)-(E(X))^2$. Dana Issam, UAE I think the error is in the 2^4, all of the other sums are related to the rules of indices. Make all the statements true What are "desires of the flesh"? as follows: The standard deviation equation can be rewritten as the variance ($$\sigma_x^2$$) of $$x$$: $\dfrac{\sum{(dx_i)^2}}{N-1}=\dfrac{\sum{(x_i-\bar{x})^2}}{N-1}=\sigma^2_x\tag{8}$ Rewriting Equation 7 using the statistical relationship created yields the Exact Formula for Propagation of

Transum.org/go/?Start=August1 Here is the URL which will take them to our Indices Pairs game.


text:
# Hamiltonian Monte Carlo for Hydrology, Part I

Published:

In a previous post I sketched out how to make a statistical model out of a simple ordinary differential equation. This is the first in a series of posts following my attempts to make a Bayesian version of a very simple conceptual hydrology model which is fit into a modern deep learning / Markov Chain Monte Carlo (MCMC) framework.

## Why MCMC?

One of the scariest words that a hydrology modeler can hear nowadays is “equifinality”. In short, this is simply the situation where multiple different settings of the knobs and dials on a complicated hydrology simulation can lead to equally good accuracy in a testing phase. I’m not sure why this term had to be applied because this is a fundamental issue taught to every student of graduate statistics; in that discipline it is known as identifiability. Simply put, we want models in which we can uniquely identify the parameters. Unfortunately, highly parameterized hydrology models have faced major identifiability issues, prompting some in the earth sciences community to call attention to this crisis.

Bayesian methods in the statistical sciences are a natural way to tackle issues of identifiability because in that framework, we can use informative priors to shape the probability space of our model in such a way that makes a unique parameter solution much more likely to pop out. This touches on the topic of regularization in statistical learning theory. We regularize (i.e. push some model parameters to be either zero or non-impactful) when we have too many parameters for the model to be identifiable. This sort of logic is behind many of the greatest advances in machine learning as well. For those of you familiar with training of wide, deep neural networks, one way to substantially enhance the training process was to occasionally let some nodes in the network be blacked out and not interact with the rest of the network. Later on, it was discovered that this was, in fact, a form of Bayesian regularization even if the methods and model were not familiar to most conventional statisticians.

I want to fix the identifiability crisis in modern hydrology models by putting them in a Bayesian statistical framework. However, this poses a secondary issue: these models are complicated and often have latent processes within them that lead to enormous numbers of highly correlated parameters that cannot be tacked with the Metropolis algorithm. Metropolis and the Metropolis-Hastings algorithm are used extensively in hydrological applications of Bayesian statistics. There has been a cottage industry spawning a number of follow-on attempts to devise more accurate search heuristics within the hydrology community, though most of these lack any strong connection to the broader statistics literature. Most of us think of statistics as a nebulous gray cloud that occasionally drizzles significant p-values but virtually any situation in which predictive accuracy is desirable calls for some statistical know-how.

## Hamiltonian MCMC

The most substantial development in applied Bayesian methods from the last decade is undoubtedly the development of Hamiltonian Monte Carlo (HMC) and subsequent refinements such as the No-U-Turn sampler as implemented in Stan and PyMC3. Put simply, HMC approaches use the curvature of the likelihood function in parameter space to determine where the MCMC sampler should move. This curvature is only defined for continuous likelihood functions (though we can typically use another algorithm for parameters that are discrete) and leads to highly efficient sampling for a wide class of problems. Specifically, HMC is very, very useful for sampling from posteriors over model parameter distributions in which the parameters are highly correlated. This is often the case in time series models. Hydrology models also appear to have this issue because there are frequently latent processes involved that can easily be simulated forwards but which are very difficult to estimate from observations in an inverse problem.

For an example of these latent processes, see the diagram for the conceptual hydrology model GR4J which I have stolen from the website of the Catchment Hydrology Research Group at IRSTEA in France. We typically have observations of the evaporation and precipitation as well as the discharge, but the amount of water in the two model reservoirs is unknown. Furthermore, since these reservoirs are filled and emptied according to difference equations, the reservoir level from day to day is going to have extremely high autocorrelations. This is why I want to use HMC to estimate the model parameters. Here, I am also describing the reservoir storage as a parameter even if it is not a parameter in the hydrologist’s sense of the word.

In part II of this series, I’ll include code for implementing a few subcomponents of GR4J in Theano, a powerful computational framework.


text:
# Finding the number of events in a given period based on time interval between events

I have a set of "Days since last Visit" data from the Google Analytics:

Day since last Visit     Count of Users
Total                    400K
0                        100K
1                        50K
2                        10K
....

Given a fixed Time Frame, the row "1 50K" means that there are 50K users who have the last two visits in a consecutive day, and "0 100K" means that for that 100K users, their last two visits occur on the same day.

So is it possible for me to estimate, the expected number of days for the users visit the sites in a month?

• Do you mean you want to estimate the expected number of visits per month of a user; or do you just want the expected value of the "days since last visit" variable? – Peter Ellis Jun 25 '13 at 5:32
• expected Days of visits per month of a user, so if the user come several times in the same day, that only count as 1. – Kloser Cheung Jun 25 '13 at 11:27


text: 2020-08-25 18:58:44 +0200 received badge ● Student (source) 2020-08-25 18:50:06 +0200 received badge ● Notable Question (source) 2020-08-25 18:50:06 +0200 received badge ● Popular Question (source) 2017-12-19 23:58:48 +0200 commented answer Defining AES MixColumns in Sage Yes, in $GF(256)$ we have 5*x = x. But I want to define a polynomial in $GF(256)[x]$, which is a polynomial whose coefficients belong to $GF(256)$, not one whose coefficients belong to $GF(2)$. Actually, as I pointed in a few comments above, I'd like to define the polynomial ring $GF(256)[x] / \langle x^4 + 1 \rangle$. The last approach you suggested seems very promising. Can you further hint on how to generalize it for the polynomial ring $GF(256)[x] / \langle x^4 + 1 \rangle$? 2017-12-19 21:36:46 +0200 commented answer Defining AES MixColumns in Sage It must work, but it does not (to my surprise). In your definition, $R$ is the ring of polynomials with coefficients over $GF(256)$, but sage treats it as the ring of polynomials with coefficients over $GF(2)$! Just enter something like 5*x in sage, and it interprets this polynomial as x. Or enter x+x, and sage outputs 0. 2017-12-17 11:55:42 +0200 received badge ● Scholar (source) 2017-12-17 11:55:40 +0200 commented answer Defining AES MixColumns in Sage Thanks again. Let me just confirm my understanding: Sage does not provide a way for defining $GF(256)[x] / \langle x^4 + 1 \rangle$, right? 2017-12-17 04:22:15 +0200 commented answer Defining AES MixColumns in Sage Thanks a lot. Could you please answer the first part, too: ln short, how can I define $GF(256)[x] / \langle x^4 + 1 \rangle$ in Sage? I mean, as stated in the question, addition and multiplication of polynomials with coefficients in $GF(256)$ modulo $x^4+1$. 2017-12-16 21:59:52 +0200 asked a question Defining AES MixColumns in Sage AES is a famous cipher. It has an operation called MixColumns (See Wikipedia entry Rijndael MixColumns) where operations take place over finite fields. Actually, there's a specific polynomial $a(x) = a_3x^{3}+a_2x^{2}+a_1x+a_0$ whose coefficients belong to $GF(2^8)$. MixColumns is defined between $a(x)$ and any polynomial $b(x) = b_{3}x^{3}+b_{2}x^{2}+b_{1}x+b_{0}$ (whose coefficients belong to $GF(2^8)$ as well): It first multiplies $a(x)$ by $b(x)$ (where the algebraic rules between coefficients are governed by $GF(2^8)$), and then computes the remainder modulo $x^4 + 1$. I tried to mimic the operations in Sage as follows: R. = PolynomialRing(GF(2), 'x') S. = QuotientRing(R, R.ideal(x^8+x^4+x^3+x+1)) T. = QuotientRing(S, S.ideal(y^4+1))  But Sage displays an error on the last line. The error seems to be originating from the introduction of z. If I replace the last line with, say, T = QuotientRing(S, S.ideal(y^4+1)), the error goes away. Yet this is not what I intended. Furthermore, the command S.ideal(y^4+1) outputs: Principal ideal (1) of Univariate Quotient Polynomial Ring in y over Finite Field of size 2 with modulus x^8 + x^4 + x^3 + x + 1 I don't understand why its is the principal ideal (1) rather than the principal ideal (y^4+1).


text:
# Unexpected behaviors with Edge Weights

Noticed some bizarre behavior when subgraphing on weighted graphs, which probably extends to graphs with arbitrary edge properties.

I construct a weighted graph with five edges, defining a specific vertex and edge order:

    EdgeWeightList[g_] :=
Table[PropertyValue[{g, e}, EdgeWeight], {e, EdgeList[g]}]

G = Graph[{4, 2, 1, 3, 5}, {1 <-> 2, 2 <-> 3, 3 <-> 1, 3 <-> 4,
3 <-> 5}, EdgeWeight -> {30, 20, 10, 50, 40},
VertexLabels -> "Name", EdgeLabels -> "EdgeWeight", ImageSize -> 250]
VertexList[G]

Next I delete edges that fall below a specific threshold.

F = G;
Do[If[PropertyValue[{G, e}, EdgeWeight] < 35,
F = EdgeDelete[F, e]], {e, EdgeList[G]}]
F
Options[F]
VertexList[F]

Now I compute and subgraph with the largest weakly connected component of the graph in order to remove the disconnected vertices. Now, as Subgraph does not support weighted graphs (which I think it should, and so should as many other graph measures / operations as possible), I use Options to copy the all of the options defined on the original graph, including the edge weights. However, there are two problems here: one, the weakly connected component does not maintain a consistent ordering of vertices with respect to the original graph, and two, the edges also do not maintain a consistent ordering with respect to the original graph, as when the order of the vertices change, the effective ordering of the edges changes as well. Note also that this method will not actually work when there is more than one weakly connected component with edges, as Options will return more edge weights (or properties in general) than there are edges in the subgraph, and will not build the graph correctly.

W = WeaklyConnectedComponents[F][[1]]
Options[F]
S = Subgraph[F, W, Options[F]]
VertexList[S]

Explicitly specifying the weakly connected component with the correct ordering does work (but again, with the same limitations as above).

W = {4, 3, 5}
Options[F]
S = Subgraph[F, W, Options[F]]
VertexList[S]

W = WeaklyConnectedComponents[F][[1]]


text:
On modifying the damping force in source code

Hi there,

I am changing the damping force formula in the source code, and I want the damping force to be proportional to incidentVn**1.5 instead of incidentVn. Am I correct as follows?

Thanks!

double cn = Cn_crit*phys->viscousDamping; // Damping normal coefficient

/* Add normal viscous component if damping is included */
Vector3r incidentVn_Test=incidentVn;
double sign_1=Sgn(incidentVn_Test[0]);
double sign_2=Sgn(incidentVn_Test[1]);
double sign_3=Sgn(incidentVn_Test[2]);
#Here Sgn is a function to return the sign (1 or minus 1)

incidentVn_Test[0]=sign_1*pow(fabs(incidentVn_Test[0]),1.5);
incidentVn_Test[1]=sign_2*pow(fabs(incidentVn_Test[1]),1.5);
incidentVn_Test[2]=sign_3*pow(fabs(incidentVn_Test[2]),1.5);
#Here I change the component of the Vector3r respectively

phys->normalViscous = cn*incidentVn_Test;
/* Add normal viscous component if damping is included */

phys->normalForce -= phys->normalViscous;

Question information

Language:
English Edit question
Status:
Expired
For:


text:
RPKM, how to normalize for library size
1
0
Entering edit mode
6 weeks ago
bs2 • 0

Hi everybody! I'm working on several metagenomes (so not trascriptomes), and I mapped high quality reads to a database made of nucleotide sequences through bowtie2. I want to convert raw mapping counts of each gene in RPKM. I know this method might not be appropriate for this purpose, so please don't take this into account.

I obtained the formula to use from here. So, this is the question: in my case, 'totalNumReads' should refer to the total number of reads that successfully aligned to a gene (that is, the sample-wise sum of the counts), or to the library size, that is the total number of reads that I have in the metagenome (so also accounting for unmapped reads).

rpkm dna-seq metagenomes • 289 views
0
Entering edit mode

It's reads mapped to genes, so basically if you have a matrix of counts with rows being genes and columns being samples -- it is the sum of every column. Unmapped reads make no sense as that would change the expression of a gene if you have more unmapped reads, e.g. a more noise dataset but that has nothing to do with reads assigned to genes.

0
Entering edit mode

Ok, I got you, but in this case I'm not taking into account the size of the library, right? For example, if I have metagenome1 with 20M reads and metagenome2 with 10M reads, the count of reads mapping to a gene X might be higher in metagenome1 solely because it has more reads. And this might be independent from the sum of reads mapping to all the genes. This is the point that confuses me most.

0
Entering edit mode

The library size is the sum of the column, so it takes it into account. The colSum is the effective library size that matters.

0
Entering edit mode
6 weeks ago

the totalNumReads are the total mapped reads overall.

The RPKM is a normalization that is meant to take into account two factors

1. The amount of usable data
2. The length of the donor sequence

hence it divides with both. Doing so "normalizes" (makes comparable) values obtained from less or more data, and from shorter and longer donor sequences.


text:
LOWESS Smoothing
Post
Cancel

# LOWESS Smoothing

## Basic Information

Local regression or local polynomial regression, also known as moving regression, is a generalization of moving average and polynomial regression. Its most common methods, initially developed for scatterplot smoothing, are LOESS (locally estimated scatterplot smoothing) and LOWESS (locally weighted scatterplot smoothing). From wikipedia

## Introduction

• Least Squares finds the line with the minimal squared distance from the data points.
• But how to fit a curve to data?
• LOWESS Smmothing use least squares to do it.

## Idea

• Use a type of sliding window to diveide the data into smaller blobs
• At each data point, use a type of least squares(weighted) to fit a line
• To reduce the influence on the new curve, we create an additional weight for the weighted least squares based on how far the original point is from the new point
• Iter

## Weight Functions

 Different weight functions Comparison of weight functions

## Code Example

https://github.com/StatQuest/lowess_loess_demo/blob/master/lowess_loess_demo.R

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 ## first let's make a noisy gamma distribution plot... x <- seq(from=0, to=20, by=0.1) y.gamma <- dgamma(x, shape=2, scale=2) y.gamma.scaled <- y.gamma * 100 y.norm <- vector(length=201) for (i in 1:201) { y.norm[i] <- rnorm(n=1, mean=y.gamma.scaled[i], sd=2) } data <- data.frame(x, y.norm) plot(data, frame.plot=FALSE, xlab="", ylab="", col="#d95f0e", lwd=1.5) ## Now that we have the data, let's look at the differences ## and similarities between R's lowess() function and the loess() function. ## We'll start with the lowess() function... ## ## By default "lowess()" fits a line in each window using ## 2/3's of the data points. ## ## the first parameter, y.norm ~ x, says that y.norm is being ## modeled by x, and the second parameter, f, is the fraction ## of points to use in each window. Here, we're using 1/5 of the ## data points in each window. lo.fit.gamma <- lowess(y.norm ~ x, f=1/5) plot(data, frame.plot=FALSE, xlab="", ylab="", col="#d95f0e", lwd=1.5) lines(x, lo.fit.gamma$y, col="black", lwd=3) ## Now use loess() to fit a curve to the data... ## ## By default "loess()" fits a parabola in each window using ## 75% of the data points. plx<-predict(loess(y.norm ~ x, span=1/5, degree=2, family="symmetric", iterations=4), se=T) plot(data, frame.plot=FALSE, xlab="", ylab="", col="#d95f0e", lwd=1.5) lines(x, plx$fit, col="black", lwd=3) ## Now let's add a confidence interval to the loess() fit... plot(data, type="n", frame.plot=FALSE, xlab="", ylab="", col="#d95f0e", lwd=1.5) polygon(c(x, rev(x)), c(plx$fit + qt(0.975,plx$df)*plx$se, rev(plx$fit - qt(0.975,plx$df)*plx$se)), col="#99999977") points(data, col="#d95f0e", lwd=1.5) lines(x, plx\$fit, col="black", lwd=3) ## Now that we know how those functions work... we can skip all that ## nasty stuff and just use ggplot2 with geom_point() and geom_smooth() library(ggplot2) ggplot(data=data, aes(x=x, y=y.norm)) + geom_point() + geom_smooth(span=1/5)