text:
# How you might see some of the dead again

The atheist position is that we won't see people who have died again. I don't disagree. But that's not the same as saying it's impossible, with or without the supernatural. There's an actual chance that's greater than epsilon. But it's still very small, I think it would be unwise to hinge any hopes on it, or to mislead (as I think Kurzweil can do) that it's almost assured given better technology.

The supernatural possibility is of course possible. Perfect souls might exist separate from the body and somehow encode all memories and thoughts separately from the brain, perfectly, so that even if the body is brain damaged and lives on another 30 years, the soul, while retaining that, is fully self-aware and has access to all memories and thoughts across all of its existence, and so is unharmed. And it may be that souls are reborn, or that they go have a party together after leaving their bodies, and remember each other (perhaps even across multiple lives if there is some rebirth before the party). Maybe that party's just the pre-party and once enough people arrive they all come back to Earth (some of them having just left!) in new bodies to have the real party. There are many ways, if you grant supernatural possibilities, for you to see the dead again, either while you're still alive or when you too die. Atheists could be wrong. But probably not. So that leaves us with the natural possibility. How might a form of resurrection work?

Is your grandparent the same person they were when they were in their late 20s? If your grandparent suddenly develops Alzheimer's and seems to lose many long term memories, but isn't all the way gone yet, are they still the same person? If they develop into full-blown unable-to-care-for-themselves Alzheimer's, brain cell death and all, are they the same person? If a cure is developed for Alzheimer's before they get to that point, and they receive the cure, so they stop losing long term memories and can form and retain new ones, are they the same person?

Either "yes" or "no" are valid answers to all those questions. It's fuzzy. But hopefully you can see the same, that each question could be "yes" or could be "no", and it probably comes down mostly to disagreements on what the words "person" and "same" mean.

If you look at people's revealed beliefs by their attitudes around those with Alzheimer's, I think you'll see a sort of curve where the person with Alzheimer's becomes less and less "the real them" to everyone around them. But every now and again there might be a spark, maybe it's even possible to routinely trigger it, or maybe the person holds on to one characteristic of their old selves, and so people are led to believe there's still some kernel of "the real them" inside, damaged and fragmented as it may be.

People are finitely complex. At the material level, there are only so many ways for the atoms in the brain to be rearranged. It's a huge number, but it's finite. So in principle, with infinite computing power, by brute force you could test every possible arrangement of brain matter until you found one you'd call "the same" as the person who is dead. And once you found one, you'd find many.

If you found one, and had a way to grow a new body for it or otherwise emulate the biological input/output process, is this not the same person? If you take a snapshot of all the atoms in your brain 10 seconds ago, and reproduced another instance of that, is this not the same person you are, just a bit younger? They know all the things you know, except anything you learned in that 10 seconds, but they still think like you so they would process the new information the same way. They are you.

Obviously we don't have infinite computing power, so this approach can't work. What approaches can, then?

We go back to the statement that people are finitely complex. But can we bound that any tighter? How many bits of complexity are "you", to whatever arbitrary closeness to whatever point of time you want to use as "you"? And what can we learn about you that can fill in some of these bits if we don't have all of them? Male and female minds are different, so if I know which one you are, I've learned one bit of information, and eliminated half of all the possibilities.

DNA is probably huge for how many bits it gives you about a person. If you really want to entertain the idea of resurrection of someone, you better keep some sort of DNA sample that could be used in the distant future. If you can make a perfect clone, a lot of the guesswork on the initial state of the brain is taken care of. You've greatly reduced the number of possible configurations, because the brain of the person you're looking for had to have evolved somehow from the starting one.

But even if you don't have a nice vial of spit carefully preserved, if the dead person is a relative then you can probably get a lot of the same details by the fact that there's you and you partially share DNA. For non-relatives, you might not be related, but you can find relations. The more relatives, the better. If you've got buried corpses, especially of the dead person, even better. Still not enough? Then maybe there's trace or touch DNA you don't even know about -- kept some random jewelry? Maybe there's something. Or if their old house hasn't been totally blown up, perhaps a deep search would find something, especially when you have information on what you can exclude and what you're looking for.

So by some means you've got a model for what their brain should start out with. Perhaps if you find a fingerprint, you can restrict your model to account for some of the stochastic changes that occur in the womb, since identical twins still lack the same fingerprint. Your next challenge is finding out how this model evolves, how it changes, into something you'd call "the same person" you once knew.

Kurzweil talks of memory extraction of living people for this. It's definitely a valid technique, but as people's memories aren't always that great, you have to treat it with some caution. But as a general rule, when you're trying to figure out how to evolve, shape, mold, or rearrange the person's starting brain model you have from their DNA, you should end up with something that conforms to the models of people who knew the person. If everyone remembered the person as being shy and reserved, then you shouldn't waste effort looking for brain models that aren't that way.

Besides memories, there are things like handwriting samples, video, voice recordings, purchasing decisions, interests, addictions, medical data, employment history, and many other rather objective details. Some things are time-stamped. They can all be used to constrain the type of model you search for. I don't know what the searching algorithm would look like, but again to at least try and match the idea of "same person" it has to match certain details at certain points of its evolution and have at least one plausible path of changes to get from one point to another.

If you think of a Go or Chess game that has been underway for several moves, freeze the current state of the board. Can you find that state from all the possible states? How much information do you need? If I tell you that white is down a pawn, or that there's two more black stones than white stones, you know that at some point in the game's history a capture occurred. There are probably many ways to get to the same state, but all the ways have to involve a capture somewhere.

And so it might be that a superintelligence, or at least vastly faster and smarter computers and humans working together, can narrow down and produce a mind, and embed it in a body or otherwise identical emulation if you're ok with that, and you have resurrected someone. They talk like you remember, they remember your shared experiences together (or at least most of them), as you watch them explore the new world and do and learn new things you see they're acting in a way you'd have expected.

But still the question: is it the same person?

And the answer is still the other question: what do you mean by "same" and "person"?

At least for some people, some of these resurrections will be same-enough, person-enough, to count. Some other people may never accept them. And some may mostly accept them but still have in the back of their mind "the real person is gone forever..."

Your own opinion on the matter is irrelevant. Without anything to stop them like laws against modeling minds in detail, people of the future will try this. If they're successful at all, some people will get great comfort from it, and some of the resurrections will be very happy to be going again.

If the Singularity is Near, then you might have the chance to live to see this, might have the chance to see dead people live again, and might have the chance to die and be brought back even later yourself. If superintelligence is at all possible, and such a universe with that possibility realized is at all friendly to human values, this seems so possible that I can understand why people like Kurzweil might give off the idea of inevitability, and for critics to use that as just another tired "hey look at these dumb atheist tech nerds still having faith in dumb religious things like resurrection" remark. It's not inevitable, and the belief of its possibility however strong isn't anything like a faith.

I don't even personally think it's likely for myself to experience any aspect of this, I miss a number of people and feel sad I'll never see them again. But I do think this sort of resurrection is likely in the realm of what a superintelligence could do if it wanted. I'm reluctant to believe very strongly in limitations on what superintelligence could do -- could any human of ancient Egypt before the Great Pyramids foresee how the world looks today or would they think such things impossible and beyond the limits of humanity? Could they even foresee just the Great Pyramids?

Of course this means if you make a good in-principle argument without invoking the supernatural or infinite computing power about possibility, I'm inclined to agree it's likely doable by a superintelligence and maybe even likely a friendly superintelligence does such a thing.

#### Posted on 2017-06-02 by Jach

LaTeX allowed in comments, use $\\...\\$\$ to wrap inline and $$...$$ to wrap blocks.


text:
# American Institute of Mathematical Sciences

ISSN:
1531-3492

eISSN:
1553-524X

All Issues

## Discrete & Continuous Dynamical Systems - B

August 2013 , Volume 18 , Issue 6

Special Issue on on Deterministic and Stochastic Dynamical Systems with delays

Select all articles

Export/Reference:

2013, 18(6): i-ii doi: 10.3934/dcdsb.2013.18.6i +[Abstract](1402) +[PDF](77.1KB)
Abstract:
Studying delay differential equations is motivated by the fact that the evolution of systems in physics, chemistry, the life sciences, engineering, and economics, may, and often does, depend not only on the present state of the system but also on earlier states. Examples arise from the 2-body problem of electrodynamics (which is barely understood), in laser physics, materials with thermal memory, biochemical reactions, population growth, physiological regulatory systems, and business cycles, among many others. Delays may also appear when one wants to control a system by applying an external force which takes into account the history of the solution. Also mathematical problems in geometry and probability yield delay differential equations. In modeling real world phenomena another important aspect is uncertainty. It is often useful to take into account some randomness or environmental noise. This Special Issue addresses both aspects of dynamical systems, namely, hereditary characteristics and stochasticity. We have selected a dozen of papers which illustrate some lines of recent research.

2013, 18(6): 1521-1531 doi: 10.3934/dcdsb.2013.18.1521 +[Abstract](2368) +[PDF](328.8KB)
Abstract:
The stability of equilibrium solutions of a deterministic linear system of delay differential equations can be investigated by studying the characteristic equation. For stochastic delay differential equations stability analysis is usually based on Lyapunov functional or Razumikhin type results, or Linear Matrix Inequality techniques. In [7] the authors proposed a technique based on the vectorisation of matrices and the Kronecker product to transform the mean-square stability problem of a system of linear stochastic differential equations into a stability problem for a system of deterministic linear differential equations. In this paper we extend this method to the case of stochastic delay differential equations, providing sufficient and necessary conditions for the stability of the equilibrium. We apply our results to a neuron model perturbed by multiplicative noise. We study the stochastic stability properties of the equilibrium of this system and then compare them with the same equilibrium in the deterministic case. Finally the theoretical results are illustrated by numerical simulations.
2013, 18(6): 1533-1554 doi: 10.3934/dcdsb.2013.18.1533 +[Abstract](1885) +[PDF](464.8KB)
Abstract:
We study invariance and monotonicity properties of Kunita-type sto-chastic differential equations in $\mathbb{R}^d$ with delay. Our first result provides sufficient conditions for the invariance of closed subsets of $\mathbb{R}^d$. Then we present a comparison principle and show that under appropriate conditions the stochastic delay system considered generates a monotone (order-preserving) random dynamical system. Several applications are considered.
2013, 18(6): 1555-1565 doi: 10.3934/dcdsb.2013.18.1555 +[Abstract](1644) +[PDF](411.0KB)
Abstract:
We establish a necessary and sufficient condition of exponential stability for the contraction semigroup generated by an abstract version of the linear differential equation $$∂_t u(t)-\int_0^\infty k(s)\Delta u(t-s)ds = 0$$ modeling hereditary heat conduction of Gurtin-Pipkin type.
2013, 18(6): 1567-1579 doi: 10.3934/dcdsb.2013.18.1567 +[Abstract](1884) +[PDF](334.6KB)
Abstract:
For a class of cooperative population models with patch structure and multiple discrete delays, we give conditions for the absolute global asymptotic stability of both the trivial solution and -- when it exists -- a positive equilibrium. Under a sublinearity condition, sharper results are obtained. The existence of positive heteroclinic solutions connecting the two equilibria is also addressed. As a by-product, we obtain a criterion for the existence of positive traveling wave solutions for an associated reaction-diffusion model with patch structure. Our results improve and generalize criteria in the recent literature.
2013, 18(6): 1581-1610 doi: 10.3934/dcdsb.2013.18.1581 +[Abstract](2130) +[PDF](614.6KB)
Abstract:
We consider a modified Cahn-Hiliard equation where the velocity of the order parameter $u$ depends on the past history of $\Delta \mu$, $\mu$ being the chemical potential with an additional viscous term $\alpha u_{t},$ $\alpha >0.$ In addition, the usual no-flux boundary condition for $u$ is replaced by a nonlinear dynamic boundary condition which accounts for possible interactions with the boundary. The aim of this work is to analyze the passage to the singular limit when the memory kernel collapses into a Dirac mass. In particular, we discuss the convergence of solutions on finite time-intervals and we also establish stability results for global and exponential attractors.
2013, 18(6): 1611-1631 doi: 10.3934/dcdsb.2013.18.1611 +[Abstract](1828) +[PDF](322.2KB)
Abstract:
In this paper we study a parameter estimation method in functional differential equations with state-dependent delays using a quasilinearization technique. We define the method, prove its convergence under certain conditions, and test its applicability in numerical examples. We estimate infinite dimensional parameters such as coefficient functions, delay functions and initial functions in state-dependent delay equations. The method uses the derivative of the solution with respect to the parameters. The proof of the convergence is based on the Lipschitz continuity of the derivative with respect to the parameters.
2013, 18(6): 1633-1650 doi: 10.3934/dcdsb.2013.18.1633 +[Abstract](2024) +[PDF](505.0KB)
Abstract:
We consider state-dependent delay equations of the form $x'(t) = f(x(t - d(x(t))))$ where $d$ is smooth and $f$ is smooth, bounded, nonincreasing, and satisfies the negative feedback condition $xf(x) < 0$ for $x \neq 0$. We identify a special family of such equations each of which has a rapidly oscillating" periodic solution $p$. The initial segment $p_0$ of $p$ is the fixed point of a return map $R$ that is differentiable in an appropriate setting.
We show that, although all the periodic solutions $p$ we consider are unstable, the stability can be made arbitrarily mild in the sense that, given $\epsilon > 0$, we can choose $f$ and $d$ such that the spectral radius of the derivative of $R$ at $p_0$ is less than $1 + \epsilon$. The spectral radii are computed via a semiconjugacy of $R$ with a finite-dimensional map.
2013, 18(6): 1651-1661 doi: 10.3934/dcdsb.2013.18.1651 +[Abstract](1853) +[PDF](342.9KB)
Abstract:
A class of stochastic optimal control problems of infinite dimensional Ornstein-Uhlenbeck processes of neutral type are considered. One special feature of the system under investigation is that time delays are present in the control. An equivalent formulation between an adjoint stochastic controlled delay differential equation and its lifted control system (without delays) is developed. As a consequence, the finite time quadratic regulator problem governed by this formulation is solved based on a direct solution of some associated Riccati equation.
2013, 18(6): 1663-1681 doi: 10.3934/dcdsb.2013.18.1663 +[Abstract](1922) +[PDF](370.0KB)
Abstract:
In this paper we deal with a nonautonomous differential equation with a nonautonomous delay. The aim is to establish the existence of an unstable invariant manifold to this differential equation for which we use the Lyapunov-Perron transformation. However, the delay is assumed to be unbounded which makes it necessary to use nonclassical methods.
2013, 18(6): 1683-1696 doi: 10.3934/dcdsb.2013.18.1683 +[Abstract](1920) +[PDF](371.4KB)
Abstract:
We establish the existence of a deterministic exponential growth rate for the norm (on an appropriate function space) of the solution of the linear scalar stochastic delay equation $d X(t) = X(t-1) d W(t)$ which does not depend on the initial condition as long as it is not identically zero. Due to the singular nature of the equation this property does not follow from available results on stochastic delay differential equations. The key technique is to establish existence and uniqueness of an invariant measure of the projection of the solution onto the unit sphere in the chosen function space via asymptotic coupling and to prove a Furstenberg-Hasminskii-type formula (like in the finite dimensional case).
2013, 18(6): 1697-1714 doi: 10.3934/dcdsb.2013.18.1697 +[Abstract](2167) +[PDF](384.1KB)
Abstract:
For a stochastic functional differential equation (SFDE) to have a unique global solution it is in general required that the coefficients of the SFDE obey the local Lipschitz condition and the linear growth condition. However, there are many SFDEs in practice which do not obey the linear growth condition. The main aim of this paper is to establish existence-and-uniqueness theorems for SFDEs where the linear growth condition is replaced by more general Khasminskii-type conditions in terms of a pair of Laypunov-type functions.
2013, 18(6): 1715-1734 doi: 10.3934/dcdsb.2013.18.1715 +[Abstract](2143) +[PDF](414.7KB)
Abstract:
The existence of a random attactor is established for a mean-square random dynamical system (MS-RDS) generated by a stochastic delay equation (SDDE) with random delay for which the drift term is dominated by a nondelay component satisfying a one-sided dissipative Lipschitz condition. It is shown by Razumikhin-type techniques that the solution of this SDDE is ultimately bounded in the mean-square sense and that solutions for different initial values converge exponentially together as time increases in the mean-square sense. Consequently, similar boundedness and convergence properties hold for the MS-RDS and imply the existence of a mean-square random attractor for the MS-RDS that consists of a single stochastic process.

2018  Impact Factor: 1.008

format: plain


text:
# Overfitting and data transformations

Ok, if we put together too much independent variables, primary looking for better fits (for exemple, higher R², lower AIC, [...]), the model could be very unreal, or unable to predict something. The coefficients could have a difficult interpretation too (considering a ceteris paribus interpretation as a desirable thing).

That is, we don't really have a better model if it demands too many crucial information entered by the user (and much more objections).

Is it possible that data transformations could lead to some of that problems?

For exemple: I discover a better fit between $y$ and $x_i, i={1,2,3...}$, using $x_1$ and $x_6$ transformations like

$x_1._1 = x_1^{0.58}$ instead of tradicional $x_1._1 = x_1^{0.5} = sqrt(x_1)$

(after testing $0.57, 0.56, 0.55, [...];$ and $0.59, 0.6, 0.61, [...]$)

or

$x_6._1 = 2.6^{x_6}$ instead of $x_6._1 = e^{x_6} = 2.718^{x_6}$

(You can imagine other non-usual transformations)

I know that the interpretation will be like less "visual", but assuming that I have all the hypothesis verified and more precision, doing that should be considered as overfitting too?

The real variables could have a strange relation in the population, after all. Is that reasonable?


text:
Why can ECDSA public keys be sent over an insecure network, while ECDSA is used to sign ECDH public keys to securely be transported over the network?

Basically the title says it all. I am trying to develop and understand an ECDH-ECDSA encryption.

My current approach to provide some form of authentication to the ECDH is to use ECDSA to sign the public key of ECDH before sending it over the network, in order to allow the receiver to verify the sender.

However, after reading up on some ECDSA implementations, I am quite confused about the way ECDSA public keys are being handled.

In my implementation, I wanted to hardcode a static key pair into both sides, as I am not planning on making it a high scale public implementation. That way I don't have to expose my keys and fear any man in the middle attacks - given I understood everything correct.

However, most solutions seem to simply send the ECDSA public key over an insecure channel.

But isn't this what ECDSA is trying to prevent? Why is the algorithm doing exactly what it is trying to prevent itself?

The attack that we're trying to prevent is a Man-in-the-Middle attack; this is one where an attacker (who is assumed to be able to modify messages) can step into a negotiation. In effect, when Alice tries to negotiate with Bob, Mallet steps in, and so Alice actually negotiates with Mallet. Mallet can then negotiate with Bob (posing as Alice), and then, forward any traffic he gets from Alice to Bob, and any traffic he gets from Bob to Alice. As far as Alice and Bob are concerned, it looks like they have a secure connection (but Mallet can listen in to all their traffic, and also modify it at will).

To prevent this from being a possibility, Alice and Bob need to be able to do something that Mallet cannot. There are a couple of possible ways, including:

• Alice already knows Bob's public key, and Bob already has Alice's public key.

• Alice and Bob both have a certificate from a trusted certificate authority.

There are other possibilities; hwoever these two are relevant to your question.

However, most solutions seem to simply send the ECDSA public key over an insecure channel.

I would certainly hope not; as you can see, Mallet can generate his own ECDSA public key, and so this would do nothing to prevent a MITM attack.

What these solutions do is actually have Alice and Bob have certificates. What a certificate is is essentially a message "Alice's public key is [this], signed Trent" (where Trent is the friendly neighborhood CA). Trent gives Alice her certificate (based on Alice's public key) before negotiation ever happens, and Trent also gives Alice his public key. During negotiation, Alice gives Bob her certificate; Bob can then verify that a) the identity listed in the certificate is the perform Bob thinks he's talking to, and b) it actually is signed by Trent. If both are true, Bob then knows Alice's public key, and that can be used in the protocol. Mallet cannot generate such a certificate; Trent won't give a certificate to Mallet that lists Alice as the owner; Mallet cannot reuse Alice's certificate (as he doesn't know Alice's private key); Mallet cannot generate his own certificate (as he doesn't know Trent's private key).

So, once Bob knows Alice's public key (and similarly, Alice knows Bob's), they can then use the each other's public key to authenticate the ECDH exchange, and all is well.

One other thing I want to bring up:

In my implementation, I wanted to hardcode a static key pair into both sides

If you're not actually using a certificate authority, then you could have both sides generate a long term ECDH key pair, and just install Alice's public key on Bob, and Bob's public key on Alice. This would also foil a MITM attack (as Mallet can't replace the public keys with his own). There is an issue about updating the keys (we never want an immortal key; every key ought to have an expiry date), and there's no obvious way to update keys here.

Of course, if that's what you're doing, and you're happy with it, then it's not clear why you actually need to bring public key crypto onto the table. If Alice and Bob both share a Message Authentication Code (MAC) key, then during negotation, Alice and Bob can exchange nonces, and then both compute $\text{MAC}_{key}( Nonce_{Alice} | Nonce_{Bob} )$; that's a shared secret that's a whole lot faster and easier than ECDH.

The other concern is a potential device compromise attack (which may or may not be relevant to you). In this attack, we assume Mallet breaks into Alice, and learns all her secrets. Now, going forward, Mallet can then pretend to be Alice (and there's nothing we can do about that). However, with the ECDH preconfigured private keys (or the shared MAC key), what Mallet can do is go back and decrypt previously recorded communicates by Alice (because Mallet now keys Alice's private key). In contrast, in an ECDSA/ECDH scenario (where Alice and Bob select the ECDH keys randomly each time), he cannot (assuming Alice zeroizes all her keying material when she's done with it).

Now, obviously, and ECDSA/ECDH protocol will be more complicated then one just using ECDH. Is the extra complication warranted in your case? That, you have to decide for yourself.

• Thanks poncho, that was very insightful. I also thought about hard coding ECDH keys, but I was (and still am) hesitant due to the missing forward secrecy and the key immortality. It seems like the guides I read either missed to mention certificates, or I just straight out missed that mention. – Sossenbinder Jun 20 '17 at 15:11


text:
# Two pendulums

In the two pictures above, [A] is a spring pendulum installed on a frictionless floor, and [B] is a simple pendulum installed on a ceiling. Which of the following statements is correct? (Ignore all frictional forces, and suppose that the angle $$\theta$$ of the simple pendulum is very small.)

a) The directions of the forces acting on [A] and [B] are opposite to the directions of the displacements.

b) The greater the masses of the two pendulums, the greater the periods of the harmonic oscillations.

c) If we install these two pendulums on the moon where the gravitational acceleration is smaller than on the earth, then only the period of [B] gets longer.

×


text:
# Circles Connected with a Triangle

1) If $r$ denotes in-radius, then

2) Circum radius $R$ is given by

3) If ${r_1},{r_2},{r_3}$ denotes $e -$radii, then

4) ${r_1} + {r_2} + {r_3} - r = 4R$

5) In an equilateral triangle $r:R:{r_1} = 1:2:3$


text:
# If $A$ is a non-empty subset of $R$ is every point of $A$ either an isolated point or a limit point?

From what I can gather, a limit point is a point $a \in A$ such that the open ball $B(a; \delta)$ contains a point other than $a$. While an isolated point is a point $b \in A$ such that the open ball $B(b;\delta)$ contains no point different from $b$. So, is every point always a limit point or an isolated point?

-
Once you clarify the quantifiers on $\delta$, your answer will be YES. –  GEdgar Nov 23 '12 at 0:13

## 3 Answers

You should be a lot more careful with your definitions, there are a couple important parts missing:

1. Let $X$ be a metric space and $A\subset X$. A point $a\in X$ is said to be a limit point of $A$ if for all $\delta>0$, there is an $x\in A\cap B(a;\delta)\backslash\{a\}$.

Notice: a limit point need not be in $A$! Example: $A=(0,1)\subset\Bbb{R}$. Both $0$ and $1$ are limit points of $A$.

1. Let $X$ be a metric space and $A\subset X$. A point $b\in A$ is an isolated point of $A$ if there exists $\delta>0$ such that $A\cap B(b;\delta)\backslash\{b\}=\emptyset$.

Notice: isolated points must be in $A$.

So to answer your question, it is easy to show that $b\in A$ is an isolated point of $A$ if and only if $b$ is not a limit point of $A$. So if you only consider points in $A$, then the answer to your question is yes. However the statement "a point is either a limit point or an isolated point" is technically false, since it is possible to be neither if your point is not in $A$ (e.g. take $x=2$ with $A=(0,1)$; $x$ is neither a limit point nor an isolated point of $A$).

-
THank you so much! This clarifies alot! –  Eric Nov 23 '12 at 1:05

In your definition, you forgot the important part: the $\exists$ and the $\forall$. Once you clarify this, as @GEdgar said, the answer will clearly be yes.

-

A limit point of a set $B$ is a point $a$ such that EVERY open ball about $a$, no matter how small, contains some point in $B$ other than $a$ itself. A limit point of $B$ need not be a member of $B$, but may be. You can't omit the word "every".

An isolated point of $B$ is a point $a$ that is a member of $B$, but such that some open ball centered at $a$ contains no point of $B$ other than $a$.

A point $a$ that does not belong to $B$, and is the center of some open ball that does not intersect $B$, is neither a limit point of $B$ nor an isolated point of $B$.

-


text:
# 9 Toolbox

First read the Statistical Modelling section of Tutorial.

### 9.0.1 Non-normal latent variables (random effects)

The underlying latent random variables in TMB must be Gaussian for the Laplace approximation to be accurate. To obtain other distributions, say a gamma distribution, the “transformation trick” can be used. We start out with normally distributed variables u and transform these into new variables w via the pnorm and qgamma functions as follows:

PARAMETER_VECTOR(u);                             // Underlying latent random variables
Type nll=Type(0.0);
nll -= sum(dnorm(u,Type(0),Type(1),true));       // Assign N(0,1) distribution u
vector<Type> v = pnorm(u,Type(0),Type(1));  // Uniformly distributed variables (on [0,1])
vector<Type> w = qgamma(v,shape,scale);

w now has a gamma distribution.

### 9.0.2 Discrete latent variables

The Laplace approximation can not be applied to discrete latent variables that occur in mixture models and HMMs (Hidden Markov models). However, such likelihoods have analytic expressions, and may be coded up in TMB. TMB would still calculate the exact gradient of the HMM likelihood.

### 9.0.3 Mixture models

Although mixture models are a special case of discrete latent variable models, they do deserve special attention. Consider the case that we want a mixture of two zero-mean normal distributions (with different standard deviations). This can be implemented as:

DATA_VECTOR(x);
PARAMETER_VECTOR(sigma);      // sigma0 og sigma1
PARAMETER(p);                 // Mixture proportion of model 0
Type nll=Type(0.0);
nll -= sum( log(      p  * dnorm(x, Type(0), sigma(0), false)
+ (1.0-p) * dnorm(x, Type(0), sigma(1), false) ) );

### 9.0.4 Time series

Autoregressive (AR) processes may be implemented using the compact notation of section Densities. The resulting AR process may be applied both in the observational part and in the distribution of a latent variable.

Nonlinear time must be implemented from scratch, as in the example thetalog.cpp

### 9.0.5 Spatial models

TMB has strong support for spatial model and space-time models via the GMRF() and SEPARABLE() functions, and the notion of a distribution. The reader is referred to section Densities for details and examples.


text:
# Aspect-oriented vs explicit style in Python [closed]

Readability counts, but is very subjective. The following snippets are equivalent in functionality and turn a generator iterator into a chunked HTTP response in Flask. Which of those two patterns is more Pythonic, readable and convenient?

A) Aspect style with function decorators that change the return value:

@app.route('/')
@optional_streaming_decorator
@progress_log_decorator
def index() -> Iterator:
"""Index page, optionally HTTP chunk-streamed and formatted."""
return Foo.get_instance().are_changes_locked()

or

B) explicit decorators within the function body

@app.route('/')
"""Index page, optionally HTTP chunk-streamed and formatted."""
response = Foo.get_instance().are_changes_locked()

• Around here, we generally don't like brevity. – Stephen Rauch Jul 1 '19 at 2:20
• I added docstrings. The code above is now exactly as it is in my project, except from the Foo class, which is irrelevant for this example. – Hubert Grzeskowiak Jul 1 '19 at 3:19
• You say yourself that it is subjective, that IMHO means its not a good fit for the kind of "objective" QA-style system here. In addition, you did not provide a lot of code to judge the code/differences in a greater context, which makes this question tend even more to the off-topic side of things. – AlexV Jul 1 '19 at 6:11
• I don't see how this question could possibly be off-topic. It is matched by the first point of on-topic examples: "If you have a working piece of code from your project and are looking for open-ended feedback in the following areas: Application of best practices and design pattern usage (...)". This question is about the usage of decorators for transforming the return value of a Flask view function and I provided a real piece of code I am using in production. – Hubert Grzeskowiak Jul 1 '19 at 6:57

are all subjective and open to debate, even though "Pythonic" is less so than the others. That said, a simplified version may be illustrative. Comparing

@foo
@bar
def baz(value: T) -> T:
return value

to

def baz(value: T) -> FooT:
return foo(bar(value))

there are two issues with the former:

1. The final return type is now hidden in foo.
2. It is easy to confuse the layering - is baz(value) equivalent to foo(bar(baz(value))) or bar(foo(baz(value))) (or even baz(foo(bar(value))) in case of a novice)? Nested decorators come up so rarely that I would have to look at the documentation to be absolutely sure whether they were in the right sequence.

There seems to be two situations where multi-level decorators would be fine:

1. If they pass through the return value unchanged. A logger would be a typical example.
2. If the decorators are commutative, that is, their order doesn't matter for the outcome.


text:
# How do I make a commutative diagram with LaTeX? [duplicate]

How do I make a diagram like this? Thanks in advance

• \documentclass{article} \usepackage{tikz-cd} \usepackage{amsfonts} \begin{document} \begin{tikzcd} & \mathbb{F} \arrow[dl,"\mu"'] \arrow[dr,"\nu"] & \\ \mathbb{P} & & \mathbb{M}\\ \end{tikzcd} \end{document}
– user121799
Jul 31 '19 at 0:12
• Have you tried some code? Jul 31 '19 at 0:15
• \documentclass[tikz,border=2mm]{standalone} \usepackage{amsfonts} \begin{document} \begin{tikzpicture} \path (0,0) node (F) {$\mathbb{F}$} +(-45:1.5) node (M) {$\mathbb{M}$} +(-135:1.5) node (P) {$\mathbb{P}$}; \draw[->] (F)--(M) node[pos=.3,right]{$\nu$}; \draw[->] (F)--(P) node[pos=.3,left]{$\mu$}; \end{tikzpicture} \end{document} Jul 31 '19 at 0:23
• @BlackMild Hey, thanks for the reply. Is there a way to make the arrows bigger? They are too short on my document. Also, How do I put it in the center of the page? Than Jul 31 '19 at 0:30
• @marmot Thanks for the reply. The letters above the arrows do not appear for some reason Jul 31 '19 at 0:31

Such diagrams can be drawn with tikz-cd. This site is full of examples, and the manual is very well written.

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{amsfonts}
\begin{document}
\begin{tikzcd}
& \mathbb{F} \arrow[dl,"\mu"'] \arrow[dr,"\nu"] &  \\
\mathbb{P} & & \mathbb{M}\\
\end{tikzcd}
\end{document}

For bigger arrows, you can use [line width=1pt] or [thick] right after \begin{tikzpicture}.

\documentclass{article}
\usepackage{tikz}
\usepackage{amsfonts}
\begin{document}
\begin{center}
\begin{tikzpicture}[thick]
\path
(0,0)       node (F) {$\mathbb{F}$}
+(-45:1.5)  node (M) {$\mathbb{M}$}
+(-135:1.5) node (P) {$\mathbb{P}$};
\draw[->] (F)--(M) node[pos=.3,right]{$\nu$};
\draw[->] (F)--(P) node[pos=.3,left]{$\mu$};
\end{tikzpicture}
\end{center}
\end{document}
• @marmot nope! my mind is free. My code is elegant, so I make it community wiki Jul 31 '19 at 1:17
• @marmot I recommend you unretiring! Jul 31 '19 at 1:20
• Your solution is original, but a tikz-cd one is more flexible and simpler. Jul 31 '19 at 12:10
• @CarLaTeX: with (original) plain tikz, I can fine-tune every commuative diagram. I don't know why tikz-cd is more flexible! I think tikz-cd is well-fitted for one who are not familiar with tikz. The amount of time for learning new syntax, new commands of tikz-cd is equal the amount of time for learning basic TikZ. Jul 31 '19 at 16:43
• It's more flexible because you don't have to set the positions explicitly. It's more convenient if you have to add new elements. Jul 31 '19 at 17:45

Here there is my proposal using the same tips of tikz-cd but with another package called xy. I have added \usepackage[bb = boondox]{mathalfa} to give you the same mathematical double struck capital. With the option @R=.6pc@C=.6pc you can increase or decrease the lenghts of the rows R, or the columns C.

\documentclass[12pt]{standalone}
\usepackage[all,cmtip]{xy}
\usepackage[bb = boondox]{mathalfa}
\begin{document}
\xymatrix@R=.6pc@C=.6pc
{ & \mathbb{F} \ar[dl]_{\scriptscriptstyle\mu} \ar[dr]^{\scriptscriptstyle\nu}  & \\
\mathbb{P} & & \mathbb{M}
}
\end{document}


text:
# set_exposure¶

sherpa.astro.ui.set_exposure(id, exptime=None, bkg_id=None)

Change the exposure time of a PHA data set.

The exposure time of a PHA data set is taken from the EXPOSURE keyword in its header, but it can be changed once the file has been loaded.

Parameters
• id (int or str, optional) – The identifier for the data set to use. If not given then the default identifier is used, as returned by get_default_id.

• exptime (num) – The exposure time, in seconds.

• bkg_id (int or str, optional) – Set to identify which background component to set. The default value (None) means that this is for the source component of the data set.

get_exposure()

Return the exposure time of a PHA data set.

set_areascal()

Change the fractional area factor of a PHA data set.

set_backscal()

Change the area scaling of a PHA data set.

Notes

The function does not follow the normal Python standards for parameter use, since it is designed for easy interactive use. When called with a single un-named argument, it is taken to be the exptime parameter. If given two un-named arguments, then they are interpreted as the id and exptime parameters, respectively. The remaining parameters are expected to be given as named arguments.

Examples

Increase the exposure time of the default data set by 5 per cent.

>>> etime = get_exposure()
>>> set_exposure(etime * 1.05)

Use the EXPOSURE value from the ARF, rather than the value from the PHA file, for data set 2:

>>> set_exposure(2, get_arf(2).exposure)

Set the exposure time of the second background component of the ‘jet’ data set.

>>> set_exposure('jet', 12324.45, bkg_id=2)


text:
# ICHEP2018 SEOUL

Jul 4 – 11, 2018
COEX, SEOUL
Asia/Seoul timezone

## Search for a heavy dark photon at future e^+e^− colliders

Jul 7, 2018, 5:15 PM
15m
203 (COEX, Seoul)

### 203

#### COEX, Seoul

Parallel Beyond the Standard Model

Gang Li

### Description

A coupling of a dark photon $A'$ from a $U(1)_{A'}$ with the standard model (SM) particles can be generated through kinetic mixing represented by a parameter $\epsilon$. A non-zero $\epsilon$ also induces a mixing between $A'$ and $Z$ if dark photon mass $m_{A'}$ is not zero. This mixing can be large when $m_{A'}$ is close to $m_Z$ even if the parameter $\epsilon$ is small. Many efforts have been made to constrain the parameter $\epsilon$ for a low dark photon mass $m_{A'}$ compared with the $Z$ boson mass $m_Z$. We study the search for dark photon in $e^+e^- \to \gamma A' \to \gamma \mu^+ \mu^-$ for a dark photon mass $m_{A'}$ as large as kinematically allowed at future $e^+e^-$ colliders. For large $m_{A'}$, care should be taken to properly treat possible large mixing between $A'$ and $Z$. We obtain sensitivities to the parameter $\epsilon$ for a wide range of dark photon mass at planed $e^+\;e^-$ colliders, such as Circular Electron Positron Collider (CEPC), International Linear Collider (ILC) and Future Circular Collider (FCC-ee). For the dark photon mass $20~\text{GeV}\lesssim m_{A^{\prime}}\lesssim 330~\text{GeV}$, the $2\sigma$ exclusion limits on the mixing parameter are $\epsilon\lesssim 10^{-3}-10^{-2}$. The CEPC with $\sqrt{s}=240~\text{GeV}$ and FCC-ee with $\sqrt{s}=160~\text{GeV}$ are more sensitive than the constraint from current LHCb measurement once the dark photon mass $m_{A^{\prime}}\gtrsim 50~\text{GeV}$. For $m_{A^{\prime}}\gtrsim 220~\text{GeV}$, the sensitivity at the FCC-ee with $\sqrt{s}=350~\text{GeV}$ and $1.5~\text{ab}^{-1}$ is better than that at the 13~TeV LHC with $300~\text{fb}^{-1}$, while the sensitivity at the CEPC with $\sqrt{s}=240~\text{GeV}$ and $5~\text{ab}^{-1}$ can be even better than that at 13~TeV LHC with $3~\text{ab}^{-1}$ for $m_{A^{\prime}}\gtrsim 180~\text{GeV}$. We also comment on sensitivities of $e^+e^-\to \gamma A^{\prime}$ with dark photon decay into several other channels at future $e^+e^-$ colliders.

### Primary authors

Mr Min He (Shanghai Jiao Tong University) Prof. Xiao-Gang He (National Taiwan University) Mr Cheng-Kai Huang (National Taiwan University)


text:
Ok so we are given a Markov chain $X_n$, $P=P(ij)$ as the transition matrix and the $(\pi_1,\pi_2,\pi_3,...,\pi_n)$ as steady-state distribution of the chain. We are asked to prove that for every $i$:

$\sum_{i\neq j} \pi_iPij = \sum_{j\neq i} \pi_jPji$

Can somebody explain me what that means and why it is (obviously true for every steady -state distribution? Plus, how do we prove it??

• Are you sure the required equation isn't: for each state $i$, that $\sum_{j\neq i} \pi_i P_{ij} = \sum_{j\neq i}\pi_j P_{ji}$? This would be true. – Mick A Feb 5 '16 at 19:56
• @MickA The writing is a bit sloppy, in that both sums are over $j$ at fixed $i$, but I think we know what is meant. – Ian Feb 5 '16 at 20:19
• @Ian In that case, it's not the detailed balance equation of reversibility. It's saying the long term rate of entering state $i$ equals the long term rate of leaving state $i$, which I think is true. – Mick A Feb 5 '16 at 20:26
• @MickA Oh, never mind, yes, I forgot about the sum. You are right, I will remove my previous comments. – Ian Feb 5 '16 at 20:52
• @Ian No problem. BTW, this is called the Global Balance Equations (still under assumption that the OP intended what is in my first comment). Ref: en.wikipedia.org/wiki/Balance_equation#Global_balance – Mick A Feb 5 '16 at 20:56

I think you need the condition that the Markov Chain is reversible.

Def: Let $X$ be an irreducible Markov chain such that $X_n$ has the stationary distribution $\mathbb{\pi}$ for all $n$. The chain is called reversible if the transition matrices of $X$ and its time-reversal $Y$ are the same, which is to say that $$\pi_iPij = \pi_jPji \:\:\:\: \forall i,j$$

Thm: Let $P$ be the transition matrix of an irreducible chain $X$, and suppose that there exists a distribution $\mathbb{\pi}$ such that $$\pi_iPij = \pi_jPji \:\:\:\: \forall i,j$$ Then $\mathbb{\pi}$ is a stationary distribution of the chain. Furthermore, $X$ is reversible in equilibrium.

Suppose that $\mathbb{\pi}$ satisfies these conditions, then

$$\sum_{i} \pi_iPij = \sum_{i} \pi_jPji = \pi_j \sum_{i} Pji = \pi_j$$

The other answer is incorrect in saying that you need detailed balance. Intuitively, the equation in the OP says that the probability going into state $i$ is equal to the probability going out of state $i$, when the distribution is the stationary distribution. But the difference between these two quantities is $(\pi P - \pi)_i$, which is zero by the definition of $\pi$. (In my notation, $P$ is the transition probability matrix and is taken to be row-stochastic, and so $\pi$ is a row vector.)


text:
## Entropy production

Let us consider some trajectory ϕ(r,t) from time t = ti to t = tf. The rate of entropy production S is defined to be the logarithm of the ratio of forward probability to the backwards probability:

$\mathcal{S}=\lim_{(t_f-t_i)\rightarrow\infty}\frac{1}{t_f-t_i}\left<\ln\left(\frac{P_F[\phi]}{P_B[\phi]}\right)\right>$,

where PF[ϕ] is the probability functional of obtaining a particular trajectory $\left\{\phi(\mathbf{r},t)|t\in[t_i,t_f]\right\}$ and PB[ϕ] is the probability functional of obtaining the same trajectory going backwards in time (see image below). In another word, entropy production is a measure of time-irreversibility.

The angle brackets above $\left<\dots\right>$ indicates averaging over all noise realizations.

## Entropy production for active model B

Active model B is a model for phase separation in active matter, which is a derivative of the active model B+ (see previous post). The active model B dynamics is given by:

$\frac{\partial\phi}{\partial t}+\nabla\cdot\left(\mathbf{J}^{d}+\boldsymbol{\Lambda}\right)=0$,

Jd is the deterministic current and Λ is a Gaussian white noise with zero mean and delta function correlation:

$\left<\Lambda_\alpha(\mathbf{r},t)\Lambda_\beta(\mathbf{r}',t')\right>=2D\delta_{\alpha\beta}\delta(\mathbf{r}-\mathbf{r}')\delta(t-t')$

The deterministic current is given by:

$\mathbf{J}_{d} =-\nabla\underbrace{\left(\frac{\delta F}{\delta\phi}+\lambda|\nabla\phi|^{2}\right)}_{\mu}$

where μ is the chemical potential, which consists of the passive/equilibrium part: δF/δϕ and the active part: $\lambda|\nabla\phi|^2$. The rate of entropy production for this dynamics can be shown to be given by (Nardini, Fodor, Tjhung, van Wijland, Tailleur, Cates, PRX, (2017)):

\begin{align} \mathcal{S} & =\frac{1}{\tau}\int_{0}^{\tau}dt\,\frac{\partial\phi}{\partial t}\circ\mu\nonumber\\ & =\frac{1}{\tau}\sum_{t}\Delta t\frac{\phi_{t+\Delta t}-\phi_{t-\Delta t}}{2\Delta t}\mu_{t},\nonumber \end{align}

where the time integral is interpreted as Stratonovich. ϕt is the density field at time t and μt is the chemical potential at time t. The reason for the Strotonovich choice is follows:

When we are computing entropy production, basically, we are comparing the trajectory going forward in time and the trajectory going backwards in time.

Now the time is discretized into t = 0, dt, 2dt, 3dt, …. That means the trajectory is also split into segments. The way we split the trajectory is done in the Stratonovich way. That means the value of ϕ at time t means the value of ϕ mid-point of [t, t+dt]. i.e. ϕ(r,t+dt/2). If we discretize the trajectory in Ito’ way, the time-reversed of that trajectory is not identical (see drawing below).

However, when we perform the simulations, we do it in Ito’ way. i.e. we start from ϕ(r,0), then we update the time to get ϕ(r,0), ϕ(r,dt), ϕ(r,2dt), ϕ(r,3dt), ….


text:
## Reblog: Factorization diagrams

The Math Less Traveled over here shows off a lovely way of visualizing the factoring of integers by putting them into patterns inspired by the regular polygons. Some numbers factor into wonderfully obvious patterns; some turn into muddles of dots because integers just work that way. They’re all attractive ways to look at numbers, though.

In an idle moment a while ago I wrote a program to generate "factorization diagrams". Here’s 700:

It’s easy to see (I hope), just by looking at the arrangement of dots, that there are $latex 7 \times 5 \times 5 \times 2 \times 2$ in total.

Here’s how I did it. First, a few imports: a function to do factorization of integers, and a library to draw pictures (yes, this is the library I wrote myself; I promise to write more about it soon!).

>moduleFactorizationwhere>>importMath.NumberTheory.Primes.Factorisation(factorise)>>importDiagrams.Prelude>importDiagrams.Backend.Cairo.CmdLine>>typePicture=DiagramCairoR2

The primeLayout function takes an integer n (assumed to be a prime number) and some sort of picture, and symmetrically arranges n copies of the picture.

View original post 583 more words

## Setting Out To Trap A Zoid

I was ready to go with a little essay about how I ultimately figured out the area of a trapezoid, based on the formula for the area of triangles, when I realized that it was much easier to show this with a diagram. And I had a diagram drawn out pretty well, at least to the limits of my drawing ability and my power to use Photoshop Elements to do the drawing. But then it struck me that there’s a peril in using a diagram when you want to prove anything, and the nature of those perils deserved some attention.
Continue reading “Setting Out To Trap A Zoid”


text:
#### How I Started Using Emacs

##### June 17, 2019
emacs org

This is how I started using GNU Emacs with no prior experience. This is intended to help those who want to start using Emacs as well. I’ll start from a base setup, show you where I looked around for help, show you how I found myself using my current configuration. While this post goes through the steps to get started with Emacs, I definitely omitted the steps that didn’t help or the parts where I floundered around not knowing what I was doing.

My primary motivation for using Emacs was its org-mode, Emac’s organizational software. I heard amazing things about the spread sheets, the TODO lists, agendas, calendars, note-taking, paper writing, life dominating capabilities, so I had to try it out. Even if it meant entering the Church of Emacs for a short while.

## Installing Emacs

Even though Emacs can be used through a terminal emulator, it’s best to use GUI Emacs (unlike GUI Vim, which offers no other benefits compared to Terminal VIm) because in GUI Emacs, you can display images, view PDF documents, interact with the system clipboard natively out the of the box, rich text formatting options, and more. Therefore, always use GUI Emacs, it offers so much more capabilities.

On Mac OS, you can just run brew cask install emacs and it should automatically download the latest stable version. For reference, at the time of this post I was using Emacs 26.2.

For those that want to build from source or install in a different manner, consult this page.

## To be or not to be evil

For the unaware, evil mode is a popular Emacs Vi mode emulation layer (I’m sure the name has no other connotation at all). I’ve used vim extensively in the past, but I wasn’t sure if I wanted to try and use evil in Emacs straight away, since I would have no idea about shortcut conflicts, or what parts Emacs does better than vim. Therefore, I decided to try using plain Emacs and start from there.

## Plain Emacs

I gave a genuine try to use pure Emacs, by going through the tutorial (C-h t), however, I could not get used to it. I was too used to using HJKL to navigate between lines. The amount of times I pressed i to enter Insert mode and then forget I wasn’t in vim was uncountable; same with pressing ESC to leave Insert mode and then realizing I wasn’t in Insert mode. I honestly cannot fathom for my life how using C-n and C-p to move up and down lines can be part of any sane workflow. In fact, I found that a lot of 1 key press actions in Vim’s insert mode require multiple key presses in Emacs. Vim’s editing keybindings were just too crucial to me to immediately switch.

Because of this, I bit the bullet and started researching the best way to install evil into Emacs. Enter the world of Emacs configurations.

## Emacs Configuration

To the best of my knowledge, using the use-package plugin is the best way to configure Emacs and various package options. According to the README, use-package allows you to “isolate package configuration in your .emacs file in a way that is both performance-oriented and tidy”. It seems to be widely used and easy to install, so that’s the package manager I settled on. To install use-package, open the .emacs file in your home directory and paste this in.

;; Configure package.el to include MELPA.

(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

This code (written in ELisp), simply requires package.el, Emacs’ built in package manager. It adds the package archive Melpa to the list of repositories, an online repository store of Emacs packages. Melpa seems to be the most complete and almost every project is one Melpa, so I only use Melpa. It’s possible to add more if needed, of course.

Now that we have initialized the default package manager, we’ll use that to install use-package.

;; Ensure that use-package is installed.
;;
;; If use-package isn't already installed, it's extremely likely that this is a
;; fresh installation! So we'll want to update the package repository and
(when (not (package-installed-p 'use-package))
(package-refresh-contents)
(package-install 'use-package))

Now whenever we want to install some other package, we can use use-package to install that package.

## Install evil

Let’s use use-package to install evil get join the dark side of Emacs. Paste this into your .emacs file.

(use-package evil
:config
(evil-mode 1))

use-package searches the package archives for something called evil, sets any configurations, and then activates evil mode. Now you can restart Emacs, and you should automatically be in evil mode. Try typing some text and editing it using the key bindings.

If you open up your .emacs file again, you can see that emacs generated some extra code that looks something like this:

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages
(quote use-package ...)
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)

This is automatically generated and you shouldn’t worry about it. If you accidentally ignore the warnings not to mess with it as I did, you can simply delete all of it, restart Emacs, and it should be automatically regenerated.

Now that we have evil mode set up, let’s turn to org mode.

## org mode

Now as stated in the beginning, my primary goal was to be able to get started with org mode, for all its organizational goodies. org comes preinstalled on later versions, Emacs but if necessary, you can also just install org using use-package. I spent a lot of time going through tutorials and various other resouces, and a lot of them are quite good, so I’m going to list a couple resources.

I suggest going through the Org-mode guide the most, it has the best concise documentation of the most commonly used features.

## Configurations with org-babel

One of the cooler things that org can do is write code blocks inline and execute them. Take the Hello World function defined in Python below.

import random
print("Hello, this is a random number:", random.random())

In an org-file, it would look like this (notice that we name the code block):

#+NAME: hello-world
#+BEGIN_SRC python :results output
import random
print("Hello, this is a random number:", random.random())
#+END_SRC

We can then call that code block by executing it. With your cursor in the code-block, press C-c C-c. The output should be as follows.

#+RESULTS: hello-world
: ('Hello, this is a random number:', 0.35818895069511747)

So you can execute arbitrary code in an org mode file. This is obviously very cool and also a little dangerous. Always make sure you know what code you’re executing, because this allows arbitary code execution on your system (this is the Emacs equivalent of falling for a phishing attack).

Even more important is that this implies that you can write Emacs Lisp in your org file and then execute it. So why not write your configuration file in an org file, and then execute it? This allows you to document your configuration in the same file as your configuration file. You could theoretically do the same for any code file using comments, but org mode is just so much more featured that it just feels better to write in org.

In fact, my current configuration file is actually just an org file. My .emacs is very minimal. Aside from the code to install use-package, I only have one more manually written line:

(org-babel-load-file "~/.emacs.d/configuration.org")

org-babel-load-file parses an org-file, extracts all the code segments, and places it into it’s own dedicated file that is then executed. so my “~/.emacs.d/configuration.el” is generated by org-babel from my “~/.emacs.d/configuration.org” file. You can do this as well. IMO, writing in org just feels much better than writing pure Emacs Lisp.

For the remainder of this article, I’m going to install a couple things by writing the installation/configuration code in org. You can copy this Emacs Lisp code into your own configuration org file. In my configuration org file, I always try to comment the code above it, so I know what I did reading it years later.

For reference, my entire .emacs file:

;; ===== Custom load definition.
;; ===== Load from configuration org file

;; Configure package.el to include MELPA.
(require 'package)
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)

;; Ensure that use-package is installed.
;;
;; If use-package isn't already installed, it's extremely likely that this is a
;; fresh installation! So we'll want to update the package repository and
(when (not (package-installed-p 'use-package))
(package-refresh-contents)
(package-install 'use-package))

## Theme

The theme of your editor could be even more important than the actual editor itself. After all, you gotta make your coworkers jealous when they see how cool your system looks.

Personally, I’m a fan of the Doom City Lights Theme.

To install this, paste the following code into your configuration.org file.

#+BEGIN_SRC emacs-lisp
(use-package doom-themes
:init
:config
(setq doom-themes-enable-bold nil    ; if nil, bold is universally disabled
doom-themes-enable-italic nil) ; if nil, italics is universally disabled
(doom-themes-org-config)
)
#+END_SRC

## Sane Emacs Configurations

A lot of the default configurations for Emacs are a little outdated to say the least. sensible-defaults.el is a collection of Emacs configurations that are relatively non-intrusive and useful, including:

• Ensuring that files end with newlines,
• Always enabling syntax highlighting,
• Increasing the garbage collection threshold,
• Defaulting line-length to 80 characters,
• Creating parent directories after saving a deeply nested file,
• Making dired file sizes human-readable

and more. Because they are all exported as several ELisp functions, you can pick the ones that you want to use, or simply include all of them by running

#+BEGIN_SRC emacs-lisp
(sensible-defaults/use-all-settings)
(sensible-defaults/use-all-keybindings)
#+END_SRC

That’s it. I find some of the configurations non-obvious, so I pick and choose the ones I want, and add a few of my own custom configurations, but sensible-defaults.el is still a good option to look at.

## Personal Information

This is totally unnecessary, but if you want Emacs to know who you are, then set:

#+BEGIN_SRC emacs-lisp
(setq user-full-name "Terrence Ho"
#+END_SRC
#+END_SRC

## org TODOs

One of the most powerful features of org is it’s TODO management. Any line starting with several bullet points (Ex: *) is a headline. Headlines can become TODO items if the first word on the headline is TODO or DONE.

Let’s assume that we want to set more than just TODO/DONE states. I have multiple states set up, such as TODO, IN-PROGRESS, WAITING, DONE, and CANCELLED. Note that we also want the CANCELLED state to be equivalent to a DONE state, since if something is cancelled, we don’t want it to be done in the future. Adapt the following code according to how you want to set up your TODOs.

#+BEGIN_SRC emacs-lisp
(setq org-log-done 'time)
(setq org-todo-keywords
'((sequence "TODO(t)" "IN-PROGRESS(i)" "WAITING(w@)" "|" "DONE(d)" "CANCELLED(c@)")))
(setq org-todo-keyword-faces
'(("TODO" :foreground "red" :weight bold)
("IN-PROGRESS" :foreground "blue" :weight bold)
("WAITING" :foreground "orange" :weight bold)
("DONE" :foreground "forest green" :weight bold)
("CANCELLED" :foreground "magenta" :weight bold)))
#+END_SRC

This changes the sequence of TODO states, adding the necessary states. Notice the “@” in the CANCELLED and WAITING states: they indicate that we can add a note explaining what an item is waiting for or why something was cancelled.

org by default allows you to switch states by pressing S-LEFT pr S-RIGHT. However, when we have multiple states, we often want to switch directly to the desired state. Add the following code to enable this option.

#+BEGIN_SRC emacs-lisp
(setq org-use-fast-todo-selection t)
#+END_SRC

To switch TODO states, place your cursor onto the headline, then press C-c C-t. This should bring up another buffer listing the possible states. Press the key corresponding to your desired state, and your headline should automatically change to reflect that.

## org ellipsis

When you are hovering over a headline, you can press TAB. This collapses all the text underneath the headline, and replaces the text with an ellipsis (…). I didn’t like the ellipsis, so I replaced it with a “⤵”.

#+BEGIN_SRC emacs-lisp
(setq org-ellipsis "⤵")
(set-face-attribute 'org-ellipsis nil :foreground "##61a49e")
#+END_SRC

## org pretty bullets

The number of the bullets in your headline indicates different levels of headlines, and they correspond to different importance levels (* matches to <h1>, ** matches to <h2>, etc). I’d prefer to look at some prettier, indented bullets, so I replaced them with a package called org-bullets.

#+BEGIN_SRC emacs-lisp
(use-package org-bullets
:init
#+END_SRC

## org file converters

org can export to a bunch of different file systems. I’ll go over the formats I have set up, but in the future if you need to write a paper and transform it into PDF or HTML format, consider writing in org rather than LaTex (powerful but annoying to write) or Markdown (non-standardized and Markdown tables suck).

To convert a file, press C-c C-e. This should being up a side panel listing a bunch of options to convert your files. Choose which file format to convert to, and Emacs should output that file.

### HTML/Markdown

htmlize is a package that helps you convert org files to an HTML page.

#+BEGIN_SRC emacs-lisp
(use-package htmlize)
#+END_SRC

### PDF/LaTex

org can export to PDF thorugh LaTex if you have a Tex toolchain available on your system automatically.

### GitHub Flavored Markdown

GitHub has it’s own flavour of markdown. Well no matter, we can export to that too. Never directly write a README.md directly again!

#+BEGIN_SRC emacs-lisp
(use-package ox-gfm)
'(require 'ox-gfm nil t))
#+END_SRC

### Hugo

This blog is generated with Hugo. I can write my blog posts in org, export them to hugo compatible Markdown with front-matter intact, and publish them.

#+BEGIN_SRC emacs-lisp
(use-package ox-hugo
:ensure t            ;Auto-install the package from Melpa (optional)
:after ox)
#+END_SRC

## Conclusion

My journey into Emacs and Org-Mode has been quite successful. To demonstrate, I’ve written this blog post using org, and I hopefully plan on never writing Markdown again. My current, ever updating configuration file can be seen at My GitHub. Check out the “.emacs.d/configuration.org” file, GitHub can render org files now!

I went from writing code manually in the .emacs file and ended up writing all my configurations in an org file, that holds both the source code and documentation for my configurations. I then also went into a brief overview about how I configure Emacs and org mode specifically.

Emacs is endlessly configureable. There are insanely powerful plugins such as MaGit (git plugin), Projectile (session/project management), Helm (completion framework), TRAMP (SSH remote file support), autocomplete and language servers, and more. I am still figuring out all these other tools, which goes to show how awesome Emacs really is.

I should have a blog post up soon detailing how I organize my blog posts using ox-hugo. Stay tuned for that!

emacs hugo org


text:
Preprint Open Access

# Pervasive Data Profiling, Moral equality and Civic Responsibility

Delacroix, Sylvie

### Dublin Core Export

<?xml version='1.0' encoding='utf-8'?>
<oai_dc:dc xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
<dc:creator>Delacroix, Sylvie</dc:creator>
<dc:date>2017-09-21</dc:date>
<dc:description>So far neither regulatory frameworks nor endeavours to develop bottom-up approaches to data protection have had much success in mitigating the moral hazard inherent in pervasive use of seemingly innocuous, “leaked data”. This paper focuses on two aspects of those risks that are too rarely discussed. They relate to the possibility of civic responsibility (1) and moral equality (2). (1) Ethical agency (and the responsibility it entails) presupposes the possibility of change: when our practices are wanting, someone needs to be able to stand up and question them. Change, in turn, presupposes the ability to break from habitual frames of thought. To what extent is the profilebased tailoring of the environmental architecture that shapes our choices and attitudes hampering the possibility of civic responsibility? The question at stake here is different from the betterknown “right to be forgotten” issue: the latter focuses on the impact of recorded data on others’ perception of oneself. This paper, by contrast, focuses on what may be called the “anchoring effect”: the impact of recorded data on our ability to see the world -and, most importantly, our role in it- differently. The ability to acknowledge a discrepancy between one’s present ethical stand and the person one seeks to be is essential to making sense of any notion of civic responsibility. The danger is that such discrepancy will simply cease to arise in an environment that has been systematically “optimized” in accordance to one’s profile. (2) The second section of this paper explores the extent to which ubiquitous, proactive computing gives rise to a very particular type of vulnerability, one that potentially threatens the moral equality of data-subjects. This vulnerability cannot be addressed by correcting epistemic imbalances. The current regulatory focus on information disclosure has obscured what mere disclosure cannot achieve: empowering data subjects to maintain and develop their sense of self. This may sound overly ambitious. I argue that it is no more so than a commitment to retain a meaningful, practice-relevant concept of civic responsibility.  </dc:description>
<dc:identifier>https://zenodo.org/record/903488</dc:identifier>
<dc:identifier>10.5281/zenodo.903488</dc:identifier>
<dc:identifier>oai:zenodo.org:903488</dc:identifier>
<dc:relation>doi:10.5281/zenodo.903487</dc:relation>
<dc:relation>url:https://zenodo.org/communities/dfp17</dc:relation>
<dc:rights>info:eu-repo/semantics/openAccess</dc:rights>
<dc:subject>pervasive data profiling</dc:subject>
<dc:subject>ubiquitous computing</dc:subject>
<dc:subject>knowledge asymmetry</dc:subject>
<dc:subject>moral equality</dc:subject>
<dc:subject>civic responsibility</dc:subject>
<dc:title>Pervasive Data Profiling, Moral equality and Civic Responsibility</dc:title>
<dc:type>info:eu-repo/semantics/preprint</dc:type>
<dc:type>publication-preprint</dc:type>
</oai_dc:dc>

82
46
views


text:
# Mulitple reference citation with usepackage{cite}

since i want that multiple citations look like [1-5], instead of [1,2,3,4,5] i did the following thing as suggested here "http://texblog.org/2007/05/28/mulitple-reference-citation/"

I load the package \usepackage{cite}, but now i get a lot of error messages:

Paragraph ended before \@citex was complete.

for every empty line in the editor (I do this to get a better overview).

Example:

@misc{A01,

author = {Jones, A. and James, C., and Giannini, J.},

year = {2001},

title = {Title of journal article},

}

\documentclass[preprint,12pt]{elsarticle}
\usepackage{cite}
\usepackage{amssymb}

\usepackage{lineno}
\usepackage{graphicx}
\usepackage{amsmath}
\usepackage{caption}
\usepackage{subcaption}

\journal{Energy}

\begin{document}
lasjfsjlf

sjflsjdlfj \cite{A01}

\bibliographystyle{ieeetr}
\end{document}

Hope someone can help me; thank you

• Can you please include a minimal working example exhibiting this error? – Emma Oct 19 '16 at 16:08
• Added an example --> perhaps \citep works? – Math_reald Oct 19 '16 at 16:57
• It seems elsarticle is not compatible with the cite package. Fortunately, elsarticle itself provides the functionality you want. In your example \citep still works because it is provided by elsarticle and not cite, whereas \cite is provided by elsarticle and then incompatibly overwritten by cite. – Emma Oct 19 '16 at 18:57


text:
# Why goodness of fit via deviance and chisq is poor for poisson regression (glm)?

Simulate a poisson model:

set.seed(1)
predictor <- rnorm(100000, 2.5, 0.5)
# describe(predictor)
lam <- 0.98 * predictor
# describe(lam)

rp <- function(lambda){rpois(1, lambda)}
vrp <- Vectorize(rp)

response <- vrp(lam)
# describe(response)

fit <- glm(response ~ 1, offset=log(predictor), family="poisson")
summary(fit)

Regression:

Call:
glm(formula = response ~ 1, family = "poisson", offset = log(predictor))

Deviance Residuals:
Min       1Q   Median       3Q      Max
-2.8188  -0.8334  -0.1146   0.5777   4.3871

Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -0.017707   0.002018  -8.773   <2e-16 ***
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

(Dispersion parameter for poisson family taken to be 1)

Null deviance: 111501  on 99999  degrees of freedom
Residual deviance: 111501  on 99999  degrees of freedom
AIC: 361334

Number of Fisher Scoring iterations: 5

> pchisq(111501, 99999)
[1] 1

This above should be an exact fit, I don't get why pchisq is giving me so extreme number.

### Update

And it suggests to use pearson's residual instead of deviance to perform a goodness of fit... and it works much better.

ssr <- sum(residuals(fit, type="pearson")^2)
pchisq(ssr, 99999)

• Interesting question. A couple of comments -- (1) rpois will generate from a vector of lambdas as is, you don't need to go through all that trouble to get it to do that; (2) Why do you say the fit should be exact? The model should be correct, but that's not the same as the fit being 'exact', unless you define 'exact' in a somewhat different way to its usual meaning. – Glen_b -Reinstate Monica Dec 16 '13 at 20:23
• @Glen_b (1) Really? Once in an interview I thought rpois would vectorize lambdas, then I failed...that hurt me....I will try it again. (2) by "exact" I mean the model should be correct. So normally I expect the stats be within 0.05 to 0.95 on a few trials with different seeds. – colinfang Dec 16 '13 at 21:29
• Yes really. Just try it for goodness sake: rpois(3,lambda=c(3,100,4)). If you failed the interview for correctly stating the behaviour of rpois, you don't want to work there. Mind you, if you just accept what people tell you when you can easily check, you are going to be dealing with the consequences of other people's mistakes your whole life. – Glen_b -Reinstate Monica Dec 16 '13 at 22:49


text:
# Binary relations between any two sets

I have some doubts regarding relations and binary relations in particular.This is what I understand :

1) The graph $G_R$ of a relation R on X and Y is the subset of X × Y defined by $G_R$ = {(x, y) ∈ X × Y : xRy} . This graph contains all of the information about which elements are related. Conversely, any subset G ⊂ X×Y defines a relation R by: xRy if and only if (x, y) ∈ G. Thus, a relation on X and Y may be (and often is) defined as subset of X × Y . Is it true that for sets, it doesn’t matter how a relation is defined, only what elements are related ?

2)Since any subset of A × B is a relation from A to B, it follows that the number of relations from A to B is $2^{|A×B|} = 2^{|A|·|B|}$.So, if A & B are null sets $\implies$ no. of relations is 1. So, will it lead to the statement that there exist at least one relationship between any two sets in the universe?

• Yes to all the questions. – Tobias Kildetoft Apr 8 '16 at 13:03
• @TobiasKildetoft Are you implying that all the sets in the universe are related to each other ? I think this is only true for any undefined relation and not for any defined relation . For example :Suppose that S is a set of students enrolled in a university and B is a set of books in a library. We might define a relation R on S and B by: $s \in S$ has read $b \in B$. In that case, sRb if and only if s has read b. But in case of an undefined relation we may relate any two sets by saying the null is subset of both. – katipra Apr 8 '16 at 13:17
• I am saying that the answer to your question of whether there is a relation between any two sets is "yes". For example the empty relation. – Tobias Kildetoft Apr 8 '16 at 13:18


text:
In theoretical computer science, and specifically computational complexity theory and circuit complexity, TC is a complexity class of decision problems that can be recognized by threshold circuits, which are Boolean circuits with AND, OR, and Majority gates. For each fixed i, the complexity class TCi consists of all languages that can be recognized by a family of threshold circuits of depth ${\displaystyle O(\log ^{i}n)}$, polynomial size, and unbounded fan-in. The class TC is defined via

${\displaystyle {\mbox{TC))=\bigcup _{i\geq 0}{\mbox{TC))^{i}.}$

## Relation to NC and AC

The relationship between the TC, NC and the AC hierarchy can be summarized as follows:

${\displaystyle {\mbox{NC))^{i}\subseteq {\mbox{AC))^{i}\subseteq {\mbox{TC))^{i}\subseteq {\mbox{NC))^{i+1}.}$

In particular, we know that

${\displaystyle {\mbox{NC))^{0}\subsetneq {\mbox{AC))^{0}\subsetneq {\mbox{TC))^{0}\subseteq {\mbox{NC))^{1}.}$

The first strict containment follows from the fact that NC0 cannot compute any function that depends on all the input bits. Thus choosing a problem that is trivially in AC0 and depends on all bits separates the two classes. (For example, consider the OR function.) The strict containment AC0TC0 follows because parity and majority (which are both in TC0) were shown to be not in AC0.[1][2]

As an immediate consequence of the above containments, we have that NC = AC = TC.

## References

1. ^ Furst, Merrick; Saxe, James B.; Sipser, Michael (1984), "Parity, circuits, and the polynomial-time hierarchy", Mathematical Systems Theory, 17 (1): 13–27, doi:10.1007/BF01744431, MR 0738749.
2. ^ Håstad, Johan (1989), "Almost Optimal Lower Bounds for Small Depth Circuits", in Micali, Silvio (ed.), Randomness and Computation (PDF), Advances in Computing Research, vol. 5, JAI Press, pp. 6–20, ISBN 0-89232-896-7, archived from the original (PDF) on 2012-02-22
• Vollmer, Heribert (1999). Introduction to Circuit Complexity. Berlin: Springer. ISBN 3-540-64310-9.


text:
# An Extended KCA

If Ted gives Jennifer some α -pair ( a , b = α ⋅ a ) and then Jennifer generates another α -pair ( a ′ , b ′ ) , then she knows c such that a ′ = c ⋅ a . In other words, Jennifer knows the relation between a ′ and a . Now, suppose that instead of one, Ted sends Jennifer several α -pairs ( a 1 , b 1 ) , … , ( a d , b d ) (for the same α ); and that again, after receiving these pairs, Jennifer is challenged to generate some other α -pair ( a ′ , b ′ ) . Recall that the main point is that Jennifer must do so although she does not know α .
A natural way for Jennifer to generate such an α -pair, would be to take one of the pairs ( a i , b i ) she received from Ted, and multiply both elements by some c ∈ F ∗ p ; if ( a i , b i ) was an α -pair, then ( c ⋅ a i , c ⋅ b i ) will be one too. But can Jennifer generate α -pairs in more ways now that she’s received multiple α -pairs? Perhaps using several of the received α -pairs simultaneously to get a new one?
The answer is yes: For example, Jennifer can choose two values c 1 , c 2 ∈ F p and compute the pair ( a ′ , b ′ ) = ( c 1 ⋅ a 1 + c 2 ⋅ a 2 , c 1 ⋅ b 1 + c 2 ⋅ b 2 ) . An easy computation shows that, as long as a ′ is non-zero, this is also an α -pair: b ′ = c 1 ⋅ b 1 + c 2 ⋅ b 2 = c 1 α ⋅ a 1 + c 2 α ⋅ a 2 = α ( c 1 ⋅ a 1 + c 2 ⋅ a 2 ) = α ⋅ a ′ . More generally, Jennifer can take any linear combination of the given d pairs – that is choose any c 1 , … , c d ∈ F p and define ( a ′ , b ′ ) = ( ∑ d i = 1 c i a i , ∑ d i = 1 c i b i ) . Note that, if Jennifer uses this strategy to generate her α -pair she will know some linear relation between a ′ and a 1 , … , a d ; that is, she knows c 1 , … , c d such that a ′ = ∑ d i = 1 c i ⋅ a i . The extended KCA states, essentially, that this is the only way Jennifer can generate an α -pair; that is, whenever she succeeds, she will know such a linear relation between a ′ and a 1 , … , a d . More formally, suppose that G is a group of size P with generator G written additively. The d-power Knowledge of Coefficient Assumption (d-KCA) in G is as follows: d-KCA: Suppose Ted chooses random α ∈ F ∗ p and s ∈ F p , and sends to Jennifer the α -pairs ( g , α ⋅ g ) , ( s ⋅ g , α s ⋅ g ) , … , ( s d ⋅ g , α s d ⋅ g ) . Suppose that Jennifer then outputs another α -pair ( a ′ , b ′ ) . Then, except with negligible probability, Jennifer knows c 0 , … , c d ∈ F p such that ∑ d i = 0 c i s i ⋅ g = a ′ . Note that in the d-KCA Ted does not send an arbitrary set of α -pairs, but one with a certain “polynomial structure”. This will be useful in the protocol below.