text:
# A modular Gruntfile

Grunt is a very powerful task runner and if you are developing in Javascript chances are you are probably using it. It’s configuration file defines all the tasks available and what they should do, but have you ever felt that even for mid-sized projects it easily becomes too big and hard to manage?

Well I felt that way, so that’s when I decided to split it into many smaller configuration files with the help of load-grunt-config. By following the excellent advice given by Paul Bakaus on his article on html5rocks, I came up with a cleaner and much more manageable setup.

Here I’ll try to build upon his article to add some more details about useful tricks I used in my setup.

## The brevity of YAML

Being at heart a Python developer, I love terse syntax. Why bother with unecessary brackets, commas or quotes which clutter your files making them harder to read for the human eye? Hence a move from a Javascript syntax to a YAML syntax for a configuration file is a big relief for me!

load-grunt-config supports many different kinds of syntax files, which can be mixed, allowing me to greatly reduce the noise in my configuration. If I initially had a Gruntfile like this:

module.exports = function (grunt) {

grunt.initConfig({
ngconstant: {
options: {
name: 'config',
dest: 'app/config/config.js',
constants: {
ENV: {
apiLocation: '',
appName: 'MyApp',
appVersion: pkg.version
}
}
},
development: {
constants: {
ENV: {
apiLocation: 'http://localhost:3000/api'
}
}
},
staging: {
constants: {
ENV: {
apiLocation: 'https://staging.example.com/api'
}
}
},
production: {
constants: {
ENV: {
apiLocation: 'https://api.example.com'
}
}
}
}
});
}

I would now have this as a Gruntfile:

module.exports = function (grunt) {
};

And I would create a YAML configuration file in grunt/ngconstant.yaml:

options:
name: 'config'
dest: 'app/config/config.js'
constants:
ENV:
apiLocation: ''
appID: 'MyApp'
appVersion: '<%= package.version %>'
development:
constants:
ENV:
apiLocation: 'http://localhost:3000/api'
staging:
constants:
ENV:
apiLocation: 'https://staging.example.com/api'
production:
constants:
ENV:
apiLocation: 'https://api.example.com'

Isn’t this cleaner? And it’s shorter, too!

Also notice how I did not have to manually parse my package.json to access its values? This is another nice feature of load-grunt-config’s which comes in handy. All you need to do is to read your values using a grunt template like '<%=package.version%>'.

In my project I used to have some variables holding some values shared by many different tasks. Lets take for instance the files list, which can be used by concat, but also by uglify or copy or whatever. So I had something like this:

module.exports = function (grunt) {

var files = [

// Application files
'app/**/*.module.js',
'app/module/**/*.js',
'app/component/**/*.js',
'app/service/**/*.js',
'app/app.js',

// Do not include tests in application build
'!app/**/*.test.js',
'!app/**/*_test.js'
];

grunt.initConfig({
jshint: {
options: {
jshintrc: true
},
all: {
src: [files]
}
},
uglify: {
production: {
src: files,
dest: 'dist/app/js/<%= package.name %>.min.js',
sourceMap: true
}
}
});
};

How can I do to share these values across tasks now that they each live in their own file? Well first I created a grunt/project.yaml file holding these values:

files:
# Application files
- 'app/**/*.module.js'
- 'app/module/**/*.js'
- 'app/component/**/*.js'
- 'app/service/**/*.js'
- 'app/app.js'
# Do not include tests in application build
- '!app/**/*.test.js'
- '!app/**/*_test.js'

And here’s the magic in the grunt/jshint.yaml file:

options:
jshintrc: true
all:
src:
- '<%= project.files %>'

And the same goes for grunt/uglify.yaml:

production:
src: '<%= project.files %>'
dest: 'dist/app/js/<%= package.name %>.min.js'
sourceMap: true

That was easy!

## Separating configuration files by environment

As you could see, in my project I use grunt-ng-constant to create an appropriate configuration file according to the environment. I also use grunt-env in combination with grunt-preprocess to configure my index.html file differently according to the environment. I wanted to have a single file with all the configuration for a single environment so that it would be easier to verify and change them, and once again load-grunt-config came to the rescue!

I used config grouping to do that:

# File: development-tasks.yaml
ngconstant:
constants:
ENV:
appVersion: '<%= package.version %>-dev'
apiLocation: 'https://devel.example.com/api'
env:
ENV: 'DEVELOPMENT'
THEME_CSS: 'css/mytheme.devel.css'

Using this configuration I can now have a separate file for each environment. The grunt/ngconstant.yaml and grunt/env.yaml files become like this:

# File: grunt/ngconstant.yaml
options:
name: 'config'
dest: 'app/config/config.js'
constants:
# These are all default values
ENV:
appName: 'MyApp'
appVersion: '<%= package.version %>'
apiLocation: 'https://api.example.com/api/v1'
# File: grunt/env.yaml
options:
THEME_CSS: 'css/mytheme.css'

As you can see, there are only the default options there and no environment specific configuration.

I also wanted to separate the environment-specific configuration files from the standard task configurations, so that the context would be clear. So I put them all in a config directory, which I created, and modified our Gruntfile.js:

module.exports = function (grunt) {

var path = require('path');

configPath: [
path.join(process.cwd(), 'grunt'), // Task settings here
path.join(process.cwd(), 'config') // Environment specific settings here
],

/*
* If you want to change your setting locally without changing what is on
* the repo, you can define your configuration overrides in config/override
*/
overridePath: [
path.join(process.cwd(), 'config', 'override')
],

});

};

load-grunt-config also supports overrides, which is another nice feature: as I set it up, you can create a configuration file in config/override which will override any previously set configuration option. This is very useful to accomodate the needs of every developer which might be a little different, without having them modify the files which are under versioning. Pretty neat!

## Conclusion

load-grunt-config is a very nice grunt plugin which really improves the quality of your Gruntfile by splitting it into many smaller files. Not only that: it adds a lot of useful features that will make you wonder why bother writing plain Gruntfiles anymore!

Do you use load-grunt-config in your project? Is there some other great feature I missed? Please leave a comment below!


text:
Gershgorin Circle Theorem to estimate the eigenvalues

In order to estimate the eigenvalues of a real symmetric $n\times n$ matrix, I intend to use the Gershgorin Circle Theorem. Unfortunately, the examples one might find on the internet are a bit confusing; What would be the mathematical formula for deriving the eigenvalue estimates?

I understand that certain disks are formed, each centered at the diagonal entry, with the radius equal to the summation of absolute values of the associated off-diagonal row entries. (The example from

http://en.wikipedia.org/wiki/Gershgorin_circle_theorem

is clear with the disks, but not with the eigenvalue estimation) Which steps to take from this point to get the estimates on the eigenvalues?

From Theorem 2.1 in

http://buzzard.ups.edu/courses/2007spring/projects/brakkenthal-paper.pdf

one could understand the eigenvalue $ranges$, but the example 2.3 from the above paper gives concrete eigenvalue estimates (some of which are negative). I would appreciate if someone explains this. I'm interested in the largest (positive) and smallest (possibly negative) eigenvalue estimates.

• A substantial reference on Gershgorin is Richard Varga: Gersgorin and his circles. – Martin Peters Oct 20 '14 at 10:52

In gerschgorin's theorem, the diagonal entries $A_{ii}$ of the matrix are the eigenvalue estimates, and the radii $r_i$ of the Gerschgorin disks are corresponding error bounds. Thus $\min_i A_{ii}-r_i$ is a lower bound on the eigenvalues, and $\max_i A_{ii}+r_i$ is an upper bound.

Note that these bounds are generally poor unless the off-diagonal entries are tiny. in the latter case, one can get excellent bounds by an appropriate prior similarity transform of the matrix with as suitable scaling matrix.

To get good bounds for a general matrix, one must compute an approximate eigensystem and then express the matrix in this basis by a simiarity transform. This doesn't change the eigenvalues but makes the off-diagonal entries small, so that the above applies.

• This is a great approach! – Paul Mar 30 '12 at 14:51

Gershgorin's Theorem provides a bound on where to find each eigenvalue, but it doesn't provide an algorithm to actually calculate them. You can take an initial guess $x_0$ within each Gershgorin disk, and use the shifted inverse power method to find the eigenvalue closest to $x_{0}$. But there is no guarantee that using one initial guess per Gershgorin disk will will necessarily lead to finding all eigenvalues, unless you know ahead of time that the disks are disjoint.

If you to learn more about this, you might take a look into Horn and Johnson's book on matrix analysis, they have a whole chapter on eigenvalue estimation with Gershgorin disks.

• Ok, I'll try to find it. – usero Mar 29 '12 at 19:13

format: plain


text:
# Thursday, March 20, 2014 Counting using bijections

Counting using bijections continued: labelled spanning trees in a graph, and Catalan numbers.

## 1Counting using bijections¶

### 1.1Labelled spanning trees¶

Let $G = (V, E)$ be an undirected graph where all $n$ vertices are labelled $1, \ldots, n$. Consider the number of distinct spanning trees (taking rotation/reflection into account) present in such a graph for different values of $n$:

• $n=1$: there's only one vertex, so there is clearly only one spanning tree (just the vertex itself). So: 1
• $n=2$: also only one spanning tree, as there's only one way to connect the two vertices. So: 1
• $n=3$: the vertices are 1, 2, and 3; we could create a spanning tree out of $1-2-3$, or $1-3-2$, or $3-1-2$. So: 3
• $n=4$: there are two types of configurations:
• if we put them in a straight line and connect them that way, there are 12 options:
• $1-2-3-4$ and $1-3-2-4$;
• $1-2-4-3$ and $1-4-2-3$;
• $1-3-4-2$ and $1-4-3-2$;
• $2-1-4-3$ and $2-4-1-3$;
• $2-3-1-4$ and $2-1-3-4$;
• $3-1-2-4$ and $3-2-1-4$.
• if we put one in the middle and put the other three around it, and connect them all to the middle, we have 4 options (one for each possibility in the middle)
• Total: 12 + 4. So: 16
• $n=5$: 125 (given by prof)

#### 1.1.1The formula¶

By quick inspection we can guess that the general formula for the number of labelled spanning trees is $t(n) = n^{n-2}$. Let's now try to prove this.

#### 1.1.2The proof¶

We can prove this using a bijection. Let $g(n)$ be the number of labelled spanning trees with a particular left vertex and a particular right vertex (they can be the same vertex). So $g(n) = t(n) \cdot n^2$, since there are $n$ choices for the left vertex and $n$ choices for the right vertex. Now, if $g(n) = n^n$, then we are done. Can we construct a bijection between $g(n)$ and something we know to be of size $n^n$?

Consider the set of strings of length $n$, composed using an alphabet of $\{1, 2, \ldots, n\}$. We know this to have size $n^n$. This is equivalent to the set of functions from $[n]$ to $[n]$, and we'll think of it using this formulation. Take any function $f: [n] \to [n]$. We can view $f$ as a directed graph - for each $x \in [n]$, we draw a node, and for all $x \in [n]$, we draw a directed edge from $x$ to $f(x)$. Thus each vertex will have an out-degree of 1, and an in-degree of at most $n$.

Thus can we split the graph into connected components, each of which is called an arborescence. So the resulting graph has one cycle for each arborescence, potentially with some trees hanging off of it.

Let $S \subseteq [n]$ be the set of nodes that are directly in a cycle (i.e., not merely hanging off of a cycle). For example, if $f(1) = 3$, $f(2) = 2$, $f(3)=2$, and $f(4)=1$, then there is only one cycle (when 2 loops back to itself), with the rest of the graph hanging off of it. So $S = \{2\}$.

Consider what happens when we restrict $f$ to $S$. That is, only consider $f$ on the domain $S$. Let $S_0$ be $\min(S)$ (i.e., the least element in $S$), and let $S_1 = \max(S)$. To find a labelled spanning tree from this, place the vertices in $S$ in $f$-order. So if $f(x)$ (on domain $S$) is given by

$x$ 1 4 5 7 8 9
$f(x) 7 9 1 5 8 4 Then 7 is the left vertex, 4 is the right vertex, and we have 9-1-5-8 in the middle. For the other vertices, connect them the way they are originally connected in the graph, since they're already trees. Thus we have all we need to create our bijection. To reverse the process - i.e., go from a labelled spanning tree to the original function - we do the following: Let$P$be the path from the left to the right vertex. In our example above, we would have 7-9-1-5-8-4. This is your$f$-order. To get the original order, just write it in ascending order: 1-4-5-7-8-9. Now draw this as a graph, using the initial$f$-order: 1 goes to 7, 4 goes to 9, 5 goes to 1, etc. Then we just add back the rest of the trees. From there, we can easily recover the original function based on the arcs in the forest.$\blacksquare$Note: we're not expected to be able to come up with a bijection like this for the final. However, we might get something similar but simpler, so it's a good idea to verify this bijection and try to understand it. ### 1.2Catalan numbers¶ How many sequences of$n$+'s and$n$-'s are there such that each partial sum (starting from the left) is non-negative? For example, when$n=3$, we have$+-+-+-$,$+-++--$,$++-+--$,$++--+-$, and$+++---$, so 5 total. What's the pattern? What's the number of Catalan numbers for general$n$? Well, whatever it is, it also happens to be equal to the number of paths from$(0, 0)$to$(2n, 0)$on the Cartesian plane using$n(1, 1)$steps (aka$\nearrow$) and$n(1, -1)$steps (aka$\searrow$), where we are never allowed to go below the$x$-axis. These are called Dyck walls (where Dyck is pronounced like "dike"). Clearly, the number of Dyck walks for a given$n$is equivalent to the number of Catalan numbers for the same$n$. We call this number$C(n)$. Theorem:$\displaystyle C(n) = \frac{1}{n+1} \binom{2n}{n}$Proof: Observe that there are$\binom{2n}{n}$paths from$(0, 0)$to$(2n, 0)$using$n\nearrow$'s and$n\searrow$'s, because you specify the$n$places (with no replacement) for the$\nearrow$s and the$\searrow$spots are determined by that (or vice versa). Now consider what fraction of these paths go below the x-axis. We'll call this number$D(n)$. Well, any path that goes below the x-axis hits the line$y=-1$at some point. Let$(q, -1)$be the first such point for a path$P$. Now split$P$into two sub-paths at$(q, -1)$, such that everything from$(0, 0)$to$(q, -1)$is part of path$P_1$, and everything from$(q, -1)$to$(2n, 0)$is part of$P_2$. By design, everything in$P_1$is$\geq$the line$y=-1$. What if we were to reflect$P_1$across this line, and call the result$P_1'$? Well, everything in$P_1'$would be$<$the line$y =-1$, except for the final endpoint which is at$(q, -1)$. Now create a new path$P' = \{P_1', P_2\}$. This is a path from$(0, -2)$to$(2n, 0)$, using$(n+1)\nearrow$s and$(n-1)\searrow$s, because we have one more$\searrow$than$\nearrow$in$P_1$and so$P_1'$would have one more$\nearrow$than$\searrow$s, and$P_2$must have one more$\nearrow$than$\searrow$as a result as well. So, because there are$n+1\nearrow$s, there are$\binom{2n}{n+1}$paths from$(0, -2)$to$(2n, 0)$. But this number is just$D(n)$! So we have $$D(n) = \binom{2n}{n+1}$$ Using this, we derive a formula for$C(n)\$:

\begin{align} C(n) & = \binom{2n}{n} - \binom{2n}{n+1} = \\ & = \frac{(2n)!}{n!n!} - \frac{(2n)!}{(n+1)!(n-1)!} \\ & = \frac{(2n)!}{n!n!} - \frac{(2n)!}{n!\cdot (n+1) \cdot (n-1)!} \cdot \frac{n}{n} \\ & = \frac{(2n)!}{(n!)^2} \cdot \frac{(n+1)}{(n+1)} - \frac{(2n)!\cdot n}{(n!)^2\cdot(n+1)} \tag{as (n+1)!\cdot n = n!} \\ & = \frac{(2n)!\cdot(n+1) - (2n)!\cdot n}{(n!)^2\cdot (n+1)} \\ & = \frac{(2n)!}{(n!)^2\cdot(n+1)} \tag{by cancelling} \\ & = \frac{(2n)!}{n!\cdot n!} \cdot \frac{1}{n+1} \\ & = \frac{1}{n+1} \binom{2n}{n} \end{align}


text:
# KeyError when generating translations

## Step-by-step guide

Localizable strings often include placeholder variable names that must be included precisely in each translation. If by mistake a placeholder name is misspelled, then you will see an error something like this:

Traceback (most recent call last):
File "/edx/app/edxapp/edx-platform/common/djangoapps/util/views.py", line 87, in inner
return func(request, *args, **kwargs)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/views/webview.py", line 574, in render_html_view
_update_certificate_context(context, user_certificate, platform_name)
File "/edx/app/edxapp/edx-platform/lms/djangoapps/certificates/views/webview.py", line 111, in _update_certificate_context
course_number=context['course_number']
KeyError: u'username'

In this example, the code was expecting to provide a variable called user_name but the translation accidentally switched it to username. Unfortunately the error message does not make clear what the problem is, but the solution is to correct the translation that has the incorrect placeholder.

See the following for more details:

• Page:
• Page:
• Page:


text:
## A community for students. Sign up today

Here's the question you clicked on:

## anonymous 5 years ago symmetry for problem y=1/x^2+1

• This Question is Closed
1. anonymous

Is this $\frac 1{x^2+1}$ ?

2. anonymous

If so, it should be symmetric about the y axis. Actually $frac 1{x^2} + 1$ should be symmetric about the y axis as well

#### Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy


text:
# I want an exact value of Pi

Use 1, 2, 2, 2 (Each number used exactly once) to form π.
I want an exact value of π, not any approximation.

Available operators:

+ - * / ( ) ^ !
You can use any one of them for any times.

Hint:

Think about a special feature of the "!".

• MathJax is very slow here. – Scratch---Cat Oct 27 '19 at 13:03
• Yes, I wouldn't recommend using MathJax unless it's necessary for things like fractions - for some people, it takes a while to load. (Here, you could easily just use the π character rather than switching to MathJax.) – Deusovi Oct 27 '19 at 15:06
• I want an exact value of π, not any approximation - I wholeheartedly endorse this message. – HTM Oct 27 '19 at 20:35
• Instead of the factorial do you mean the gamma function? It seems that the only answer provided erroneously uses the factorial rather than the gamma function (the factorial is only defined for positive integers). – N. Bar Oct 27 '19 at 22:43
• Well, not exact, but I remember it to 19 digits: 3.141592653589793238 – S.S. Anne Oct 27 '19 at 23:52

$$(2 \times (\frac{1}{2})!)^2$$
• @BlueRaja-DannyPflughoeft The gamma function is the standard way to extend factorials to the complex numbers. If you write $\alpha!$ for $\alpha\not\in\mathbb{N}$ in mathematics, this is assumed to mean $\Gamma(\alpha+1)$. See for example Wolfram Alpha and my experience as a mathematician in a field where gamma functions are used all over the place. – Rand al'Thor Oct 28 '19 at 6:15
• @Bass I disagree. Saying "the gamma function" explicitly would make the puzzle trivial and pointless. The exclamation point is not strictly integer-only in mathematics, and using it in this way makes for a very clever puzzle - kudos to the OP. If you don't believe me, all I can do is point to the evidence in my previous comment. I work with factorials and gamma functions every day, and use $\alpha!$ completely interchangeably with $\Gamma(\alpha+1)$. – Rand al'Thor Oct 28 '19 at 21:30


text:
Why are regressors squared and not ^1.5 or ^2.2 or ^2.5?

When a researcher in economics or finance wants to apply a linear regression model but suspects a non-linear relationship between one of the regressors and the dependent variable, it is typical to also include the square of that regressor, then (maybe, but usually not) do something like a Ramsey RESET test afterwards.

My question is; why square it? Why not take the exponent (call it $x$) to be $x \in [1.5,2.5]$, for example? Getting the right "shape" of the line is impotant to make the assumption $E[\epsilon_i | \mathbf{X}]=0$ hold; there may be cases where $x=2$ does this well but in other cases something like $x=1.8$ might me more sensible.

Here, of course, I'm talking about variables that assume strictly positive values so we don't get complex outcomes. An example is $Age$ in education$\to$income studies.

-
The main reason is parsimony. – John Dec 4 '12 at 15:03
@John I don't understand. Do you mean that it's like this because $2$ looks prettier than $x\in[1.5,2.5]$? Surely parsimonious should be defined statistically instead of based on how pretty something looks from a qualitative perspective. – Jase Dec 4 '12 at 22:50
Instead of performing a non-linear least squares routine, the researcher has effectively imposed constraints on the coefficient. They want to handle non-lineraities without too many extra variables. So they just square it. Parsimony. – John Dec 4 '12 at 23:12
@John What are these extra variables? – Jase Dec 4 '12 at 23:25
Because a negative number raised to a non-integer exponent is complex. Of what use would regressing physical economic values have here? – pat Dec 5 '12 at 5:11

I basically agree with @John, let me expand:

We want to model $y$ using a simple linear model, the most basic setup is $$y = c + \mathbf{X}\beta$$ with $y$ the $N$ observations, $c$ a constant, $\mathbf{X}$ the $N \times M$ matrix of regressors and $\beta$ a $M$-dimensional vector of coefficients. This model has $M$ parameters, the elements of $\beta$.

The above model is estimated and the Ramsey RESET test finds that the model to be misspecified and the researcher wants to fix this. As you propose the above model is easily extended $$y = c + \mathbf{X}\beta + \mathbf{X}'\gamma$$ where $\mathbf{X}'_{i, j} = \mathbf{X}_{i, j}^{e_i}$, $\mathbf{e}$ is a $M$-dimensional vector and $\gamma$ a $M$-dimensional vector of coefficients. This model has $3M$ parameters, the elements of $\beta$, $\gamma$ and $e$ and much harder to estimate because of the nonlinearity.

This can be easily solved by fixing all $e_i$ a priori. This yields another question: to which value do we fix it? As @pat notes, raising to a non-integer is a bad idea in the general case. But, as you note, one could use the absolute of the regressor raised to a rational exponent since $f(q) = |a^q|$ is continuous and real for all real $q \in \mathbb{Q}$. So why the insistence on integer valued exponents? One simple reason is laziness: it is much simpler to compute $x^2$ than $x^{1.95}$, a second reason is convention. A third reason is that small changes in the exponent have a small impact on the model. These arguments do not apply to the case where a rational exponent would yield a significant improvement. Unfortunately this has severe methodological problems: as argued above, making the exponent parameters makes estimation much harder and, perhaps more importantly, reduces parsimony. The last option of fixing the exponent is possible. However it would require a strong economic argument to defend this particular choice. If your application is such that it is absolutely clear that exponentiation with $q \in \mathbb{Q}$ is justified then you're free to do that. There are no methodological problems that I know of. But prepared for your critics who will notice and wil require justification of your particular choice for $q$.

Another reason to choose $e_i = 2$ is the symmetry with taking cross products of the regressors, from this perspective is a square is a cross product with itself.

-
Very nice response. Could you address my reply to @pat in the comments section? Then I will accept the answer. – Jase Dec 6 '12 at 5:22

What you are talking about is called regression using fractional polynomials and it has its merits.

The canonical reference is this one:
Regression Using Fractional Polynomials of Continuous Covariates: Parsimonious Parametric Modelling by Royston and Altman (1994)

From the abstract:

The relationship between a response variable and one or more continuous covariates is often curved. Attempts to represent curvature in single- or multiple-regression models are usually made by means of polynomials of the covariates, typically quadratics. However, low order polynomials offer a limited family of shapes, and high order polynomials may fit poorly at the extreme values of the covariates. We propose an extended family of curves, which we call fractional polynomials, whose power terms are restricted to a small predefined set of integer and non-integer values. The powers are selected so that conventional polynomials are a subset of the family. Regression models using fractional polynomials of the covariates have appeared in the literature in an ad hoc fashion over a long period; we provide a unified description and a degree of formalization for them. They are shown to have considerable flexibility and are straightforward to fit using standard methods. We suggest an iterative algorithm for covariate selection and model fitting when several covariates are available. We give six examples of the use of fractional polynomial models in three types of regression analysis: normal errors, logistic and Cox regression.

...and you might have guessed it: There is an R-package for that :-)

mfp: Multivariable Fractional Polynomials

-
Nice find, I will have to check that out. – Bob Jansen Aug 6 '13 at 10:01


text:
Late in the afternoon I had a spur-of-the-moment idea and hopped on the train into the city. After a few weeks of knowing that a cousin is somewhere in Melbourne, but probably busy being an English backpacker and doing whatever English backpackers do, I decide to go and find him rather than wait for him to find me. Almost didn’t get there, the ticket machine on the platform decided to reject my $5 note a few times before finally spitting out a ticket, I grabbed it and dived on board as the doors were closing, forgetting — of course — to validate the ticket. Change at Flinders Street station, then around to Spencer street, an unholy nightmare of a construction site — the whole place is boarded up and barricaded off, misleading scraps of paper thumb-tacked to hoardings redirect passengers around in all directions. My ticket won’t let me out the gates because I haven’t validated it getting in, so I have to get it validated on the spot, a minor hassle. Off down the street to the backpackers’ on the corner to see if I can find Ben. First attempt is unsuccessful, I try the wrong surname — that side of my family tree is convoluted at best, and I have trouble remembering who has what name. I retire to the bar next door and order a beer — cheap, cool and flat — just how the English travellers like it. Inspiration strikes and I head back to the reception desk and try again with the right surname… success! A big catch up in the bar over a few drinks, Ben and I haven’t seen each other since he was about ten, so many things have changed! Finally we decide to head over to Richmond and meet Jo for dinner. Ben goes to get changed, I ring Jo, we finish our drinks and off down the road to jump on a tram…. Of course I didn’t bother validating my ticket, nobody does, I knew it was still valid from the train ride in…. As we were getting off at Richmond Town Hall, we were suddenly surrounded by four inspektors, insisting on seeing our tickets — of course mine had expired as a result of the combination of beer, laziness and carelessness. The inspektors make us stay on the tram and miss our stop, but let us off a block later after a good few minutes of stand-over multi-person interrogation and intimidation. Names and details are exchanged, we are separated and quizzed individually, finally allowed to leave and told that in the next two weeks we may or may not receive a$150 fine each.

Finally we get to to catch up with Jo, who is starting to wonder where we’d got to. Dinner was fun, but it was an expensive evening!


text:
## Monday, January 18, 2016

### Take the train and see America (very slowly)!

I've been meaning to write up a little something about our Christmas travels this last year in which we took Amtrak home instead of our usual flight. Usually we spend something like $400/person for our airfare between SEA & MSP, and I think we've had to pay as much as$500. Turns out a lot of people travel around Christmas, and supply and demand means it costs more to travel at that time of year. Go figure.

On the other hand, I found that one-way airfare (SEA->MSP) was only about $125/person, and a one-way train ticket was$150/adult, $75/child. After taxes and fees, we spent$600 to fly to Minnesota and about $500 to take the train. For all four of us. On the other hand, a return flight would be something like 3.5hrs versus 34hrs for the train, so we're trading a day and a third for$1000ish savings. And the experience of seeing the country.

The St. Cloud Amtrak station is about as big as one airport terminal gate seating area but with no coffee or gift shops. Instead, there was a broken water fountain and a (working!) 7-Up machine from the Taft administration.

We got to the station around 11:30pm after a busy day at my parents' house. Both boys zonked out for a while, though Jacob had been so extremely tired that before falling asleep, he got a severe case of the sillies and was Andrea's and my comic relief for about twenty minutes.

When the train arrived around 12:40am, we carried the boys outside, but they woke up on their own, extremely excited to take the train. Jacob told me, "Dad, it's real! I pinched myself and it hurt!"

Once on the train, we found the seats to be pretty comfortable, the ride smooth, accommodations... acceptable. The boys actually enjoyed it surprisingly well.

Though the ride took a day and a half, we were at least able to get out at several of the stops (though I only did so on one).

Unfortunately, the better part of our daylight on New Years Eve day was through North Dakota and Montana -- all very flat and boring. We did have a nice sunset, however.

By the time we got to Glacier, it was nighttime and nothing to see. We got to Spokane around midnight-ish, and we didn't get any light until around the Cascades. The snow-covered trees and mountains were beautiful, though unfortunately, we were so close that we didn't get any good shots of the scenery.

The western side of the Cascades were a nice welcome home.

The final stretch from Everett to Seattle was right along the Sound and was gorgeous, though I was too busy gawking at it to take any pictures. The arrival at King Street Station was a nice break to stretch and walk around before we hopped into a taxi to get home.

All in all, it was a good experience. I'm glad we did it -- not just because it barely offset the cost of boarding Shasta for our two week trip, but it was also was a fun experience in and of itself. Hard to say, though, whether and when we'll do it again.

## Friday, November 27, 2015

After entirely too long, I returned to Mailbox Peak today with my hiking buddy. When I grabbed the leash and other hiking gear, she was elated, happily jumping into the car. The long drive out to and past North Bend was tiring, though.

We took the old trail up, which is a pretty grueling 4000' elevation gain over a mere 2.6 miles. Shasta had no problem whatsoever with the hike.

I, however, got wrecked, having done only two other hikes since my June summit of Mount Shuksan, one of which being last month's trip up Mount Saint Helens. I bonked around 1.5-2.0mi in, allowing Shasta to drag my ass up the rest of the way to the beautiful scenery of the Cascades and Mount Rainier. She was quite happy up there.

But I could barely walk.

I thought the descent might be made better by using the new trail, a 4.7mi descent instead of 2.6. That was all well and good, but it was significantly more snowy and icy than the old trail and took so long that I was stumbling all the way back to the car.

Up until today, I had been very adamant about the rule that dogs must always be on leashes. In fact, when Shasta was walking under a felled log, I didn't even let go of the leash while transferring it. However, having spent a good half hour without seeing another person, I decided to try letting her off-leash to see how she would do.

After maybe five minutes of her sprinting up ahead 50 yards or so then doubling-back to me, lather, rinse, repeat, she finally got into a good routine of staying within maybe 10-20 feet of me. (For what it's worth, I put her back on-leash immediately when we did eventually run into hikers. I then took her back off, and she did phenomenally every time.)

We got home and Shasta climbed onto the couch to curl up and rest. After my supremely weak-sauce performance for the day, so did I. Roughly 5.5hrs for the 7.3mi round-trip plus travel time, it left much to be desired. But it was good to be back on the mountain again.

## Thursday, October 29, 2015

### Another year at Microsoft, another position change

A little over a year ago, I moved from Bing to DX, part of Microsoft's evangelism group to work on a project that still has not yet been disclosed. Tomorrow will be my last day within DX as I move to the Windows and Devices Group (WDG) to work yet again on some truly big data + machine learning.

In Bing, I worked on a few projects utilizing Microsoft's Cosmos distributed and massively parallel processing system before moving over to do some tented work on Azure and websites and other secret things. Starting next week, I'll once again be doing severely large-scale work in analytics and prediction, with some natural language stuff thrown in for good measure. Or so I'm lead to understand.

The position sort of fell into my lap, so it's with some trepidation that I'm leaving a project where I get to do some cool stuff and implement a lot of neat features -- which, of course, I can't yet discuss. Maybe once my soon-to-be-former team goes public, I'll do some blog posts about what I've been doing.

## Saturday, October 3, 2015

### Climbing Mount Saint Helens

Yesterday, I climbed Mount Saint Helens with my friends Tim and Mike. We started at Climber's Bivouac at 6am. After about an hour, when starting to get above much of the dense forest, we got an amazing view of the sunrise.

 Sunrise looking at Mt. Adams (left) and Mt. Hood (right)

 Looking through the trees at a layered sunrise.

In short order, we reached the treeline and the start of the very rocky, ashy incline up the mountain.

 Mike looking up the trail
It quickly turned to a straight shot up the mountain over decently sized boulders.

When we started off, it was rather foggy at Climber's Bivouac. Throughout the day, the clouds stayed down at the bottom, providing a beautiful blanket across the national forest.

Scrambling up all the volcanic rock made some form of gloves a very useful addition to my gear for the day.

A couple years ago, I bought the boys some small stuffed black bears at REI. Reed's bear "Junior" somehow got lost in some of my gear, so I had a stowaway for the day.

The last 1000' or so vertical feet was through very soft ash and gravel. Here, I'm looking down the mountain at Mike, Tim, and the dozens of other climbers.

At the top, the wind varied from nil to extremely strong, blasting sand into our faces. Between that and the sun, I'm a super squinty guy.

We had an amazing view of the crater, lava dome, etc. I tried to get a few decent panoramas to try to illustrate how incredible the sight is. Here's a decent stitch; the steam coming out of the middle is, I believe, methane gas.

I got a quick shot at the top showing how windy it was:

It took us a little over five hours (6:00-11:20) to get to the top. The descent back to the Bivouac took until 15:00, but not without a few more photo ops:
 Looking back up the mountain during the descent

 Junior was on the mountain illegally, as he didn't have his own permit.

## Monday, September 14, 2015

### Processing en.wikipedia into n-grams

The website Memrise features a number of courses (prominently languages, but other subjects as well) and a method to help you learn them quickly and efficiently. Curious about how the courses are setup, I recently took a look at the ESPDIC 52,303 Vortoj course -- a course based upon the Esperanto-English dictionary. The dictionary contains 52k records of Esperanto-English translations such as:

aerohaveno : airport
aerokondukilo : air duct
aerolita : aerolitic
aerolito : meteoric stone, meteorite, aerolite

The purpose of the Memrise course is to help would-be Esperanto speakers with learning the language effectively. I took a look at the first lesson and found a number of words of varying difficulty. Some were pretty obvious, such as kiloneŭtono for kilonewton. Others, however, were rather baffling.

It turns out belles-lettres is a form of writing which values aesthetic qualities. It's the "department of literature which implies literary culture and belongs to the domain of art, whatever the subject may be or the special form; it includes poetry, the drama, fiction, and criticism." I'm rather confident in saying that I had never heard of this term before in my thirty-some years, and in learning another language, this would be very low on my list of terms to learn.

Similarly, the very first lesson in this course also introduces the Esperanto word jemenano (for "Yemini," a person from Yemen) -- also a word that is of extremely little value to me according to its frequency of use.

So I decided to see if I could come up with a more appropriate ordering of this course's astounding 3495 lessons with 15 words/lesson.

Assuming the frequency of English words in a sufficiently large corpus is a good basis, I downloaded the full en.wikipedia data dump from 2015-08-05, a 12.2gb bz2 XML file consisting primarily of the wiki markup for each article as well as some other information such as who made the most recent edit. This download itself was a pain on my internet connection, but in short order, I had a 50.2gb XML file staring me in the face.

I figured the two biggest problems with this file was that it was entirely too large to easily work with and the text in which I was interested contained unnecessary wiki markup.

### XML->TXT

Trying to validate such a huge file would be nearly impossible, but being the seventh-most-visited website, I figure their XML is valid. Extracting the markup proved straightforward[1]:

More painful, however, is removing the wikipedia markup. There are already methods of doing this[2], but none as simple as invoking a single exe from a command prompt, which is what I was aiming for:
> ProcessWikipedia -input enwiki-20150805-pages-articles.xml -output plaintext.dat
I found no suitable libraries for parsing wiki markup that worked; Wiki .NET Parser sounded like it may do the trick, but it failed, leaving horribly mangled results in its wake. And as exciting as writing a full-on parser with ANTLR sounded, I wanted an end result and not a process. So I started writing regular expressions to handle many markup tags as I could find:

Remove [[Category:Constructed_languages]]@"$\[(?!(?:Category|File):)(?:[^|\[$]+?\|)?([^]+?)\]\]"

Remove external links: @"$[^\[$]+(?: ([""']*)([^""]+)\1)\]"

And so on.

I saved the results to an extremely simple binary file, omitting disambiguation pages, special pages, and redirects, keeping only the article's title and the reasonably well-cleaned plaintext:

### TXT->NGrams

With such a huge corpus, I started using 1-grams -- that is, simple frequency counts of individual words ("the", "aeroplane", "flies"), and in the future will look to 2-grams ("the aeroplane", "aeroplane flies") for the simple reason of not enough computer for such a huge task. Unfortunately, with the entire corpus, a simple in-memory Dictionary<string, intwould not hold everything. (Indeed, trying this gave me an OutOfMemoryException.)

Rather than use the sledgehammer that is Hadoop, I opted for a leaner solution in SQLite, taking nearly 12hrs on my little laptop to process the entire corpus which, in the end, spit out a 17.5mb list of key-value pairs.

### Further Work

As of publication, the plaintext processing still has some kinks to work out, so the n-grams contains terms that are invalid (incorrectly processed) or are unintentional results of processing. These are most noticeable at the very end of the histogram tail:

contractexpress 10
*chernushka     10
hirschig's 10
m_{\mathrm 10
\bar{m}_{\mathrm 10
furd’s     10
antennolaelaps  10
euepicrius 10
**euryparasitus 10
protocoltcp     10

I would argue that these should be eliminated and the size of the file dramatically reduced simply by setting a cutoff higher than 10. In fact, using a cutoff of 1000 eliminates all but 3.98% of all terms, but it still gives you 94.53% of coverage of the English language -- an excellent example of the Pareto Principle.

Using this cutoff, you get rid of words such as "filosa", "muhsuds", "unmanoeuvrable" [sic], "anti-u-boat" and more, while still keeping "fasting", "dutton", "headlining", "cemented", and "barometric."

Here's a graph showing the cutoff and coverage of terms. Ten-thousand would reduce the number of unique terms again a fifth, but then you lose terms such as "sandwich", "loops", and "decreases".

In an upcoming post, I'll discuss the use of word frequencies to more appropriately order the ESPDIC dictionary and build a Memrise course.

## Saturday, September 5, 2015

Not terribly long ago, Google added their Google Play Music radio stations with a free, ad-supported version for everyone. Aside from the fact that their recommendations are terrible in my experience, they've nerfed their user experience. Just yesterday, in fact, I wanted to play the song The Pretender on my phone. Here's the result screen from my search:

While their auto-generated The Pretender Radio station is at least relevant, it's not what I am looking for -- the song I have played many times on my phone is nowhere to be seen.

I don't even get to my intended result until I scroll down. Here's what the full pane looks like:

Of the entire result pane, less the operating system's top bar and Music's top search bar and bottom music controls, about 11% of the real estate -- all of it below the initial view -- is devoted to what I'm looking for, and what I ultimately clicked on.

The radio stations have become a big pain point for me lately, as I tend to play music almost exclusively from Google Play Music, either on my phone or on my work or home laptops. The pain comes partially from their A1 position on nearly every screen but also from the fact that Google apparently isn't taking the hint that I don't use it and isn't letting me collapse or hide this section.

Their desktop experience isn't much better, yielding about 26% after discounting the search bar and controls:

The first project I worked on in Bing measured dissatisfaction (referred to as DSAT) with search results in XBox Music and Video search results. For example, when you search for "seven" in the context of videos, you might expect to see the results "Se7en", "Seven Years in Tibet", "Seven Samurai", and more. Ideally, the first result is the one you wanted, and if you clicked on the fifth one or if you didn't click any, that is a DSAT -- the results were poor. We took those data and learned from it to improve the quality of the results.

I imagine Google has some sophisticated ML to do exactly that; however, this is not an engineering problem. It's a simple matter of understanding what your users want, and at least in my humble opinion, this ain't it.

## Wednesday, July 22, 2015

### Riding bikes: zero to sixty in one day

We've been trying to get our boys to learn to ride their bicycles for years. They never really liked riding with training wheels, and when we took away the training wheels, they wanted them back. (That didn't happen.)

When we lived in Magnolia, Andrea and I took the boys to the Discovery Park basketball court to learn to ride a few feet. Jacob dug his heels in so far that it took convincing Reed to ride to motivate Jake to try it. They each rode unassisted for a few feet before promptly declaring their retirement from the sport.

A couple weekends ago, when Andrea was away for the day with one of her clients, I decided we'd take some baby steps toward riding bikes. I was so committed to baby steps, in fact, that I told them they'd only be riding a few feet. I drew a start line and the finish line. By the time Jacob saw how short a distance he'd have to go (which apparently was motivating for him), he decided he'd write the word "FINISH."

As I'm sure is the case with most kids learning to ride, his body tensed up and he began to shake when he mounted his bike (which, by the way, he named Sophie). I told him that he would only have to try it, I'd help him, and he'd have to go no farther than the finish line.

He made it across once with me holding the bicycle seat the whole time. We returned to the start and did it again. And by the third time, I was able to let go for a fraction of a second. By then, he was so terrified that he declared he was done and went inside to read. Then he and Reed decided they wanted to go to the store on their scooters.

Maybe it was the three mile round-trip on scooters that made them see the folly of their scooting ways. Maybe the painfully slow uphill trek. Maybe Reed's exhaustion that required I backpack his scooter and try to ride with him on the seat and me dangling precariously off the edge of my seat. Or maybe just the incredibly small successes earlier in the day that had time to reassure him. Either way, not long after we got home -- and after Andrea had returned -- Jacob was ready for another go on his bike. Our second round of the day went from a second or two of solo riding to twenty feet to nearly the length of our street with an unassisted, controlled stop.

It was an unqualified success -- so much so that a few minutes later, when I went inside for some water, Reed came inside looking for his helmet and exclaimed, "Jacob's going to help me learn to ride my bike!"

As exciting and heartwarming as that was -- not only because of the brotherly love from both sides but also because Jacob was so quickly turned around on his opinion of bikes -- I figured he wasn't ready to help his brother. I returned outside and ran Reed through the same process. After he was able to do the same, Andrea and I called the grandparents to let them know of our major breakthrough.

While on the phone -- and without any help from us -- they had both learned on their own to start from no momentum, to ride around in circles, and even to control their balance while riding uphill.


text:
Review question

Ref: R5642

## Suggestion

The graph $y=f(x)$ of a function is drawn below for $0 \le x \le 1$.

The trapezium rule is then used to estimate

$\displaystyle\int_0^1 \! f(x) \, \mathrm{d}x$

by dividing $0 \le x \le 1$ into $n$ equal intervals. The estimate calculated will equal the actual integral when

1. $n$ is a multiple of $4$;

2. $n$ is a multiple of $6$;

3. $n$ is a multiple of $8$;

4. $n$ is a multiple of $12$.

The notation $\displaystyle\int_0^1 \! f(x) \, \mathrm{d}x$ means the area between the $f(x)$ and the $x$-axis, from $x=0$ to $x=1$.


text:
# [NTG-context] First letter lost possible cause: \grabbfferdata

Rik Kabel context at rik.users.panix.com
Wed Jun 25 21:51:57 CEST 2014

Recently there have been reports of the first letter of a line of text
being lost in the database and letter modules.

I tracked down what appears to be the same problem and developed a
work-around.

The problem appears to be with the \grabbufferdata command. Something
has changed in the way it works, and it now swallows the first token of
the buffer that it grabs. It may also show up with other commands, but
this is the only one I have found in my projects.

If you have code with this command, a workaround is to insert
\ignorespaces after it. I have no idea why this helps. If you do not
have the code (if it is in somebody else's module), then using a blank
line or dummy argument or \relax after the command that calls the code
with \grabbufferdata may help.

The following code shows the issues and these workarounds.

% macros=mkvi

\starttexdefinition unexpanded startNoIgnore
\begingroup
\dostartNoIgnore
\stoptexdefinition
\starttexdefinition dostartNoIgnore
\grabbufferdata[Test][startNoIgnore][stopTest]
\stoptexdefinition

\starttexdefinition unexpanded startWithIgnore
\begingroup
\dostartWithIgnore
\stoptexdefinition
\starttexdefinition dostartWithIgnore
\grabbufferdata[Test][startWithIgnore][stopTest]
\ignorespaces
\stoptexdefinition

\starttexdefinition stopTest
\getbufferdata[Test]
\endgroup
\stoptexdefinition

\define\TestText
{\qquad If you can read this the first token was not swallowed.}

\starttext

\subject{Test without \tex{ignorespaces}}

First, the problem:

\startNoIgnore\TestText\stopTest

And the same with \type{{}}

\startWithIgnore{}\TestText\stopTest

Workaround with \tex{relax}

\startNoIgnore\relax\TestText\stopTest

Workaround with blank line

\startNoIgnore

\TestText\stopTest

\subject{Test with \tex{ignorespaces}}

This now works:

\startWithIgnore\TestText\stopTest

And the same with \type{{}}

\startWithIgnore{}\TestText\stopTest

And the same with \tex{relax}

\startWithIgnore\relax\TestText\stopTest

And the same with a blank line after the opening

\startWithIgnore

\TestText\stopTest
\stoptext

--
Rik Kabel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ntg.nl/pipermail/ntg-context/attachments/20140625/900939bf/attachment.html>


text:
Article Contents
Article Contents

# On the integral systems with negative exponents

• This paper is concerned with the integral system $$\left \{ \begin{array}{ll} &u(x)=\int_{R^n}\frac{|x-y|^\lambda dy}{v^q(y)},\quad u>0~in~R^n,\\ &v(x)=\int_{R^n}\frac{|x-y|^\lambda dy}{u^p(y)},\quad v>0~in~R^n, \end{array} \right.$$ where $n \geq 1$, $p,q,\lambda \neq 0$. Such an integral system appears in the study of the conformal geometry. We obtain several necessary conditions for the existence of the $C^1$ positive entire solutions, particularly including the critical condition $$\frac{1}{p-1}+\frac{1}{q-1}=\frac{\lambda}{n},$$ which is the necessary and sufficient condition for the invariant of the system and some energy functionals under the scaling transformation. The necessary condition $\frac{1}{p-1}+\frac{1}{q-1}=\frac{\lambda}{n}$ can be relaxed to another weaker one $\min\{p,q\}>\frac{n+\lambda}{\lambda}$ for the system with double bounded coefficients. In addition, we classify the radial solutions in the case of $p=q$ as the form $$u(x)=v(x)=a(b^2+|x-x_0|^2)^{\frac{\lambda}{2}}$$ with $a,b>0$ and $x_0 \in R^n$. Finally, we also deduce some analogous necessary conditions of existence for the weighted system.
Mathematics Subject Classification: 45E10, 45G15, 45M05, 45M20.

 Citation:

•  [1] G. Caristi, L. D'Ambrosio and E. Mitidieri, Representation formulae for solutions to some classes of higher order systems and related Liouville theorems, Milan J. Math., 76 (2008), 27-67.doi: 10.1007/s00032-008-0090-3. [2] A. Chang and M. del Mar Gonzalez, Fractional Laplacian in conformal geometry, Adv. Math., 226 (2011), 1410-1432.doi: 10.1016/j.aim.2010.07.016. [3] W. Chen and C. Li, Classification of solutions of some nonlinear elliptic equations, Duke Math. J., 63 (1991), 615-622.doi: 10.1215/S0012-7094-91-06325-8. [4] W. Chen and C. Li, Regularity of solutions for a system of integral equations, Commun. Pure Appl. Anal., 4 (2005), 1-8.doi: 10.3934/cpaa.2005.4.1. [5] W. Chen and C. Li, An integral system and the Lane-Emden conjecture, Discrete Contin. Dyn. Syst., 24 (2009), 1167-1184.doi: 10.3934/dcds.2009.24.1167. [6] W. Chen, C. Li and B. Ou, Classification of solutions for a system of integral equations, Comm. Partial Differential Equations, 30 (2005), 59-65.doi: 10.1081/PDE-200044445. [7] W. Chen, C. Li and B. Ou, Classification of solutions for an integral equation, Comm. Pure Appl. Math., 59 (2006), 330-343.doi: 10.1002/cpa.20116. [8] Z. Cheng and C. Li, An extended discrete Hardy-Littlewood-Sobolev inequality, Discrete Contin. Dyn. Syst., 34 (2014), 1951-1959.doi: 10.3934/dcds.2014.34.1951. [9] Y. Choi and X. Xu, Nonlinear biharmonic equations with negative exponents, J. Differential Equations, 246 (2009), 216-234.doi: 10.1016/j.jde.2008.06.027. [10] J. Davila, I. Flores and I. Guerra, Multiplicity of solutions for a fourth order problem with power-type nonlinearity, Math. Ann., 348 (2010), 143-193.doi: 10.1007/s00208-009-0476-8. [11] B. Gidas and J. Spruck, Global and local behavior of positive solutions of nonlinear elliptic equations, Comm. Pure Appl. Math., 34 (1981), 525-598.doi: 10.1002/cpa.3160340406. [12] Z. Guo and J. Wei, Liouville type results and regularity of the extremal solutions of biharmonic equation with negative exponents, Discrete Contin. Dyn. Syst., 34 (2014), 2561-2580.doi: 10.3934/dcds.2014.34.2561. [13] Y. Hua and X. Yu, Necessary conditions for existence results of some integral system, Abstr. Appl. Anal., (2013), Art. ID 504282, 5 pp. [14] C. Jin and C. Li, Qualitative analysis of some systems of integral equations, Calc. Var. Partial Differential Equations, 26 (2006), 447-457.doi: 10.1007/s00526-006-0013-5. [15] Y. Lei and C. Li, Sharp Criteria of Liouville Type for some Nonlinear Systems, arXiv:1301.6235, 2013. [16] Y. Lei, C. Li and C. Ma, Asymptotic radial symmetry and growth estimates of positive solutions to weighted Hardy-Littlewood-Sobolev system, Calc. Var. Partial Differential Equations, 45 (2012), 43-61.doi: 10.1007/s00526-011-0450-7. [17] Y. Lei and Z. Lü, Axisymmetry of locally bounded solutions to an Euler-Lagrange system of the weighted Hardy-Littlewood-Sobolev inequality, Discrete Contin. Dyn. Syst., 33 (2013), 1987-2005.doi: 10.3934/dcds.2013.33.1987. [18] Y. Li, Remark on some conformally invariant integral equations: The method of moving spheres, J. Eur. Math. Soc., 6 (2004), 153-180. [19] Y. Li and M. Zhu, Uniqueness theorems through the method of moving spheres, Duke Math. J., 80 (1995), 383-417.doi: 10.1215/S0012-7094-95-08016-8. [20] E. Lieb, Sharp constants in the Hardy-Littlewood-Sobolev and related inequalities, Ann. of Math., 118 (1983), 349-374.doi: 10.2307/2007032. [21] L. Ma and J. Wei, Properties of positive solutions to an elliptic equation with negative exponent, J. Funct. Anal., 254 (2008), 1058-1087.doi: 10.1016/j.jfa.2007.09.017. [22] P. J. McKenna and W. Reichel, Radial solutions of singular nonlinear biharmonic equations and applications to conformal geometry, Electron. J. Differential Equations, (2003), 1-13. [23] Ph. Souplet, The proof of the Lane-Emden conjecture in 4 space dimensions, Adv. Math., 221 (2009), 1409-1427.doi: 10.1016/j.aim.2009.02.014. [24] S. Sun and Y. Lei, Fast decay estimates for integrable solutions of the Lane-Emden type integral systems involving the Wolff potentials, J. Funct. Anal., 263 (2012), 3857-3882.doi: 10.1016/j.jfa.2012.09.012. [25] X. Xu, Exact solution of nonlinear conformally invarient integral equations in $R^3$, Adv. Math., 194 (2005), 485-503.doi: 10.1016/j.aim.2004.07.004. [26] X. Xu, Uniqueness theorem for integral equations and its application, J. Funct. Anal., 247 (2007), 95-109.doi: 10.1016/j.jfa.2007.03.005. [27] X. Yu, Liouville type theorems for integral equations and integral systems, Calc. Var. Partial Differential Equations, 46 (2013), 75-95.doi: 10.1007/s00526-011-0474-z.


text:
# Without performing actual computations, find the quotient when $94 - 49$ is divided by(i) 9.(ii) 5.

#### Complete Python Prime Pack for 2023

9 Courses     2 eBooks

#### Artificial Intelligence & Machine Learning Prime Pack

6 Courses     1 eBooks

#### Java Prime Pack 2023

8 Courses     2 eBooks

Given:

$94 - 49$

To do:

We have to  find the quotient when $94 - 49$ is divided by

(i) 9.

(ii) 5.

Solution:

(i) We know that when $ab-ba$ is divided by $9$ then the  quotient is $(a-b)$.

The digits of the given numbers 94 and 49 are reversed.

Here,

$a = 9, b = 4$

$a-b=9-4=5$

If $94 -49$ is divided by $9$, then the quotient is $a-b=5$.

(ii) We know that when $ab-ba$ is divided by $(a-b)$ then the  quotient is $5$.

The digits of the given numbers 94 and 49 are reversed.

Here,

$a = 9, b = 4$

$a-b=9-4=5$

If $94 -49$ is divided by $5$, then the quotient is $9$.

Updated on 10-Oct-2022 13:19:16


text:
# Merging many rasters with Python script within QGIS using GDAL?

I have many rasters that im trying to combine in order to produce contours. They are in the .bil format so I understand that i need to translate them using gdal first but none of my attempts have worked.

I have tried to used gdal_translate and gdal_merge with no success.

import os
import sys
import gdal
chdir C:\Users\jeswa\Desktop\GAL
SDKShell.bat
chdir C:\Users\jeswa\Desktop\TESTY
dir /s/b *.bil >listbil.txt
gdalbuildvrt -input_file_list listbil.txt testscript.vrt
#error does not like N34025raster but passes 44 and 45
gdal_translate -of GTiff C:\Users\jeswa\Desktop\TESTY\testscript.vrt C:/Users/jeswa/Desktop/TESTY/VIRTUALTIFF.tif
#no such thing as gdal_translate apparently

• What error messages are you getting? What is the value of your %PATH% after SDKShell? I use a very similar process to this and it works well; you could try CD c:\your\path\to\GDAL\bin so you can (hopefully) find translate. – Michael Stimson Jul 2 at 0:26
• i’ve decided to skip the translate and produce contours from my vrt, is this acceptable? – Jesse Warren Jul 2 at 1:04
• It should be but be aware that VRT is a slower raster format than a single image file, if you can translate to GeoTIFF with no compression your contours will run much faster. – Michael Stimson Jul 2 at 1:21
• Why are you doing Python imports in your shell script? Is that some error of formatting in your question? – Richard Law Jul 2 at 1:41
• i’m not really sure how to work through QGIS python, which is a requirement, and i only really have experience with arcpy – Jesse Warren Jul 2 at 1:42


text:
# Numerical simulation of Heston model

I am trying to simulate on Python random paths for a general asset price as described by the Heston model:

\begin{aligned} dS_t &= \mu S_t dt + \sqrt{\nu_t} S_t dW^S_t \\ d\nu_t &= \kappa(\theta - \nu_t) dt + \xi \sqrt{\nu_t} dW^{\nu}_t \\ \textrm{Corr}[W^S_t, W^{\nu}_t] &= \rho \end{aligned}

where:

• $$W_t^{S}$$ and $$W_t^{\nu}$$ are two standard Brownian motions with correlation $$\rho$$.
• $$\nu _{t}$$ is the instantaneous variance.
• $$\mu$$ is the rate of return of the asset.
• $$\theta$$ is the long variance.
• $$\kappa$$ is the rate at which $$\nu_t$$ reverts to $$\theta$$.
• $$\xi$$ is the volatility of the instantaneous volatility.

Hence I implemented the following function:

def HeMC (S0, mu, v0, rho, kappa, theta, xi, T, dt):

# Generate a Monte Carlo simulation for the Heston model

# Generate random Brownian Motion
MU  = np.array([0, 0])
COV = np.matrix([[1, rho], [rho, 1]])
W   = np.random.multivariate_normal(MU, COV, T)
W_S = W[:,0]
W_v = W[:,1]

# Generate paths
vt    = np.zeros(T)
vt[0] = v0
St    = np.zeros(T)
St[0] = S0
for t in range(1,T):
vt[t] = np.abs(vt[t-1] + kappa*(theta-np.abs(vt[t-1]))*dt + xi*np.sqrt(np.abs(vt[t-1]))*W_v[t])
St[t] = St[t-1]*np.exp((mu - 0.5*vt[t])*dt + np.sqrt(vt[t]*dt)*W_S[t])

return St, vt

The problem is that when I run this function with the following parameters I often obtain paths which seems not to make sense. Especially the instantaneous volatility does not seem mean-reverting but it often follows wild paths.

T     = 252
dt    = 1/252
S0    = 100 # Initial price
mu    = 0.1 # Expected return
sigma = 0.2 # Volatility
rho   = -0.2 # Correlation
kappa = 0.3 # Revert rate
theta = 0.2 # Long-term volatility
xi    = 0.2 # Volatility of instantaneous volatility
v0    = 0.2 # Initial instantaneous volatility

I believe the problem is in the way I discretised the process or maybe there are some bugs in my code but I could not find anything.

• Without looking at your code, the initial volatility and the long run mean seems to be pretty high. Remember, that you model the variance $v_t$ and not the standard deviation, so try to use 0.04 as the respective values and see what happens. – JohnDoe Apr 6 at 9:04


text:
# Angular Velocity of a swinging Sphere

## Homework Statement

A uniform solid sphere of mass M and radius R hangs from a string of length R/2. Suppose that the sphere is released from an initial position making an angle of 45 degrees with the vertical. Calculate the angular velocity of the sphere when it swings through the vertical position.

## Homework Equations

Conservation of Energy. U= Mgh = I ($$\omega$$^2)
Parallel Axis Theorem I= I$$_{cm}$$+Md$$^{2}$$

## The Attempt at a Solution

I'm in an odd situation in that I have the solution, but am trying to wrap my head around what exactly it means. I first rearranged mgh=(I)Omega^2 to get Omega=$$\sqrt{mgh/I}$$. I figured that I would then have my answer as soon as I solved for I. Using the Parallel Axis Theorem, and my book's given moment of inertia for a sphere being rotated about its diameter (2/5)MR^2, gave me I= (2/5)MR^2 + Md^2. However, my professor's solutions give a d (distance from axis of rotation to axis through center of mass) as 3R/2. I am having trouble figuring out where this number comes from. As far as I can tell, the only distance which is 3R/2 is the distance from the pivot point (where the string is mounted) to the bottom of the sphere. Wouldn't using this distance as "d" imply that the sphere is rotating about an axis through the end of the ball? Shouldn't it be rotating through its center of mass?

Any help would be appreciated, as I know I'm somehow looking at this motion wrong. And I apologize for the messy lack of formatting, I'm new to this system of symbol representation and was having trouble with it.

## Answers and Replies

Related Introductory Physics Homework Help News on Phys.org
alphysicist
Homework Helper
Hi zylaxice,

The distance (3/2)R is the distance from the pivot point to the center of the sphere. This is the distance from the center of mass of the sphere to the axis of rotation which you need in the parallel axis theorem.

The distance from the pivot point to the bottom of the ball would be the length of the string plus the diameter of the ball, which would be (R/2) + 2R = (5/2)R

tiny-tim
Science Advisor
Homework Helper
Welcome to PF!

Hi zylaxice! Welcome to PF!

You're confusing radius with diameter.

(Did you draw a diagram? Always draw a diagram!)

Thank you both, that's exactly what I did. No matter how many times I rewrote the problem, I guess I always made the same mistake. I think because my original diagram was so horrendously out of scale I somehow associated R with being the diameter of the sphere instead of the radius, and it took someone else pointing it out to make me realize how blind I was.


text:
# Has it been proved that odd perfect numbers cannot be triangular?

(Note: This question has been cross-posted to MO.)

Euclid and Euler proved that every even perfect number is of the form $m = \frac{{M_p}\left(M_p + 1\right)}{2}$ where $M_p = 2^p - 1$ is a prime number, called a Mersenne prime. Thus, an even perfect number is triangular.

On the other hand, Euler showed that an odd perfect number, if one exists, takes the form $N = q^k n^2$, where $q$ is prime with $q \equiv k \equiv 1 \pmod 4$ and $\gcd(q,n) = 1$. (Descartes, Frenicle and subsequently Sorli conjectured that $k = 1$ always holds.)

Here is my question:

Has it been proved that odd perfect numbers cannot be triangular?

If $\sigma(q) = 2n^2$, then it would follow that $n < q$, which implies that $k = 1$. The odd perfect number $N = q^k n^2$ then takes the form $N = \frac{q(q + 1)}{2}$. Unfortunately, it is known that $\sigma(q^k) \leq \frac{2n^2}{3}$.


text:
## Denoising by Higher Order Statistics

• A standard approach for deducing a variational denoising method is the maximum a posteriori strategy. Here, the denoising result is chosen in such a way that it maximizes the conditional density function of the reconstruction given its observed noisy version. Unfortunately, this approach does not imply that the empirical distribution of the reconstructed noise components follows the statistics of the assumed noise model. In this paper, we propose to overcome this drawback by applying an additional transformation to the random vector modeling the noise. This transformation is then incorporated into the standard denoising approach and leads to a more sophisticated data fidelity term, which forces the removed noise components to have the desired statistical properties. The good properties of our new approach are demonstrated for additive Gaussian noise by numerical examples. Our method shows to be especially well suited for data containing high frequency structures, where other denoising methods which assume a certain smoothness of the signal cannot restore the small structures.

$Rev: 13581$


text:
## Ornstein – Uhlenbeck Process

Ornstein – Uhlenbeck process is a mean-reverting process, which is described by the SDE

$dX_t = \alpha\, (\mu - X_t)\, dt + \sigma\, dW_t$

where α > 0 and Wt is the Wiener process. It can easily be solved explicitly:

$\displaystyle X_t = e^{-\alpha t} X_0 + \mu\, (1 - e^{-\alpha t}) + \int_0^t \sigma\, e^{\alpha(s-t)}\, dW_s.$

So we deduce that

\displaystyle \begin{aligned} \mathsf EX_t &= e^{-\alpha t} X_0 + \mu\, (1 - e^{-\alpha t}) = \mu + o(1), \quad \mbox{ as } t\to\infty, \\ \mathrm{Var}\, X_t &= \frac {\sigma^2}{2\alpha} \left( 1 - e^{-2\alpha t} \right) = \frac {\sigma^2}{2\alpha}, \quad \mbox{ as } t\to\infty. \end{aligned}

The coefficient α is called the speed of mean reversion.

Half-life of the mean-reversion, t1/2, is the average time it will take the process to get pulled half-way back to the mean. To this end, we consider the ODE $\dot x = \alpha\, (\mu - x)$, which has the solution x(t) = μ + e-αt (x0μ). So we can find the half-time from the equation

$\displaystyle x(t_{1/2}) - \mu = \frac {x_0 - \mu}2$,

i.e. $\displaystyle t_{1/2} = \frac {\log 2}\alpha.$ In particular, the higher the mean-reversion speed is, the smaller is the half-life.


text:
# Subset sum NP-Completness

I know that the subset sum problem is NP-Complete because I can reduce a known NP-Complete problem to subset sum.

However, since subset sum can be solved by dynamic programming, I was not completely convinced that it is NP-Complete. I then realized that the dynamic programming solution in fact tries all possible combinations and because of this, is in fact the same as a brute force approach. Is this a valid insight into why subset sum is NP-Complete?


text:
## React Material UI and WordPress Admin Area

Question

I am creating a plugin that uses a React App to run inside the admin section of WordPress, and this app uses React Material UI (MUI) as well.

Everything is great, until I started to use “form” components (such as TextField) and this is when load-styles.php started to interfere with the outcome of those files.

After further investigation, it appears like load-styles.php is taking precedence over the styles generated by the MUI as you can see in the picture below:

So, I tried different solutions

First, I tried disabling the styles as described here and here but this causes ALL styles for the admin area to disappear, which is not good. I only do not want the form styles to be disabled

Then I tried to enqueue and reset the styles I wanted to target by giving them the !important keyword, just like this:

input {
padding: 0 !important;
line-height: normal !important;
min-height: 0 !important;
box-shadow: none !important;
border: medium none currentColor !important;
border-radius: 0 !important;
background-color: transparent !important;
color: inherit !important;
}

But this would cause a problem, because now the default MUI styles are also overridden (because !important works on them as well), causing the look to be all messed up.

Then, I tried many other solutions, all of them revolve around styling components, but just like point #2 above, they end up messing up MUI default styling

Moreover, Someone had a similar problem but no answer to him/her yet, and the suggestion in the comments to use <CssBaseline /> did not solve anything.

So, the way I am thinking is as follows:

1. Is there a way to make the MUI inline styles take precedense over load-styles.php?

2. If not, is there a way to disable parts of the load-styles.php ?

3. If not, how do I style the admin area using React MUI?

Thanks you.

0
1 month 2023-02-15T16:09:43-05:00 0 Answers 0 views 0


text:
# Signal for corruption

You may send a signal for a specific case of corruption. Anonymous signals are not processed, as well as signals relating to offenses committed more than two years ago.

Please, send a signal using the CYRILLIC aplhabet!


text:
09.09.2009

# Genome Folding at the 30 nm Scale

by pmd

This PhD thesis addressed and succeeded in answering a fundamental question concerning genome folding at the 30nm scale by proving that a higher-order DNA folding pattern beyond the nucleosome, i.e. chromatin, actually exists. A model for chromatin was developed that allows to study very long fibers (in the range of Mega base pairs). Furthermore, linker histone depletion as well as nucleosome depletion have been included for the first time in a chromatin model. This allowed to study the chromatin phase diagram and the corresponding structures are discussed against the background of compaction and DNA accessibility and other important chromatin features. The basic model parameter distributions come from experimental data [186,187]. Together with the histone depletion effects they show that every chromatin conformation consists of a distribution of different structures. This explains why regular 30nm fibers are so hard to find experimentally.

The results show that histone depletion massively affects the properties of chromatin. Nucleosome depletion can either lead to a collapse or to swelling of chromatin and the predicted regime of optimal DNA condensation coincides with experimental data [186] which proves that histone depletion is used as a regulatory tool for DNA extension. Moreover, the model is in good agreement with many experimentally determined chromatin properties. A comparison of the developed model with 5C experimental data [72] proves that histone depletion is an important chromatin feature because only fibers with depletion allow the important physical contacts on a small length scale. Random chromatin collisions are theoretically studied to improve 3C-based experimental technologies by allowing to distinguish more accurately between specific and random DNA contacts.

## Related Publications

• Diesinger, P.M. 2009. Genome Folding at the 30 nm Scale. PhD Thesis.

## Comparison with Electron Micrographs

The following figures show a comparison of simulated chromatin fibers with electrom micrographs (adapted from Olins, D.E. and Ada L. Olins. 2003. Chromatin history: our view from the bridge. Nat Rev Mol Cell Biol 4: 809-14.).

09.09.2009

# Influence of Histone Depletion on Genome Folding

by pmd

We present a Monte Carlo model for genome folding at the 30nm scale with focus on linker histone and nucleosome depletion effects. We find that parameter distributions from experimental data do not  lead to one specific chromatin fiber structure but instead to a  distribution of structures in the chromatin phase diagram.

Depletion of linker histones and nucleosomes affects massively the flexibility and the extension of chromatin fibers. Increasing the amount of nucleosome skips (i.e. nucleosome depletion) can either lead to a collapse or to swelling of chromatin fibers. These opposing effects are discussed and we show that depletion effects may even contribute to chromatin compaction. Furthermore, we find that predictions from experimental data for the average nucleosome skip rate lie exactly in the regime of maximum chromatin compaction.

Finally we determine the pair distribution function of chromatin. This function reflects the structure of the fiber and its Fourier transform can be measured experimentally. Our calculations show that even in the case of fibers with depletion effects the main dominant peaks (characterizing the structure and the length scales) can still be identified.

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2009. Depletion Effects massively change Chromatin Properties and influence Genome Folding. Accepted by Biophysical Journal (will be published Oct. 2009).

View into the cell nucleus: This figure shows an illustration of 1 Mbp of chromatin with histone and nucleosome depletion.

09.09.2009

# Hydrophobicity induced Gelation of FG-rich Nucleoporins

by pmd

In this work we address the question whether hydrophobic parts of FG-rich nucleoporins can be the reason for their ability to form a hydro-gel. We focus on the N-terminal fsFG-domain of the essential yeast nucleoporin Nsp1p [18] as a nucleoporin model system and on the question whether a phase transition between a sol and a gel phase exists. It comprises 18 regular FSFG-repeats and 16 less regular  FG-repeats. This domain is modeled and equilibrated ensembles of peptide networks were generated by a Metropolis Monte-Carlo algorithm which then were analyzed by percolation theoretical methods.

We take into account the excluded-volume of the protein backbone and all side chains which are at least medium-sized (starting with Glu / E) as well as the hydrophobic clusters of the amino acid sequence. There is a competition between two kinds of entropic forces in the system: The excluded volume interactions and the hydrophobic parts of the nucleoporin strands. Therefore, it is not a priori clear whether the system percolates at a biologically realistic density. Nevertheless, we find a sol-gel phase transition in the system at a critical density of 42 mg / mL

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2009. Hydrophobicity as a possible Reason for Gelation of FG-rich Nucleoporins. Accepted by European Biophysics Journal.
09.08.2009

# E2A Model for Chromatin

by pmd

We present a model improving the two-angle model for interphase chromatin (E2A model). This model takes into account the cylindrical shape of the histone octamers, the H1 histones in front of the nucleosomes, and the distance d between the in and outgoing DNA strands orthogonal to the axis of the corresponding nucleosome cylinder. Factoring these chromatin features in, one gets essential changes in the chromatin phase diagram: Not only the shape of the excluded-volume borderline changes but also the orthogonal distance d has a dramatic influence on the forbidden area. Furthermore, we examined the influence of H1 defects on the properties of the chromatin fiber.

Thus, we present two possible strategies for chromatin compaction: The use of very dense states in the phase diagram in the gaps in the excluded-volume, borderline, or missing H1 histones can lead to very compact fibers. The chromatin fiber might use both of these mechanisms to compact itself at least locally. Line densities computed within the model coincident with the experimental values.

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2007. The Influence of the Cylindrical Shape of the Nucleosomes and H1 Defects on the Properties of Chromatin. Biophysical Journal, doi:10.1529/biophysj.107.113902. [abstract]
09.08.2009

# Chromatin Phase Diagram

by pmd

We have studied the phase diagram for chromatin within the framework of the two-angle model. Only a rough estimation of the forbidden surface of the phase diagram for chromatin was given in a previous work of Schiessel. We revealed the fine structure of this excluded-volume borderline numerically and analytically. Furthermore, we investigated the Coulomb repulsion of the DNA linkers to compare it with the previous results.

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2006. Two-Angle Model and Phase Diagram for Chromatin. Physical Review E Vol. 74, Issue 3, doi10.1103/PhysRevE.74.031904. [abstract]
09.07.2009

# Quantitative Description of Polymer Entanglement

by pmd

We develop new methods for the structural analysis of polymer systems (especially of DNA). So far we investigated the effects of excluded volume interactions on the mean average crossing number (mACN) [ref] and the knot statistics [ref] of polymers. The mACN is roughly speaking a measure for the entanglement of polymer chains.
At the moment we are about to publish a paper which shows the connection between the mACN and the scattering function as well as the loop number of polymer chains.

We study the influence of excluded volume interactions on the behaviour of the mean average crossing number (mACN) for random off-lattice walks. We investigated Gaussian and equilateral off-lattice random walks with and without ellipsoidal excluded volume up to chain lengths of N = 1500 and equilateral random walks on a cubic lattice up to N = 20000. We find that the excluded volume interactions have a strong influence on the behaviour of the local crossing number 〈 a(l1,l2) 〉 at very short distances but only a weak one at large distances. This behaviour is the basis of the proof in [ Y. Diao et al., Math. Gen. 36, 11561 (2003); Y. Diao and C. Ernst, Physical and Numerical Models in Knot Theory Including Applications to the Life Sciences] for the dependence of the mean average crossing number on the chain length N. We show that the data is compatible with an N ln(N)-bahaviour for the mACN, even in the case with excluded volume.

We investigated the effects of excluded volume interactions on the average crossing number (ACN) and found a power law for the number of knot-monomers with an exponent $0.39 \pm0.13$ in agreement with previous simulations. For the average size of a knot we also obtain a power law behaviour. We further present data on the average number of knots given a certain chain length and confirm a power law behaviour for the number of knot-monomers. Furthermore we study the average crossing number for random and self-avoiding walks as well as for a model polymer with and without geometric constraints. The data confirms the aN log N + bN law in the case of without excluded volume and determines the constants $a$ and $b$ for various cases. For chains with excluded volume the data for chains up to N=1500 is consistent with a N log N + bN rather than the proposed N^{4/3} law. Nevertheless our fits show that the N^{4/3} ACN of a polymer chain with a looplaw is a suitable approximation.

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2009. The Connection of the mACN with the scattering Function and the Loop Number of Polymer Chains. In preparation.
• Diesinger, P.M. and D.W. Heermann. 2008. Average Crossing Number of Gaussian and Equilateral Chains with and without Excluded Volume. European Journal of Physics B, Volume 62, Number 2, 209-214. [abstract]
• Brill, M. P.M. Diesinger and D.W. Heermann. 2005. Knots in Macromolecules in Constraint Space. arXiv:cond-mat/0507020. [abstract]
• Diesinger, P.M. 2005. Excluded Volume Effects in Biopolymers. (diploma thesis [download]).

09.04.2009

# Excluded Volume Effects in Biopolymers

by pmd

In this diploma thesis the influence of excluded volume interactions on the mean average crossing number of polymer chains was numerically and analytically investigated. It turned out that this influence is very strong and that the mean average crossing number of real polymers is much smaller than the theoretical predictions for ideal polymer chains in [22; 23; 26]. Furthermore the forbidden surfaces of the  chromatin phase diagram due to excluded volume restrictions were numerically revealed and very good analytical approximations could be found for it. The behavior of the nucleosome density, the accessibility and the energy of a single chromatin repeat unit at the determined excluded volume borderline was investigated.

## Related Publications

• Diesinger, P.M. and D.W. Heermann. 2006. Two-Angle Model and Phase Diagram for Chromatin. Physical Review E Vol. 74, Issue 3, doi10.1103/PhysRevE.74.031904. [abstract]
• Diesinger, P.M. and D.W. Heermann. 2008. Average Crossing Number of Gaussian and Equilateral Chains with and without Excluded Volume. European Journal of Physics B, Volume 62, Number 2, 209-214. [abstract]
• Diesinger, P.M. 2005. Excluded Volume Effects in Biopolymers. (diploma thesis [download]).
09.03.2009

by pmd


text:
# The sum of the first seven terms of a geometric sequence is 127 and the quotient is 2, find the terms of the sequence.

Hello!

Probably we need to find all the terms of this progression.

Recall that each next term of a geometric progression is obtained by multiplying the previous term by the quotient, denote it as `q.` Denote the first term as `b,` then the second is `b*q,` the third is `b*q*q...

Start your 48-hour free trial to unlock this answer and thousands more. Enjoy eNotes ad-free and cancel anytime.

Hello!

Probably we need to find all the terms of this progression.

Recall that each next term of a geometric progression is obtained by multiplying the previous term by the quotient, denote it as `q.` Denote the first term as `b,` then the second is `b*q,` the third is `b*q*q = b*q^2,` and the k-th term is `b*q^(k-1).`

It is also well-known that the sum of `n` terms of a geometric progression with the first term `b` and `q!=1` is `S = b*(q^n-1)/(q-1).`

In our case `q=2,` `b` is unknown, `n = 7` and `S = 127.` This way we obtain a simple equation for `b:`

`127 = b*(2^7-1)/(2-1) = b*127,`  because `2^7 = 128` (check by multiplying 2*2*2*2*2*2*2).

Obviously the only solution is `b=1,` and the entire array is 1, 2, 4, 8, 16, 32, 64.

We could solve this problem without the formula for sum, adding all `7` terms manually:

`b+2b+4b+8b+16b+32b+64b = 127,` the left side is `(1+2+4+8+16+32+64)b = 127b = 127,` and again `b=1.`

Approved by eNotes Editorial Team


text:
# Volume of a cone using integrals

1. Homework Statement

A water tank is shaped like an inverted cone with height 6 m and base radius 1.5 m

If the tank is full, how much work is required to pump the water to the level of the top of the tank and out of the tank?

2. Homework Equations

Integral of ( density * g (acceleration due to gravity) * A(y) (area of a cross section ) * change in y )

3. The Attempt at a Solution

The integral is from zero to 6 since this strange cone-shaped tank is 6 m high. g = 9.8 m/s^2, times the change in y which is (y-6) since the cone is 6m high

My problem is that I have no idea how to compute the cross-sectional area of a cone. The cuts are circles which have an area of pi*r^2. The tricky thing with this problem though is the radius does not remain constant from top to bottom.

My solutions manual gives the area as pi * (y^2)/16. I have no idea how they got to this. Any help would be very much appreciated.
1. Homework Statement

2. Homework Equations

3. The Attempt at a Solution


text:
The open source CFD toolbox
Rebound.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2017 OpenFOAM Foundation
9 Copyright (C) 2016 OpenCFD Ltd.
10-------------------------------------------------------------------------------
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29#include "Rebound.H"
30
31// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
32
33template<class CloudType>
35(
36 const dictionary& dict,
38)
39:
41 UFactor_(this->coeffDict().getScalar("UFactor"))
42{}
43
44
45template<class CloudType>
47:
49 UFactor_(pim.UFactor_)
50{}
51
52
53// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
54
55template<class CloudType>
57(
58 typename CloudType::parcelType& p,
59 const polyPatch& pp,
60 bool& keepParticle
61)
62{
63 vector& U = p.U();
64
65 keepParticle = true;
66 p.active(true);
67
68 vector nw;
69 vector Up;
70
71 this->owner().patchData(p, pp, nw, Up);
72
73 // Calculate motion relative to patch velocity
74 U -= Up;
75
76 scalar Un = U & nw;
77
78 if (Un > 0.0)
79 {
80 U -= UFactor_*2.0*Un*nw;
81 }
82
83 // Return velocity to global space
84 U += Up;
85
86 return true;
87}
88
89
90// ************************************************************************* //
Templated base class for dsmc cloud.
Definition: DSMCCloud.H:75
ParcelType parcelType
Type of parcel the cloud was instantiated for.
Definition: DSMCCloud.H:220
Templated patch interaction model class.
virtual void correct()
Solve the turbulence equations and correct the turbulence viscosity.
Simple rebound patch interaction model.
Definition: Rebound.H:53
A cloud is a registry collection of lagrangian particles.
Definition: cloud.H:60
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:126
A patch is a list of labels that address the faces in the global face list.
Definition: polyPatch.H:75
U
Definition: pEqn.H:72
volScalarField & p
dictionary dict


text:
## 14 May 2020

### Another 3 Million New Jobless Claims

So the total since mid March, about 8 weeks, is 36½ million new jobless claims.

Assuming that the normal level of claims is 225,000 (PDF link, see page 6), this means that the excess initial unemployment claims is $36,500,000-225,000×8=34,700,000$ excess unemployment claims.

The labor force was roughly 165 million with 3% unemployment, which gives about 170 million working or looking for work.

Just subtracting the 34.7 million excess claims, and a lot of people have not been processed, gives 23.4% unemployment (U3).

The above is just spit-balling by me, but it is not unreasonable to expect the unemployment rate to top 20% right now.


text:
Linear Algebra Genetics (2)

# Linear Algebra Genetics (2) - Linear Algebra in Genetics...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Linear Algebra in Genetics Carter Butaud Michael Yamamoto June 4, 2008 1 1 Problems: In autosomal inheritance, offspring inherit one gene of the pair belonging to each parent in order to get a pair. For the following, assume that either of a parents genes is equally likely to be inherited. 1. A farmer has a large population of plants consisting of some distribution of all three possible genotypes: AA, Aa, aa. First show that the following table correctly describes the probabilities of the possible genotypes of the offspring for all possible combinations of the genotypes of the parents. AA,AA AA,Aa AA,aa Aa,Aa Aa,aa aa,aa Genotype AA 1 .5 .25 of Aa .5 1 .5 .5 Offspring aa .25 .5 1 Let a , b , c denote the portion of the initial population with genotype AA, Aa, aa, respectively. Solution: One can use Punnett squares for each of the six cases to see all possible outcomes. The following are the completed Punnett squares: A A A AA AA A AA AA A a A AA Aa A AA Aa a a A Aa Aa A Aa Aa A a A AA Aa a Aa Aa a a A Aa Aa a aa aa a a a aa aa a aa aa By looking at the first Punnett square, one can determine the possible outcomes of an AA,AA pairing. As expected, all four boxes are also filled in with AA as those are the only possible outcomes and there is therefore a probability of 1 that the child with have a genotype of AA....
View Full Document

## Linear Algebra Genetics (2) - Linear Algebra in Genetics...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online


text:
Mathematics
OpenStudy (anonymous):

(5 radical 25d) (2d radical 3) What is the product? Simplify if possible.

OpenStudy (anonymous):

$5*\sqrt{25d}*2d*\sqrt{3}$ or $\sqrt[5]{25d} * \sqrt[2d]{3}$ ?

OpenStudy (anonymous):

OpenStudy (anonymous):

If the first one, that is much easier, and I'm guessing that's the one you're asking about. If so, because the radicals are both square roots (not cube roots or anything more complex) we can multiply "like terms"... Let's simplify first. The first term is $5\sqrt{25d}$ Since can take the sqrt of 25 (which is 5), we will do so and pull that number out front and multiply it by the coefficient that is already there to get $5*5\sqrt{d}$ The second term cannot be simplified. Let's take the coefficients for both terms, (25 and 2d) and multiply them to get 50d (these are "like terms" because they are the coefficients out front of the radicals). Similarly, we can take what's under the radicals and combine them under one radical by multiplying,$\sqrt{d}*\sqrt{3}= \sqrt{3d}$ Putting this all together, we get $50d \sqrt{3d}$ HTH!

OpenStudy (anonymous):

k thx


text:
# strongly connected $L$, then what are the eigenvalues of $L+L^T$?

I asked a similar question before. Now things become a bit different here.

Suppose $$L$$ is a non-symmetric Laplacian matrix, of which the corresponding graph is strongly connected. Is it true that $$L+L^T$$ (note that $$L+L^T$$ is symmetric) has at most one negative eigenvalue? I try many examples using Matlab numerically to find out that there is at most one negative eigenvalues, but I am not sure it is true or not.

Preliminaries on Graph Theory:

$$\textit{Graph}$$ is essentially a concept from the set theory. A graph containing $$n$$ nodes can be denoted by $$\mathcal{G}_n = (\mathcal{V}_n, \mathcal{E}_n)$$, where $$\mathcal{V}_n=\{v_1,\dots,v_n\}$$ is the $$\textit{node set}$$ and $$\mathcal{E}_n \subseteqq \mathcal{V}_n \times \mathcal{V}_n$$ is the $$\textit{edge set}$$. $$\epsilon_{ij}=(v_i,v_j), ~i,j \in \{1,\dots,n\}$$ represents an $$\textit{edge}$$ connecting nodes $$v_i$$ and $$v_j$$. When the elements in the edge set $$\mathcal{E}_n$$ are ordered pairs, $$\mathcal{G}_n$$ is a $$\textit{directed graph}$$ (or $$\textit{digraph}$$). Node $$i$$ of $$\epsilon_{ij}$$ is called the $$\textit{parent node}$$ and node $$j$$ is the $$\textit{child node}$$. A $$\textit{directed path}$$ is an ordered set of edges such that the child node of the previous edge is the parent node of the next edge, such as $${(v_1, v_2), (v_2, v_3),\dots}$$. A directed graph is called $$\textit{strongly connected}$$ if for every pair of nodes there is a directed path between them. The corresponding $$\textit{adjacent matrix}$$ to graph $$\mathcal{G}_n = (\mathcal{V}_n, \mathcal{E}_n)$$ is denoted by $$A_n=[a_{ij}] \in M_n, i,j \in {1,\dots, n}$$. It represents whether there is an edge between any two nodes, that is, $$a_{ji} > 0$$ when the edge $$(i,j) \in \mathcal{E}_n$$ and $$a_{ji} = 0$$ when the edge $$(i,j) \notin \mathcal{E}_n$$. The $$\textit{Laplacian matrix}$$ is denoted by $$L_n=[l_{ij}] \in M_n$$, where $$l_{ij} = \sum_{k=1, k \ne i}^{n}a_{ik}, i=j; ~ l_{ij} = -a_{ij}, i \ne j$$.

To generate a random strongly directed graph, one can image a graph where every two nodes are connected. However, the weights of the edges are different. For example, the weight of the edge from node $$i$$ to node $$j$$ is $$1$$ while that of the edge from node $$j$$ to node $$i$$ is $$10$$. So the ajacency matrix can be something like: $$\begin{bmatrix}0 & 1 & 2 \\ 10 & 0 & 3 \\ 3 & 4 & 0\end{bmatrix}$$ and the corresponding Laplacian matrix is $$\begin{bmatrix}3 & -1 & -2 \\ -10 & 13 & -3 \\ -3 & -4 & 7\end{bmatrix}$$

• Maybe we can participate if you tell us how to generate a random strongly connected Laplacian matrix. – Arash Nov 3 '18 at 3:43
• Please see the updated question. @Arash – winston Nov 3 '18 at 19:55

I do not think there is a reason for this property to be true. I was playing around and I think I found a counterexample. Consider the Laplacian matrix $$L=\left[\matrix{1 & 0 & -1& 0& 0\\-2 &2 & 0 & 0 & 0\\ 0 & -2 & 3 & -1 & 0\\-5 & 0 & 0 & 6 & -1\\0 & 0 & -150 & 0 &150}\right]$$ It is easy to see that the associated graph is strongly connected but the eigenvalues of $$L+L^T$$ are $$-57.1216$$, $$-0.7257$$, $$4.6800$$, $$14.1430$$ and $$363.0243$$ i.e. the matrix $$L+L^T$$ has two negative eigenvalues.
• As this answer shows, if two nodes can be connected by multiple arcs in the same direction, $L+L^T$ can have multiple negative eigenvalues. There is actually a simpler example: consider $$L=\pmatrix{ a&-a& 0&0\\ 0&1&-1&0\\ 0&0&a&-a\\ -1&0&0&1}.$$ Then $L+L^T=\pmatrix{A&C\\ C&A}$ where $A=\pmatrix{2a&-a\\ -a&2}$ and $C$ is constant. As $$\lim_{a\to+\infty}\frac1a(L+L^T)=\pmatrix{2&-1\\ -1&0}\oplus\pmatrix{2&-1\\ -1&0},$$ when $a$ is large, $\frac1a(L+L^T)$ will have two negative eigenvalues and so will $L+L^T$. One can verify that the first feasible $a$ is $6$. – user1551 Nov 7 '18 at 14:26