text:
# All Questions

143 views

### Is there a better way to price options than with historical volatility?

I know that annualized historical volatility calculated with closing prices is a much rougher estimate than implied volatility for the correct "volatility" parameter in options pricing models. ...
47 views

### Cause of long term inflation in the United States [closed]

Does the US government have a policy of printing money? If so what is this number called, who decides what it is, and where can I find it? If not what is the cause of our long term inflation? (I'm ...
216 views

### Black Scholes - how to calculate delta with a vol skew

I am trying to calculate the delta of an option at different strike prices where the underlying has a pronounced implied volatility skew in order to correctly hedge an options strategy. Researching ...
69 views

### Cobb - Douglas Production Function

let's say that we have complete data on the sample of companies about their capital (K), labor (L) and materials used in the production (M) and the total output of each company. Let's have ...
190 views

### What is a canonical book or article to learn pair trading?

Can someone suggest a resource with a clean cut explanation of pair trading?
73 views

### Binary option expression

Given r=0, σ(K)=const Binary=lim┬(ε→0)〖((C(K,σ(K))-C(K+ε,σ(K+ε))))/ε〗 What is the analytical expression for the binary option value? σ(K)=const Therefore, Binary=lim┬(ε→0)〖((C(K)-C(K+ε)))/ε〗 ...
13 views

It doesn't seem yahoo finance and google finance supports download of historical exchange rates. Also, where could we get more accurate exchange rate tick data? Can we get this from open Bloomberg ...
143 views

### Normalization of Market Data in Time Series Correlation

Suppose we have 2 time series of market data, one for each security and we want to correlate between these 2 securities. My question is How do we handle gaps of missing data in the time series? ...
134 views

### Kolmogorov-Smirnov test for Generalized Pareto Distribution

I've fitted my data to a generalized pareto distribution as to model the returns in the tails more accurately. The interior is fitted with kernel distributions. I would like to now test whether the ...
32 views

### How to prove following order?

Consider a consol bond, i.e. a bond which will forever pay one unit of cash at $t = 1, 2, . . ..$ Suppose that the market yield $y$ is constant for all maturities. (a) Compute the price, at $t = 0$, ...
12 views

### Distribution of the differences of the inverse of the integral of a Gaussian Distribution

I have a time series, $P$, undergoing geometric Brownian motion, which varies between $1$ and $1000$. I difference it $P(t) - P(t-1)$ and can see the differences are distributed according to a ...
61 views

### I want to Derive $P(t)=P(t,T_{n})+\sum_{i=1}^{n}[P(t,T_{i-1})-P(t,T_{i})]$

Derive the pricing formula $$P(t)=P(t,T_{n})+\sum_{i=1}^{n}[P(t,T_{i-1})-P(t,T_{i})]$$directly, by constructing a self-financing portfolio which replicates the cash flow of the floating rate bond. ...
55 views

### I want to prove Determine the coupon rate $r$, such that the price of the bond, at $T_0$, equals its face value

Consider a coupon bond, starting at $T_{0}$ , with face value $K$, coupon payments at $T_1, . . . , T_n$ and a fixed coupon rate $r$. Determine the coupon rate $r$, such that the price of the bond, at ...
144 views

### UST Yield Curve Forecasting - Bond Structure Testing

I have a project in mind that I am working on, but have little idea where to start. I am a relative newcomer to python (about 1 years exp.) and limited knowledge of quant finance. What I would like ...
372 views

### Find the order of an ARMA model (q & p )

I fit an ARMA model in Matlab and before I calculate the predicted value with the prediction error I set the order $(p,q)$ to some random value. But how can I determine the number of AR (p) and MA ...
163 views

### IR Yield Curve and Fixing Dates

Consider two FRAs. 3x6 , Effective 3 months from now, terminates in 6 months. The floating leg payer pays 3-month LIBOR. Fixing date for LIBOR 40 business days. To price this at par, the fixed leg ...
245 views

### Key Rate Duration for MBSs greater than Key Rate Tenor

Key Rate Durations (KRD) are essentially some fixed income instrument's price sensitivity to a non-parallel shift in interest rates (i.e., a shift at the "Key" Rate). For example, a 10-year bond's ...
62 views

### Model-independent dynamic portfolio optimization techniques

For a problem where we need to optimize the portfolio based on the data, going for Markowitz MPT has the following advantage: we only have to estimate mean and covariance to find optimal weights. I'd ...
132 views

### Implied volatility and pricing of vanilla options

As far as I understood, implied volatility (IV) is a lucky parametrization of the vanilla option's price. That is, instead of deciding how much the call worth now, you can decide on its IV and put ...
68 views

### An Alphabet Effect?

While I prepared some quick and lazy charts picking just the first 10 symbols out of the SP500 for this other question I observed, that the first 10 symbols (figure 1) actually outperformed the larger ...
47 views

### What is the probability distribution of the changes in $\Delta$?

What are the odds that a 10 delta option will become a 30 delta option in "N" number of days? Is that calculation possible? For instance, I want to know the probability with which my 56 day, 10 ...
691 views

### Par Yield Curves vs Zero Curves

Does it make sense to look at par yield curve for German bonds in the current environment? Because low rates mean that a lot of bonds are trading above much above par (even around 150!). I would ...
141 views

### C# - Using Black Scholes Newton returns NaN occasionally

First caveat: I'm a programmer doing this for a client, and my knowledge of options probably has holes in it. So be a little forgiving here. =) The Issue: When I run Black Scholes Newton against ...
99 views

### Stochastic Differential

Let $W_t$ be a Wiener process. It is clear to me that $dW_t$ is of size $\sqrt{dt}$. This can be seen because $$\mathrm{Var}(W_{t+\Delta} - W_{t})=\Delta.$$ But am I allowed to actually write ...
22 views

### Index tracker and inflation

I'm trying to get my head around how inflation really affects index trackers. I've been looking at this question, but somehow misses the point I want (How To Account For Inflation Over Historical ...
21 views

In various financial models such as CAPM, Black Scholes, one assumes the returns are adjusted for dividends. As I understand it, the share price often (in a relative sense) increases a bit before the ...
24 views

### simple question on DSCR

What is the DSCR for a 2.5 million property generating a 7.5% before tax annual return on equity with a 1.5 million ten year interest-only first mortgage at a 5% annual interest rate? a) 2.00 b) ...
55 views

### risk report factor exposures calculations

I am looking at a risk report which I have inherited. There are 5 lines of code that I want to make sure I understand. The risk report breaks down the exposures, contribution to variance and marginal ...
89 views

### How to compute daily compounded backtest returns closer to real-world results?

I often run quick tests of trading strategies in my analytics suites by: multiplying a vector of signal (lagged, {-1,0,1}) with a time series of daily percentage returns doing a cumulative product ...
83 views

### Best sources for worldwide balance sheet data?

I’m interested in databases with quarterly balance sheet data of the financial sector. I’m aware of the following datasets: -Compustat -Compustat Global -Bankscope Can someone point out other ...
96 views

### Index creation from multiple time-series and variable weights

I am trying to compose one index out of several (three) indices with variable weights, 50%, 25% and 25%. After normalizing and calculating the log returns, what would be the best way to create the ...
105 views

### Black scholes text book

I am looking for an easy and well presented introduction to Black-Scholes theory and stochastic calculus aimed at undergraduate mathematics students. Please can you recommend a book? How about Paul ...
187 views

### Quadratic exponential method (by Andersen) in Heston model

I am having trouble understanding the reasons that led Andersen to define his QE scheme to efficiently simulate Heston Stochastic volatility model (you may check the celebrated scheme here). The ...
23 views

### Historical list of Primary Dealers in Europe

I would be interested in a list of all the banks and financial institutions that have been Primary Dealers in the European Union from the 1980s until today. For a current list you can check this pdf ...
124 views

### LMM. Calibration to swaptions by Brigo and Morini. Volatility of swaption that matures at T=0

I'm reading Brigo D., Mercurio F. Interest Rate Models - Theory and Practice (Springer, 2006)(ISBN 3540221492) and also a source article on LMM cascade calibration to swaptions by Brigo and Morini. I ...
199 views

### In bond pricing, is negative convexity better than positive convexity?

Say that I have two bonds and one of them has positive convexity and the other negative. Which one is better (assuming that you only care about convexity)? I understand that high convexity is ...
81 views

### Optimization metric that takes into account number of trades vs expectancy

In optimizing my automated trading system I find that certain combinations while increasing the expectancy: ...
154 views

### Why is the rate of change of a stock price proportional to the stock price?

When deriving the Black Scholes equation, it is usually stated "we assume the change in the stock price is": $dS=\mu S(t) dt +$random term My question is why is the change in the stock price always ...
100 views

### Information on books about mathematical finance

In the past at my school the subject of "Mathematics of Derivative securities" has been taught out of two books. "Quantitative Finance" by T. Wake Epps and "Options, Futures and Other Derivatives" by ...
121 views

### Logging FIX Messages

I need to persist every single FIX message received or sent by my order gateway for auditing purposes, however it takes more than 1 millisecond to write the bytes to disk. I tried to write in chunks ...
86 views

### Data point discrepancy between Google Finance and Yahoo Finance

I have been comparing the historical stock data I am getting from Google Finance and Yahoo Finance. I am only getting six datapoints per day (date, open, high, low, close, volume). I have downloaded ...
88 views

### Why is OU process stationary?

The mean and variance of OU process have time dependence (exponentially decay in time). So they are not constant in time. How can it to be stationary?
26 views

### Advancers / Decliners data source

What is the best source for this data? I am trying to compute http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:mcclellan_summation in Python.
336 views

### A model to stochastic hazard rate and CDS spread term structure

I'm interested in the term structure of CDS spread. It's known that the Market CDS rate (fair CDS spread or T-maturity spread) of a CDS contract initiated at $s$, maturity $T$ and recovery function ...
162 views

### Provide a bond pricing differential equation and invoke Feynman-Kac

Grateful for any assistance. Consider the process: $dZ=r(t)Z\,dt$ , where $r(t)$ is stochastic and $Z=Z(r,t;T)$ is a zero coupon bond. Provide a bond pricing differential equation and invoke ...
35 views

### American put on a foreign currency

I know that For an American-style put option, early exercise is a optimal for deep in-the-money options. In this case, it may make sense to exercise the option early in order to obtain the profit ...
100 views

### Mean Variance Analysis: what does the solution of the following exercise tells me?

I'm new in here and I hope this is the right board to ask this question. I'm at second year of university and in the Informatics II course the lecturer made us solve the following mean variance ...
49 views

### Dummy variable and negative estimation in GARCH (1.1)

I am trying to use GARCH model for my research. However, when I am running them, I see negative value for alpha and beta. How I can restrict them so that they do not provide me any negative value. Is ...
96 views

### Combine together different strategies in one portfolio [closed]

Hi I have generate equity of my strategies which invest in commodities and currencies at daily interval. What the best method to combine together all strategies in one portfolio? I want to make the ...
106 views

### Automatic trading strategies - what are benchmarks for PL on serious backtesting?

There are plenty books and sites which offer automatic trading strategies (robots) and claim they are very profitable. On the other hand many people do not believe in such things, saying that: if ...

15 30 50 per page


text:
g01 Chapter Contents
g01 Chapter Introduction
NAG Library Manual

# NAG Library Function Documentnag_summary_stats_freq (g01adc)

## 1  Purpose

nag_summary_stats_freq (g01adc) calculates the mean, standard deviation and coefficients of skewness and kurtosis for data grouped in a frequency distribution.

## 2  Specification

 #include #include
 void nag_summary_stats_freq (Integer k, const double x[], const Integer ifreq[], double *xmean, double *xsd, double *xskew, double *xkurt, Integer *n, NagError *fail)

## 3  Description

The input data consist of a univariate frequency distribution, denoted by ${f}_{i}$, for $\mathit{i}=1,2,\dots ,k-1$, and the boundary values of the classes ${x}_{i}$, for $\mathit{i}=1,2,\dots ,k$. Thus the frequency associated with the interval $\left({x}_{i},{x}_{i+1}\right)$ is ${f}_{i}$, and nag_summary_stats_freq (g01adc) assumes that all the values in this interval are concentrated at the point
 $yi=xi+1+xi/2, i=1,2,…,k-1.$
The following quantities are calculated:
(a) total frequency,
 $n=∑i= 1 k- 1fi.$
(b) mean,
 $y-=∑i=1 k-1fiyin.$
(c) standard deviation,
 $s2=∑i= 1 k- 1fi yi-y- 2 n- 1 , n≥ 2.$
(d) coefficient of skewness,
 $s3=∑i=1 k-1fi yi-y- 3 n-1×s23 , n≥2.$
(e) coefficient of kurtosis,
 $s4=∑i= 1 k- 1fi yi-y- 4 n- 1×s24 - 3, n≥ 2.$
The function has been developed primarily for groupings of a continuous variable. If, however, the function is to be used on the frequency distribution of a discrete variable, taking the values ${y}_{1},\dots ,{y}_{k-1}$, then the boundary values for the classes may be defined as follows:
(i) for $k>2$,
 $x1=3y1-y2/2 xj=yj-1+yj/2, j=2,…,k-1 xk=3yk-1-yk-2/2$
(ii) for $k=2$,
 $x1=y1-a and x2=y1+a for any a>0 .$

None.

## 5  Arguments

1:    $\mathbf{k}$IntegerInput
On entry: $k$, the number of class boundaries, which is one more than the number of classes of the frequency distribution.
Constraint: ${\mathbf{k}}>1$.
2:    $\mathbf{x}\left[{\mathbf{k}}\right]$const doubleInput
On entry: the elements of x must contain the boundary values of the classes in ascending order, so that class $\mathit{i}$ is bounded by the values in ${\mathbf{x}}\left[\mathit{i}-1\right]$ and ${\mathbf{x}}\left[\mathit{i}\right]$, for $\mathit{i}=1,2,\dots ,k-1$.
Constraint: ${\mathbf{x}}\left[\mathit{i}\right]<{\mathbf{x}}\left[\mathit{i}+1\right]$, for $\mathit{i}=0,1,\dots ,k-2$.
3:    $\mathbf{ifreq}\left[{\mathbf{k}}\right]$const IntegerInput
On entry: the $\mathit{i}$th element of ifreq must contain the frequency associated with the $\mathit{i}$th class, for $\mathit{i}=1,2,\dots ,k-1$. ${\mathbf{ifreq}}\left[k-1\right]$ is not used by the function.
Constraints:
• ${\mathbf{ifreq}}\left[\mathit{i}-1\right]\ge 0$, for $\mathit{i}=1,2,\dots ,k-1$;
• $\sum _{i=1}^{k-1}{\mathbf{ifreq}}\left[i-1\right]>0$.
4:    $\mathbf{xmean}$double *Output
On exit: the mean value, $\stackrel{-}{y}$.
5:    $\mathbf{xsd}$double *Output
On exit: the standard deviation, ${s}_{2}$.
6:    $\mathbf{xskew}$double *Output
On exit: the coefficient of skewness, ${s}_{3}$.
7:    $\mathbf{xkurt}$double *Output
On exit: the coefficient of kurtosis, ${s}_{4}$.
8:    $\mathbf{n}$Integer *Output
On exit: the total frequency, $n$.
9:    $\mathbf{fail}$NagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

## 6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.2.1.2 in the Essential Introduction for further information.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_FREQ_CONS
Either ${\mathbf{ifreq}}\left[i\right]<0$ for some $i$, or the sum of frequencies is zero.
NE_FREQ_SUM
The total frequency is less than $2$.
NE_INT
On entry, ${\mathbf{k}}=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{k}}>1$.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 3.6.6 in the Essential Introduction for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 3.6.5 in the Essential Introduction for further information.
NE_NOT_INCREASING
On entry, $\mathit{I}=〈\mathit{\text{value}}〉$, ${\mathbf{x}}\left[\mathit{I}-2\right]=〈\mathit{\text{value}}〉$ and ${\mathbf{x}}\left[\mathit{I}-1\right]=〈\mathit{\text{value}}〉$.
Constraint: ${\mathbf{x}}\left[\mathit{I}-2\right]\le {\mathbf{x}}\left[\mathit{I}-1\right]$.

## 7  Accuracy

The method used is believed to be stable.

## 8  Parallelism and Performance

Not applicable.

The time taken by nag_summary_stats_freq (g01adc) increases linearly with $k$.

## 10  Example

In the example program, NPROB determines the number of sets of data to be analysed. For each analysis, the boundary values of the classes and the frequencies are read. After nag_summary_stats_freq (g01adc) has been successfully called, the input data and calculated quantities are printed. In the example, there is one set of data, with $14$ classes.

format: plain


text:
# User:Doneuron

Template:Infobox neuron Template:Portalpar A neuron (Template:Pron-en Template:Respell, also known as a neurone or nerve cell) is an electrically excitable cell that processes and transmits information by electrical and chemical signaling, the latter via synapses, specialized connections with other cells. Neurons connect to each other to form networks. Neurons are the core components of the nervous system, which includes the brain, spinal cord, and peripheral ganglia. A number of specialized types of neurons exist: sensory neurons respond to touch, sound, light and numerous other stimuli affecting cells of the sensory organs that then send signals to the spinal cord and brain. Motor neurons receive signals from the brain and spinal cord and cause muscle contractions and affect glands. Interneurons connect neurons to other neurons within the same region of the brain or spinal cord.

A typical neuron possesses a cell body (often called the soma), dendrites, and an axon. Dendrites are filaments that arise from the cell body, often extending for hundreds of microns and branching multiple times, giving rise to a complex "dendritic tree". An axon is a special cellular filament that arises from the cell body at a site called the axon hillock and travels for a distance, as far as 1 m in humans or even more in other species. The cell body of a neuron frequently gives rise to multiple dendrites, but never to more than one axon, although the axon may branch hundreds of times before it terminates. At the majority of synapses, signals are sent from the axon of one neuron to a dendrite of another. There are, however, many exceptions to these rules: neurons that lack dendrites, neurons that have no axon, synapses that connect an axon to another axon or a dendrite to another dendrite, etc.

All neurons are electrically excitable, maintaining voltage gradients across their membranes by means of metabolically driven ion pumps, which combine with ion channels embedded in the membrane to generate intracellular-versus-extracellular concentration differences of ions such as sodium, potassium, chloride, and calcium. Changes in the cross-membrane voltage can alter the function of voltage-dependent ion channels. If the voltage changes by a large enough amount, an all-or-none electrochemical pulse called an action potential is generated, which travels rapidly along the cell's axon, and activates synaptic connections with other cells when it arrives.

Neurons of the adult brain do not generally undergo cell division, and usually cannot be replaced after being lost, although there are a few known exceptions. In most cases they are generated by special types of stem cells, although astrocytes (a type of glial cell) have been observed to turn into neurons as they are sometimes pluripotent.

## Overview

A neuron is a special type of cell that is found in the bodies of most animals (all members of the group Eumetazoa, to be precise—this excludes only sponges and a few other very simple animals). The features that define a neuron are electrical excitability and the presence of synapses, which are complex membrane junctions used to transmit signals to other cells. The body's neurons, plus the glial cells that give them structural and metabolic support, together constitute the nervous system. In vertebrates, the majority of neurons belong to the central nervous system, but some reside in peripheral ganglia, and many sensory neurons are situated in sensory organs such as the retina and cochlea.

Although neurons are very diverse and there are exceptions to nearly every rule, it is convenient to begin with a schematic description of the structure and function of a "typical" neuron. A typical neuron is divided into three parts: the soma or cell body, dendrites, and axon. The soma is usually compact; the axon and dendrites are filaments that extrude from it. Dendrites typically branch profusely, getting thinner with each branching, and extending their farthest branches a few hundred microns from the soma. The axon leaves the soma at a swelling called the axon hillock, and can extend for great distances, giving rise to hundreds of branches. Unlike dendrites, an axon usually maintains the same diameter as it extends. The soma may give rise to numerous dendrites, but never to more than one axon. Synaptic signals from other neurons are received by the soma and dendrites; signals to other neurons are transmitted by the axon. A typical synapse, then, is a contact between the axon of one neuron and a dendrite or soma of another. Synaptic signals may be excitatory or inhibitory. If the net excitation received by a neuron over a short period of time is large enough, the neuron generates a brief pulse called an action potential, which originates at the soma and propagates rapidly along the axon, activating synapses onto other neurons as it goes.

Many neurons fit the foregoing schema in every respect, but there are also exceptions to most parts of it. There are no neurons that lack a soma, but there are neurons that lack dendrites, and others that lack an axon. Furthermore, in addition to the typical axodendritic and axosomatic synapses, there are axoaxonic (axon-to-axon) and dendrodendritic (dendrite-to-dendrite) synapses.

The key to neural function is the synaptic signalling process, which is partly electrical and partly chemical. The electrical aspect depends on properties of the neuron's membrane. Like all animal cells, every neuron is surrounded by a plasma membrane, a bilayer of lipid molecules with many types of protein structures embedded in it. A lipid bilayer is a powerful electrical insulator, but in neurons, many of the protein structures embedded in the membrane are electrically active. These include ion channels that permit electrically charged ions to flow across the membrane, and ion pumps that actively transport ions from one side of the membrane to the other. Most ion channels are permeable only to specific types of ions. Some ion channels are voltage gated, meaning that they can be switched between open and closed states by altering the voltage difference across the membrane. Others are chemically gated, meaning that they can be switched between open and closed states by interactions with chemicals that diffuse through the extracellular fluid. The interactions between ion channels and ion pumps produce a voltage difference across the membrane, typically a bit less than 1/10 of a volt at baseline. This voltage has two functions: first, it provides a power source for an assortment of voltage-dependent protein machinery that is embedded in the membrane; second, it provides a basis for electrical signal transmission between different parts of the membrane.

Neurons communicate by chemical and electrical synapses in a process known as synaptic transmission. The fundamental process that triggers synaptic transmission is the action potential, a propagating electrical signal that is generated by exploiting the electrically excitable membrane of the neuron. This is also known as a wave of depolarization.

## Anatomy and histology

Diagram of a typical myelinated vertebrate motoneuron.

Neurons are highly specialized for the processing and transmission of cellular signals. Given the diversity of functions performed by neurons in different parts of the nervous system, there is, as expected, a wide variety in the shape, size, and electrochemical properties of neurons. For instance, the soma of a neuron can vary from 4 to 100 micrometers in diameter.[1]

• The soma is the central part of the neuron. It contains the nucleus of the cell, and therefore is where most protein synthesis occurs. The nucleus ranges from 3 to 18 micrometers in diameter.[2]
• The dendrites of a neuron are cellular extensions with many branches, and metaphorically this overall shape and structure is referred to as a dendritic tree. This is where the majority of input to the neuron occurs.
• The axon is a finer, cable-like projection which can extend tens, hundreds, or even tens of thousands of times the diameter of the soma in length. The axon carries nerve signals away from the soma (and also carries some types of information back to it). Many neurons have only one axon, but this axon may—and usually will—undergo extensive branching, enabling communication with many target cells. The part of the axon where it emerges from the soma is called the axon hillock. Besides being an anatomical structure, the axon hillock is also the part of the neuron that has the greatest density of voltage-dependent sodium channels. This makes it the most easily-excited part of the neuron and the spike initiation zone for the axon: in neurological terms it has the most negative action potential threshold. While the axon and axon hillock are generally involved in information outflow, this region can also receive input from other neurons.

Although the canonical view of the neuron attributes dedicated functions to its various anatomical components, dendrites and axons often act in ways contrary to their so-called main function.

Axons and dendrites in the central nervous system are typically only about one micrometer thick, while some in the peripheral nervous system are much thicker. The soma is usually about 10–25 micrometers in diameter and often is not much larger than the cell nucleus it contains. The longest axon of a human motoneuron can be over a meter long, reaching from the base of the spine to the toes. Sensory neurons have axons that run from the toes to the dorsal columns, over 1.5 meters in adults. Giraffes have single axons several meters in length running along the entire length of their necks. Much of what is known about axonal function comes from studying the squid giant axon, an ideal experimental preparation because of its relatively immense size (0.5–1 millimeters thick, several centimeters long).

Fully differentiated neurons are permanently amitotic;[3] however, recent research shows that additional neurons throughout the brain can originate from neural stem cells found throughout the brain but in particularly high concentrations in the subventricular zone and subgranular zone through the process of neurogenesis.[4]

### Histology and internal structure

Golgi-stained neurons in human hippocampal tissue.

Nerve cell bodies stained with basophilic dyes show numerous microscopic clumps of Nissl substance (named after German psychiatrist and neuropathologist Franz Nissl, 1860–1919), which consists of rough endoplasmic reticulum and associated ribosomal RNA. The prominence of the Nissl substance can be explained by the fact that nerve cells are metabolically very active, and hence are involved in large amounts of protein synthesis.

The cell body of a neuron is supported by a complex meshwork of structural proteins called neurofilaments, which are assembled into larger neurofibrils. Some neurons also contain pigment granules, such as neuromelanin (a brownish-black pigment, byproduct of synthesis of catecholamines) and lipofuscin (yellowish-brown pigment that accumulates with age).

There are different internal structural characteristics between axons and dendrites. Typical axons almost never contain ribosomes, except some in the initial segment. Dendrites contain granular endoplasmic reticulum or ribosomes, with diminishing amounts with distance from the cell body.

## Classes

Image of pyramidal neurons in mouse cerebral cortex expressing green fluorescent protein. The red staining indicates GABAergic interneurons. Source PLoS Biology [1]
SMI32-stained pyramidal neurons in cerebral cortex.

Neurons exist in a number of different shapes and sizes and can be classified by their morphology and function. The anatomist Camillo Golgi grouped neurons into two types; type I with long axons used to move signals over long distances and type II with short axons, which can often be confused with dendrites. Type I cells can be further divided by where the cell body or soma is located. The basic morphology of type I neurons, represented by spinal motor neurons, consists of a cell body called the soma and a long thin axon which is covered by the myelin sheath. Around the cell body is a branching dendritic tree that receives signals from other neurons. The end of the axon has branching terminals (axon terminal) that release neurotransmitters into a gap called the synaptic cleft between the terminals and the dendrites of the next neuron.

### Structural classification

#### Polarity

Most neurons can be anatomically characterized as:

#### Other

Furthermore, some unique neuronal types can be identified according to their location in the nervous system and distinct shape. Some examples are:

### Functional classification

#### Direction

Afferent and efferent can also refer generally to neurons which, respectively, bring information to or send information from the brain region.

#### Action on other neurons

A neuron affects other neurons by releasing a neurotransmitter that binds to chemical receptors. The effect upon the target neuron is determined not by the source neuron or by the neurotransmitter, but by the type of receptor that is activated. A neurotransmitter can be thought of as a key, and a receptor as a lock: the same type of key can here be used to open many different types of locks. Receptors can be classified broadly as excitatory (causing an increase in firing rate), inhibitory (causing a decrease in firing rate), or modulatory (causing long-lasting effects not directly related to firing rate).

In fact, however, the two most common neurotransmitters in the brain, glutamate and GABA, have actions that are largely consistent. Glutamate acts on several different types of receptors, but most of them have effects that are excitatory. Similarly GABA acts on several different types of receptors, but all of them have effects (in adult animals, at least) that are inhibitory. Because of this consistency, it is common for neuroscientists to simplify the terminology by referring to cells that release glutamate as "excitatory neurons," and cells that release GABA as "inhibitory neurons." Since well over 90% of the neurons in the brain release either glutamate or GABA, these labels encompass the great majority of neurons. There are also other types of neurons that have consistent effects on their targets, for example "excitatory" motor neurons in the spinal cord that release acetylcholine, and "inhibitory" spinal neurons that release glycine.

The distinction between excitatory and inhibitory neurotransmitters is not absolute, however. Rather, it depends on the class of chemical receptors present on the target neuron. In principle, a single neuron, releasing a single neurotransmitter, can have excitatory effects on some targets, inhibitory effects on others, and modulatory effects on others still. For example, photoreceptors in the retina constantly release the neurotransmitter glutamate in the absence of light. So-called OFF bipolar cells are, like most neurons, excited by the released glutamate. However, neighboring target neurons called ON bipolar cells are instead inhibited by glutamate, because they lack the typical ionotropic glutamate receptors and instead express a class of inhibitory metabotropic glutamate receptors.[5] When light is present, the photoreceptors cease releasing glutamate, which relieves the ON bipolar cells from inhibition, activating them; this simultaneously removes the excitation from the OFF bipolar cells, silencing them.

#### Discharge patterns

Neurons can be classified according to their electrophysiological characteristics:

• Tonic or regular spiking. Some neurons are typically constantly (or tonically) active. Example: interneurons in neurostriatum.
• Phasic or bursting. Neurons that fire in bursts are called phasic.
• Fast spiking. Some neurons are notable for their fast firing rates, for example some types of cortical inhibitory interneurons, cells in globus pallidus, retinal ganglion cells.[6][7]
• Thin-spike. Action potentials of some neurons are more narrow compared to the others. For example, interneurons in the prefrontal cortex are thin-spike neurons.

#### Classification by neurotransmitter production

Template:Expand-sectionNeurons differ in the type of neurotransmitter they manufacture. Some examples are

Acetylcholine is released from presynaptic neurons into the synaptic cleft. It acts as a ligand for Nicotinic Acetylcholine receptors, which are ligand gated Na+ ion channels. Ligand binding opens the channel causing depolarization and increases the probability of an action potential firing, occcuring once the threshold is reached.

GABA is one of two neuroinhibitors in the CNS, the other being Glycine. GABA has a homologous function to ACh, gating anion channels that allow Cl- ions to enter the post synaptic neuron. Cl- causes hyperpolarization within the neuron, decreasing the probability of an action potential firing as the voltage becomes more negative (recall that for an action potential to fire, a positive voltage threshold must be reached).

Glutamate is one of two primary neuroexcitors, the other being Aspartate (not Aspartame). Glutamate receptors are one of four categories, three of which are ion channels and one of which is a G-protein coupled receptor (often referred to as GPCR). 1 - AMPA and Kainate receptors (really two different receptors) both function as Na+ cation channels mediating fast excitatory synaptic transmission 2 - NMDA receptors are another cation channel, but for Ca2+. The function of NMDA receptors is dependant on Glycine binding to a mediator binding spot on the channel pore. NMDA receptors will not function without both ligands present - antagonist drugs for Glycine will cause NMDA receptors to malfunction. 3 - Metabotropic receptor, a GPCR that modulates synaptic transmission Glutamate can cause excitotoxicity when blood flow to the brain is interrupted, resulting in brain damage. When blood flow is suppressed, glutamate is released from presynaptic neurons causing NMDA and AMPA receptor activation moreso than would normally be the case outside of stress conditions, leading to elevated Ca2+ and Na+ entering the post synaptic neuron and cell damage.

Dopamine is a neurotransmitter that acts on a GPCR. Dopamine is connected to mood and behaviour, and modulates post synaptic neurotransmission. Loss of dopamine neurons has been linked to Parkinson's disease, schizophrenia, and ADD.

Serotonin, full name 5-Hydroxytryptamine, can act as excitatory or inhibitory. Of the four 5HT receptor classes, 3 are GPCR and 1 is ligand gated cation channel. Serotonin is synthesized from tryptophan by tryptophan hydroxylase, and then further by aromatic acid decarboxylase. A lack of 5HT at postsynaptic neurons has been linked to depression. Drugs that are antagonistic for reabsorption by presynaptic neurons are used for treatment, such as Prozac and Zoloft.

## Connectivity

Neurons communicate with one another via synapses, where the axon terminal or en passant boutons (terminals located along the length of the axon) of one cell impinges upon another neuron's dendrite, soma or, less commonly, axon. Neurons such as Purkinje cells in the cerebellum can have over 1000 dendritic branches, making connections with tens of thousands of other cells; other neurons, such as the magnocellular neurons of the supraoptic nucleus, have only one or two dendrites, each of which receives thousands of synapses. Synapses can be excitatory or inhibitory and will either increase or decrease activity in the target neuron. Some neurons also communicate via electrical synapses, which are direct, electrically-conductive junctions between cells.

In a chemical synapse, the process of synaptic transmission is as follows: when an action potential reaches the axon terminal, it opens voltage-gated calcium channels, allowing calcium ions to enter the terminal. Calcium causes synaptic vesicles filled with neurotransmitter molecules to fuse with the membrane, releasing their contents into the synaptic cleft. The neurotransmitters diffuse across the synaptic cleft and activate receptors on the postsynaptic neuron.

The human brain has a huge number of synapses. Each of the 1011 (one hundred billion) neurons has on average 7,000 synaptic connections to other neurons. It has been estimated that the brain of a three-year-old child has about 1015 synapses (1 quadrillion). This number declines with age, stabilizing by adulthood. Estimates vary for an adult, ranging from 1014 to 5 x 1014 synapses (100 to 500 trillion).[8]

## Mechanisms for propagating action potentials

A signal propagating down an axon to the cell body and dendrites of the next cell.

In 1937, John Zachary Young suggested that the squid giant axon could be used to study neuronal electrical properties.[9] Being larger than but similar in nature to human neurons, squid cells were easier to study. By inserting electrodes into the giant squid axons, accurate measurements were made of the membrane potential.

The cell membrane of the axon and soma contain voltage-gated ion channels which allow the neuron to generate and propagate an electrical signal (an action potential). These signals are generated and propagated by charge-carrying ions including sodium (Na+), potassium (K+), chloride (Cl-), and calcium (Ca2+).

There are several stimuli that can activate a neuron leading to electrical activity, including pressure, stretch, chemical transmitters, and changes of the electric potential across the cell membrane.[10] Stimuli cause specific ion-channels within the cell membrane to open, leading to a flow of ions through the cell membrane, changing the membrane potential.

Thin neurons and axons require less metabolic expense to produce and carry action potentials, but thicker axons convey impulses more rapidly. To minimize metabolic expense while maintaining rapid conduction, many neurons have insulating sheaths of myelin around their axons. The sheaths are formed by glial cells: oligodendrocytes in the central nervous system and Schwann cells in the peripheral nervous system. The sheath enables action potentials to travel faster than in unmyelinated axons of the same diameter, whilst using less energy. The myelin sheath in peripheral nerves normally runs along the axon in sections about 1 mm long, punctuated by unsheathed nodes of Ranvier which contain a high density of voltage-gated ion channels. Multiple sclerosis is a neurological disorder that results from demyelination of axons in the central nervous system.

Some neurons do not generate action potentials, but instead generate a graded electrical signal, which in turn causes graded neurotransmitter release. Such nonspiking neurons tend to be sensory neurons or interneurons, because they cannot carry signals long distances.

## Neural coding

Neural coding is concerned with how sensory and other information is represented in the brain by neurons. The main goal of studying neural coding is to characterize the relationship between the stimulus and the individual or ensemble neuronal responses, and the relationships amongst the electrical activities of the neurons within the ensemble.[11] It is thought that neurons can encode both digital and analog information.[12]

## All-or-none principle

The conduction of nerve impulses is an example of an all-or-none response. In other words, if a neuron responds at all, then it must respond completely. The greater the intensity of stimulation does not produce a stronger signal but can produce more impulses per second. There are different types of receptor response to stimulus, slowly adapting or tonic receptors respond to steady stimulus and produce a steady rate of firing. These tonic receptors most often respond to increased intensity of stimulus by increasing their firing frequency, usually as a power function of stimulus plotted against impulses per second. This can be likened to an intrinsic property of light where to get greater intensity of a specific frequency (color) there have to be more photons, as the photons can't become "stronger" for a specific frequency.

There are a number of other receptor types that are called quickly-adapting or phasic receptors, where firing decreases or stops with steady stimulus; examples include: skin when touched by an object causes the neurons to fire, but if the object maintains even pressure against the skin, the neurons stop firing. The neurons of the skin and muscles that are responsive to pressure and vibration have filtering accessory structures that aid their function. The pacinian corpuscle is one such structure; it has concentric layers like an onion which form around the axon terminal. When pressure is applied and the corpuscle is deformed, mechanical stimulus is transferred to the axon, which fires. If the pressure is steady, there is no more stimulus; thus, typically these neurons respond with a transient depolarization during the initial deformation and again when the pressure is removed, which causes the corpuscle to change shape again. Other types of adaptation are important in extending the function of a number of other neurons.[13]

## History

The term neuron was coined by the German anatomist Heinrich Wilhelm Waldeyer. The neuron's place as the primary functional unit of the nervous system was first recognized in the early 20th century through the work of the Spanish anatomist Santiago Ramón y Cajal.[14] Cajal proposed that neurons were discrete cells that communicated with each other via specialized junctions, or spaces, between cells.[14] This became known as the neuron doctrine, one of the central tenets of modern neuroscience.[14] To observe the structure of individual neurons, Cajal used a silver staining method developed by his rival, Camillo Golgi.[14] The Golgi stain is an extremely useful method for neuroanatomical investigations because, for reasons unknown, it stains a very small percentage of cells in a tissue, so one is able to see the complete micro structure of individual neurons without much overlap from other cells in the densely packed brain.[15]

### The neuron doctrine

The neuron doctrine is the now fundamental idea that neurons are the basic structural and functional units of the nervous system. The theory was put forward by Santiago Ramón y Cajal in the late 19th century. It held that neurons are discrete cells (not connected in a meshwork), acting as metabolically distinct units.

Later discoveries yielded a few refinements to the simplest form of the doctrine. For example, glial cells, which are not considered neurons, play an essential role in information processing.[16] Also, electrical synapses are more common than previously thought,[17] meaning that there are direct, cytoplasmic connections between neurons. In fact, there are examples of neurons forming even tighter coupling: the squid giant axon arises from the fusion of multiple axons.[18]

Cajal also postulated the Law of Dynamic Polarization, which states that a neuron receives signals at its dendrites and cell body and transmits them, as action potentials, along the axon in one direction: away from the cell body.[19] The Law of Dynamic Polarization has important exceptions; dendrites can serve as synaptic output sites of neurons[20] and axons can receive synaptic inputs.Template:Citation needed

## Neurons in the brain

The number of neurons in the brain varies dramatically from species to species.[21] One estimate puts the human brain at about 100 billion ($10^{11}$) neurons and 100 trillion ($10^{14}$) synapses.[21] Another estimate is 86 billion neurons of which 16.3 billion are in the cerebral cortex and 69 billion in the cerebellum.[22] By contrast, the nematode worm Caenorhabditis elegans has just 302 neurons making it an ideal experimental subject as scientists have been able to map all of the organism's neurons. The fruit fly Drosophila melanogaster, a common subject in biology experiments, has around 100,000 neurons and exhibits many complex behaviors. Many properties of neurons, from the type of neurotransmitters used to ion channel composition, are maintained across species, allowing scientists to study processes occurring in more complex organisms in much simpler experimental systems.

## Neurological disorders

Charcot-Marie-Tooth disease (CMT), also known as Hereditary Motor and Sensory Neuropathy (HMSN), Hereditary Sensorimotor Neuropathy (HMSN), or Peroneal Muscular Atrophy, is a heterogeneous inherited disorder of nerves (neuropathy) that is characterized by loss of muscle tissue and touch sensation, predominantly in the feet and legs but also in the hands and arms in the advanced stages of disease. Presently incurable, this disease is one of the most common inherited neurological disorders, with 37 in 100,000 affected.

Alzheimer's disease (AD), also known simply as Alzheimer's, is a neurodegenerative disease characterized by progressive cognitive deterioration together with declining activities of daily living and neuropsychiatric symptoms or behavioral changes. The most striking early symptom is loss of short-term memory (amnesia), which usually manifests as minor forgetfulness that becomes steadily more pronounced with illness progression, with relative preservation of older memories. As the disorder progresses, cognitive (intellectual) impairment extends to the domains of language (aphasia), skilled movements (apraxia), recognition (agnosia), and functions such as decision-making and planning get impaired.

Parkinson's disease (also known as Parkinson disease or PD) is a degenerative disorder of the central nervous system that often impairs the sufferer's motor skills and speech. Parkinson's disease belongs to a group of conditions called movement disorders. It is characterized by muscle rigidity, tremor, a slowing of physical movement (bradykinesia), and in extreme cases, a loss of physical movement (akinesia). The primary symptoms are the results of decreased stimulation of the motor cortex by the basal ganglia, normally caused by the insufficient formation and action of dopamine, which is produced in the dopaminergic neurons of the brain. Secondary symptoms may include high level cognitive dysfunction and subtle language problems. PD is both chronic and progressive.

Myasthenia Gravis is a neuromuscular disease leading to fluctuating muscle weakness and fatigability. Weakness is typically caused by circulating antibodies that block acetylcholine receptors at the post-synaptic neuromuscular junction, inhibiting the stimulative effect of the neurotransmitter acetylcholine. Myasthenia is treated with immunosuppressants, cholinesterase inhibitors and, in selected cases, thymectomy.

### Demyelination

Demyelination is the act of demyelinating, or the loss of the myelin sheath insulating the nerves. When myelin degrades, conduction of signals along the nerve can be impaired or lost, and the nerve eventually withers. This leads to certain neurodegenerative disorders like multiple sclerosis, chronic inflammatory demyelinating polyneuropathy.

### Axonal degeneration

Although most injury responses include a calcium influx signaling to promote resealing of severed parts, axonal injuries initially lead to acute axonal degeneration (AAD), which is rapid separation of the proximal and distal ends within 30 minutes of injury. Degeneration follows with swelling of the axolemma, and eventually leads to bead like formation. Granular disintegration of the axonal cytoskeleton and inner organelles occurs after axolemma degradation. Early changes include accumulation of mitochondria in the paranodal regions at the site of injury. Endoplasmic reticulum degrades and mitochondria swell up and eventually disintegrate. The disintegration is dependent on Ubiquitin and Calpain proteases (caused by influx of calcium ion), suggesting that axonal degeneration is an active process. Thus the axon undergoes complete fragmentation. The process takes about roughly 24 hrs in the PNS, and longer in the CNS. The signaling pathways leading to axolemma degeneration are currently unknown.

## Nerve regeneration

It has been demonstrated that neurogenesis can sometimes occur in the adult vertebrate brain,Template:Citation needed and it is often possible for peripheral axons to regrow if they are severed. The latter can take a long time: after a nerve injury to the human arm, for example, it may take months for feeling to return to the hands and fingers.Template:Citation needed

## References

1. Davies, Melissa (2002-04-09). "The Neuron: size comparison". Neuroscience: A journey through the brain. Retrieved 2009-06-20.
2. Chudler, Eric H.. "Brain Facts and Figures". Neuroscience for Kids. Retrieved 2009-06-20.
3. Herrup K, Yang Y (May 2007). "Cell cycle regulation in the postmitotic neuron: oxymoron or new biology?". Nat. Rev. Neurosci. 8 (5): 368–78. . .
4. Alvarez-Buylla A, Garcia-Verdugo JM (February 1, 2002). "Neurogenesis in adult subventricular zone". The Journal of Neuroscience : the Official Journal of the Society for Neuroscience 22 (3): 629–34. . Retrieved 2009-06-20.
5. Gerber U (2003). "Metabotropic glutamate receptors in vertebrate retina". Doc Ophthalmol 106 (1): 83–87. . .
6. Ionic conductances underlying excitability in tonically firing retinal ganglion cells of adult rat
7. Drachman D (2005). "Do we have brain to spare?". Neurology 64 (12): 2004–5. . .
8. Chudler, Eric H.. "Milestones in Neuroscience Research". Neuroscience for Kids. Retrieved 2009-06-20.
9. Patlak, Joe; Gibbons, Ray (2000-11-01). "Electrical Activity of Nerves". Aps in Nerve Cells. Retrieved 2009-06-20.
10. Brown EN, Kass RE, and Mitra PP. 2004. Multiple neural spike train data analysis: state-of-the-art and future challenges. Nature Neuroscience 7:456-61
11. Spike arrival times: A highly efficient coding scheme for neural networks, SJ Thorpe - Parallel processing in neural systems, 1990
12. Eckert, Roger; Randall, David (1983). Animal physiology: mechanisms and adaptations. San Francisco: W.H. Freeman. pp. 239. .
13. López-Muñoz, F.; Boya, J., Alamo, C. (16 October 2006). "Neuron theory, the cornerstone of neuroscience, on the centenary of the Nobel Prize award to Santiago Ramón y Cajal". Brain Research Bulletin 70 (4-6): 391–405. . . Retrieved 2007-04-02.
14. Grant, Gunnar; Boya, J; Alamo, C (9 January 2007 (online)). "How the 1906 Nobel Prize in Physiology or Medicine was shared between Golgi and Cajal". Brain Research Reviews 55 (4-6): 490. . . Retrieved 2007-04-02.
15. Witcher M, Kirov S, Harris K (2007). "Plasticity of perisynaptic astroglia during synaptogenesis in the mature rat hippocampus". Glia 55 (1): 13–23. . .
16. Connors B, Long M (2004). "Electrical synapses in the mammalian brain". Annu Rev Neurosci 27: 393–418. . .
17. R. W. Guillery, Observations of synaptic structures: origins of the neuron doctrine and its current status, Phil. Trans. R. Soc. B (2005) 360, 1281–1307 (p 1300).
18. Sabbatini R.M.E. April-July 2003. Neurons and Synapses: The History of Its Discovery. Brain & Mind Magazine, 17. Retrieved on March 19, 2007.
19. Djurisic M, Antic S, Chen W, Zecevic D (2004). "Voltage imaging from dendrites of mitral cells: EPSP attenuation and spike trigger zones". J Neurosci 24 (30): 6703–14. . .
20. Williams RW, Herrup K (1988). "The control of neuron number". Annual Review of Neuroscience 11: 423–53. . .
21. Azevedo FA, Carvalho LR, Grinberg LT, et al. (April 2009). "Equal numbers of neuronal and nonneuronal cells make the human brain an isometrically scaled-up primate brain". The Journal of Comparative Neurology 513 (5): 532–41. . .

## Sources

• Kandel E.R., Schwartz, J.H., Jessell, T.M. 2000. Principles of Neural Science, 4th ed., McGraw-Hill, New York.
• Bullock, T.H., Bennett, M.V.L., Johnston, D., Josephson, R., Marder, E., Fields R.D. 2005. The Neuron Doctrine, Redux, Science, V.310, p. 791-793.
• Ramón y Cajal, S. 1933 Histology, 10th ed., Wood, Baltimore.
• Roberts A., Bush B.M.H. 1981. Neurones Without Impulses. Cambridge University Press, Cambridge.
• Peters, A., Palay, S.L., Webster, H, D., 1991 The Fine Structure of the Nervous System, 3rd ed., Oxford, New York


text:
# How can we match the values having backslashes, like ‘ab’, from MySQL column?

With the help of an RLIKE operator, we can perform such kind of matching. The only concept is about to use a number of backslashes in MySQL query. The example below will make it clearer −

We have the following table having values such as ‘a\b’ and ‘a\b’.

mysql> select * from backslashes;
+------+-------+
| Id   | Value |
+------+-------+
|    1 | 200   |
|    2 | 300   |
|    4 | a\b  |
|    3 | a\b   |
+------+-------+
4 rows in set (0.10 sec)

Now suppose if we want to match the value ‘a\b’ then we need to write eight backslashes. It is because the second backslash is not escaped by the first so to compare two liters we need to double the backslash but as we are querying a table for such string from the MySQL string then this doubling happens twice-once in the client and once in the database. Hence we need to use four times backslashes as done in the queries below −

mysql> Select * from backslashes where value RLIKE 'a\\\\b';
+------+-------+
| Id   | Value |
+------+-------+
|    4 | a\b  |
+------+-------+
1 row in set (0.00 sec)

mysql> Select * from backslashes where value RLIKE 'a\\b';
+------+-------+
| Id   | Value |
+------+-------+
|    3 | a\b   |
+------+-------+
1 row in set (0.01 sec)


text:
# Measurement of the J/psi pair production cross-section in pp collisions at root s = 13 TeV (vol 6, 47, 2017)

Aaij, R, Adeva, B, Adinolfi, M, Ajaltouni, Z, Akar, S, Albrecht, J, Alessio, F, Alexander, M, Ali, S, Alkhazov, G
et al (show 756 more authors) (2017) Measurement of the J/psi pair production cross-section in pp collisions at root s = 13 TeV (vol 6, 47, 2017). JOURNAL OF HIGH ENERGY PHYSICS (10).

Access the full-text of this item by clicking on the Open Access link.
Item Type: Article Symplectic Admin 12 Jan 2018 11:10 05 Dec 2021 08:17 10.1007/JHEP10(2017)068 https://arxiv.org/pdf/1612.07451.pdf Author https://livrepository.liverpool.ac.uk/id/eprint/3015921


text:
evaluate_theta_cov {drord} R Documentation

## get a covariance matrix for the estimated CDF

### Description

get a covariance matrix for the estimated CDF

### Usage

evaluate_theta_cov(cdf_est, treat_prob_est, treat, out, out_levels)

### Arguments

 cdf_est The estimates of the treatment-specific CDFs treat_prob_est List of estimated probability of treatments, output from call to estimate_treat_prob. treat A numeric vector containing treatment status. Should only assume a value 0 or 1. out A numeric vector containing the outcomes. Missing outcomes are allowed. out_levels A numeric vector containing all ordered levels of the outcome.

### Value

Estimated covariance matrix for CDF estimates

[Package drord version 1.0.1 Index]


text:
# Electron spin resonance in Eu based Fe pnictides

Research paper by H. -A. Krug von Nidda, S. Kraus, S. Schaile, E. Dengler, N. Pascher, M. Hemmida, M. J. Eom, J. S. Kim, H. S. Jeevan, P. Gegenwart, J. Deisenhofer, A. Loidl

Indexed on: 15 May '12Published on: 15 May '12Published in: Physics - Superconductivity

#### Abstract

The phase diagrams of EuFe$_{2-x}$Co$_x$As$_2$ $(0 \leq x \leq 0.4)$ and EuFe$_2$As$_{2-y}$P$_y$ $(0 \leq y \leq 0.43)$ are investigated by Eu$^{2+}$ electron spin resonance (ESR) in single crystals. From the temperature dependence of the linewidth $\Delta H(T)$ of the exchange narrowed ESR line the spin-density wave (SDW) $(T < T_{\rm SDW})$ and the normal metallic regime $(T > T_{\rm SDW})$ are clearly distinguished. At $T > T_{\rm SDW}$ the isotropic linear increase of the linewidth is driven by the Korringa relaxation which measures the conduction-electron density of states at the Fermi level. For $T < T_{\rm SDW}$ the anisotropy probes the local ligand field, while the coupling to the conduction electrons disappears. With increasing substitution $x$ or $y$ the transition temperature $T_{\rm SDW}$ decreases linearly accompanied by a linear decrease of the Korringa-relaxation rate from 8 Oe/K at $x=y=0$ down to 3 Oe/K at the onset of superconductivity at $x \approx 0.2$ or at $y \approx 0.3$, above which it remains nearly constant. Comparative ESR measurements on single crystals of the Eu diluted SDW compound Eu$_{0.2}$Sr$_{0.8}$Fe$_2$As$_2$ and superconducting (SC) Eu$_{0.22}$Sr$_{0.78}$Fe$_{1.72}$Co$_{0.28}$As$_2$ corroborate the leading influence of the ligand field on the Eu$^{2+}$ spin relaxation in the SDW regime as well as the Korringa relaxation in the normal metallic regime. Like in Eu$_{0.5}$K$_{0.5}$Fe$_2$As$_2$ a coherence peak is not detected in the latter compound at $T_{\rm c}=21$ K, which is in agreement with the expected complex anisotropic SC gap structure.


text:
# Inter 2nd Year Maths 2B Circle Solutions Ex 1(e)

Practicing the Intermediate 2nd Year Maths 2B Textbook Solutions Inter 2nd Year Maths 2B Circle Solutions Exercise 1(e) will help students to clear their doubts quickly.

## Intermediate 2nd Year Maths 2B Circle Solutions Exercise 1(e)

I.

Question 1.
Discuss the relative position of the following pair of circles.
i) x² + y² – 4x – 6y – 12 = 0
x² + y² + 6x + 18y + 26 = 0.
Solution:
Centres of the circles are A (2, 3), B(-3, -9)
radii are r1 = $$\sqrt{4+9+12}$$ = 5
r2 = $$\sqrt{9+81-26}$$ = 8
AB = $$\sqrt{(2+3)^{2}+(3+9)^{2}}$$
= $$\sqrt{25+144}$$ = 13 = r1 + r2
∴ The circles touch externally.

ii) x² + y² + 6x + 6y + 14 = 0,
x² + y² – 2x – 4y – 4 = 0.
Solution:
Centres are A (-3, -3), B (1, 2)
r1 = $$\sqrt{9+9-14}$$ = 2,
r2 = $$\sqrt{1+4+4}$$ = 3
AB = $$\sqrt{(-3-1)^{2}+(-3-2)^{2}}$$
= $$\sqrt{16+25}=\sqrt{41}$$ > r1 + r2
∴ Each circle lies exterior to the other circle.

iii) (x – 2)² + (y + 1)² = 9, (x + 1)² + (y – 3)²= 4
Solution:
Centres are A( 2, -1), B(-1, 3)
r1 = $$\sqrt{4+1+4}$$ = 3, r2 = $$\sqrt{1+9-6}$$ = 2
AB = $$\sqrt{(2+1)^{2}+(-1-3)^{2}}$$
= $$\sqrt{9+16}$$
= 5 = r1 + r2
∴ The circles touch each other externally.

iv) x² + y² – 2x + 4y – 4 = 0, x² + y² + 4x – 6y – 3 = 0
Solution:
Centres are A (1, -2), B (-2, 3)
r1 = $$\sqrt{1+4+4}$$ = 3, r2 = $$\sqrt{4+9+3}$$ = 4
AB = $$\sqrt{(1+2)^{2}+(-2-3)^{2}}=\sqrt{9+16}$$
= $$\sqrt{9+25}=\sqrt{34}$$ < r1 + r2
r1 – r2 < AB < r2 + r1
∴ The circles intersect each other.

Question 2.
Find the number of possible common tangents that exist for the following pairs of circles.
i) x² + y² + 6x + 6y + 14 = 0,
x² + y² – 2x – 4y – 4 = 0
Solution:
c1 ( -3, -3) c2 = (1, 2)

The circles are externally No. of common tangents = 4

ii) x² + y² – 4x – 2y + 1 = 0;
x² + y² – 6x – 4y + 4 = 0.
Solution:
C1 (2, 1), C2 = (3, 2)
r1 = $$\sqrt{4+1-1}$$ = 2
r2 = $$\sqrt{9+4-4}$$ =3

C1 C2 = $$\sqrt{(2-3)^{2}+(1-2)^{2}}=\sqrt{2}$$
C1 C2 < r1 + r2 intersect each other 2 tangents (direct)

iii) x² + y² – 4x + 2y – 4 = 0;
x² + y² + 2x – 6y + 6 = 0.
Solution:
C1 (2, -1) C2 = (-1, 3)

C1 C2 = r1 + r2 touch each other externally; No. of common tangents = 3.

iv) x² + y² = 4; x² + y² – 6x – 8y + 16 = 0
Solution:

Two circles touch each other.
2 – direct tangents
1 – transverse tangent (at common point)

v) x² + y² + 4x – 6y – 3 = 0
x² + y² + 4x – 2y + 4 = 0.
Solution:
C1 (-2, 3) C2 = (-2, 1)
r1 = $$\sqrt{4+9+3}$$ = 4 r2 = $$\sqrt{4+1-4}$$ = 1
C1 C2 = $$\sqrt{(-2+2)^{2}+(3-1)^{2}}$$
C1 C2 = 2 < 3 = r1 – r2
One circle is inside the other.
∴ No common tangent.

Question 3.
Find the internal centre of similitude for the circles x² + y² + 6x – 2y + 1 =0 and x² + y² – 2x – 6y + 9 = 0.
Solution:

The internal centre of similitude S divides
C1 C2 internally in the ratio r1 : r2 = 3 : 1
Co-ordinates of S¹ are

Question 4.
Find the external centre of similitude for the circles x² + y² – 2x – 6y + 9 = 0 and x² + y² = 4.
Solution:
Centre of the circle C1 (1, 3) and C2 (0,0)
r1 = $$\sqrt{1+9-9}$$, r2 = 2
External centre of similitude S¹ divides C1 C2 externally in the ratio
r1 : r2 = 1 : 2

II.

Question 1.
i) Show that the circles x² + y² – 6x – 2y + 1 = 0 ; x² + y² + 2x – 8y + 13 = 0 touch each other. Find the point of contact and the equation of common tangent at their point of contact.
Solution:
Equations of the circles are
S1 ≡ x² + y² – 6x – 2y + 1 =0
S2 ≡ x² + y² + 2x – 8y + 13 = 0

∴ The circles touch each other externally.
The point of contact P divides AB – internally in the ratio r1 : r2 = 3 : 2
Co-ordinates of P are
($$\frac{3(-1)+2.3}{5}$$, $$\frac{3.4+2.1}{5}$$ i.e., P($$\frac{3}{5}$$, $$\frac{14}{5}$$)
Equation of the common tangent is S1 – S2 = 0
-8x + 6y – 12 = 0 (or) 4x – 3y + 6 = 0

ii) Show that x² + y² – 6x – 9y + 13 = 0, x² + y² – 2x – 16y = 0 touch each other. Find the point of contact and the equation of common tangent at their point of contact.
Solution:
Equations of the circles are
S1 ≡ x² + y² – 6x – 9y + 13 = 0
S2 ≡ x² + y² – 2x – 16y = 0
centres are A (3, $$\frac{9}{2}$$), B(1, 8)

∴ The circles touch each other internally. The point of contact ‘P’ divides AB externally in the ratio r1 : r2 = $$\frac{\sqrt{65}}{2}$$ : √65
= 1 : 2 Co-ordinates of P are

P = (5, 1)
∴ Equation of the common tangent is
S1 – S2 = 0
– 4x + 7y +13 = 0
4x – 7y – 13 = 0

Question 2.
Find the equation of the circle which touches the circle x² + y² – 2x – 4y – 20 = 0 externally at (5, 5) with radius 5.
Solution:
x² + y² – 2x – 4y – 20 = 0 ,
C = (1, 2)

Equation of circle be
(x – 9)² + (y – 8)²
x² + y² – 18x – 16y + 120 = 0
If (h, k) is the centre of the required circle (5, 5) is the mid-point of (1, 2) and (h, k).

Question 3.
Find the direct common tangents of the circles.
x² + y² + 22x – 4y – 100 = 0 and x² + y² – 22x + 4y + 100 = 0.
Solution:
C1 = (-11, 2) C2 = (11, -2)
r1 = $$\sqrt{121+4+100}$$ = 15
r2 = $$\sqrt{121+4-100}$$ = 5
Let y = mx + c be tangent
mx – y + c = 0
⊥ from (-11, 2) to tangent = 15
⊥ from (11 ,-2) to tangent = 5

c = -22 m – 4
∴ y = mx – 22m – 4
This line is a tangent to the second circle
∴ $$\frac{|11m+2-22m-4|}{\sqrt{m^{2}+1}}$$ = 5
Squaring and cross multiplying
25(1 + m²) = (11m + 2 – 22m – 4)²
96m² + 44m – 21 = 0
⇒ 96m² + 72m – 28m – 21 = 0

⇒ 24y = 7x – 250
⇒ 7x – 24y – 250 = 0

Question 4.
Find the transverse common tangents of the circles x² + y² – 4x – 10y + 28 = 0 and x² + y² + 4x – 6y + 4 = 0.
Solution:
C1 = (2, 5), C2 = (-2, 3)

= [$$\frac{4}{4}$$, $$\frac{9}{2}$$] = [1, $$\frac{9}{2}$$]
Equation of the pair transverse of the common tangents is

Question 5.
Find the pair of tangents from (4, 10) to the circle x² + y² = 25.
Solution:
SS11 = S²1
(x² + y² – 25) (16 + 100 – 25)
= (4x + 10 y -25)²
91x² + 91y² – 2275
= [16x² + 100y² + 625 + 80xy – 200x – 500y]
75x² – 9y² – 80xy + 500y + 200x – 2900 = 0

Question 6.
Find the pair of tangents drawn from (0,0) to x2 + y2 + 10x + 10y + 40 = 0.
Solution:
S.S11 = S²1
(x² + y² + 10x + 10y + 40) (40) = [5x + 5y + 40]²
8(x² + y² + 10x + 10y + 40) = (x + y + 8)²5
8x² + 8y² + 80x + 80y + 320
= 5x² + 5y² + 10xy + 80x + 80y + 320
3x² + 3y² – 10xy = 0

III.

Question 1.
Find the equation of the circle which touches x² + y² – 4x + 6y – 12 = 0 at (-1, 1) internally with a radius of 2.
Solution:
C1 = (2, -3)
r1 = $$\sqrt{4+9+12}$$ = 5

Let C2 = (h, k)
point of contact – (x, y) = (-1, 1)
since the two circles touch internally

Equation of a circle with centre ($$\frac{1}{5}$$, $$\frac{-3}{5}$$) and radius 2 is given by
(x – $$\frac{1}{5}$$)² + (y + $$\frac{1}{5}$$)² = 4
5x² + 5y² – 2x + 6y – 18 = 0

Question 2.
Find all common tangents of the following pairs of circles.
(i) x² + y² = 9 and x² + y² – 16x + 2y + 49 = 0
Solution:
The circles are x² + y² = 9
x² + y² – 16x + 2y + 49 = 0
Centre are A (0, 0), B(8, -1)

The circles lie outside each other.
A (0, 0), B (8, -1)
External center of similitude S divides AB externally in this ratio 3 : 4
Co-ordinates of are (-24, + 3)
Suppose m is the slope of the direct common tangents
y – 3 = m(x + 24)
= mx + 24m
mx – y 4- (24m + 3) = 0 ………… (1)
This is a tangent to the circle x² + y² = 9
3 = $$\frac{|24m+3|}{\sqrt{m^{2}+1}}$$
9(m² +1 = 9(m² + 1) = 9(8m + 1)²
= 64m² + 16m + 1
63m² + 16m = 0
m(63m + 16) = 0
m = 0 or $$\frac{-16}{63}$$.

Case (i): m = 0
Substituting in (1), equation of the tangent is
-y + 3 = 0
y – 3 = 0

Case (ii) : m = $$\frac{-16}{63}$$.
Equation of the tangent is

Internal center of similitude S’ divides AB internally in the ratio 3 : 4
Co-ordinates of S’ are ($$\frac{24}{7}$$, $$\frac{-3}{7}$$)
Equation of the transverse common tangent is

7y + 3 = 7mx – 24m
7mx – 7y – (24m + 3) = 0 ………… (2)
This is a tangent to the circle x² + y² = 9
3 = $$\frac{|24m+3|}{\sqrt{49m^{2}+49}}=\frac{3}{\sqrt{7}} \frac{|28m+1|}{\sqrt{m^{2}+1}}$$
49 (m² + 1) = (8m + 1)²
49m² + 49 = 64m² +16m + 1
15m² + 16m – 48 = 0
(3m – 4) (5m + 12) = 0
m = $$\frac{4}{3}$$ or $$\frac{-12}{5}$$

Case (i): Substituting in (2), equation of the tangent is

Case (ii): m = $$\frac{-12}{5}$$
Equation of the transverse common tangent is ie

∴ Equation of direct common tangents are
y – 3 = 0; 16x + 63y + 195 = 0
Equation of transverse common tangents are
4x – 3y – 15 = 0 and 12x + 5y – 39 = 0

ii) x² + y² + 4x + 2y – 4 = 0 and x² + y² – 4x – 2y + 4 = 0
Solution:
r1 = $$\sqrt{4+1+4}$$ = 3, r2 = $$\sqrt{4+1+4}$$ = 1
External center of similitude S divides AB externally in the ratio 3 : 1
3 : 1 A (-2,-1), S’ B (2, 1) S
Co-ordinates of S are
($$\frac{3.2-(-2)1}{3-1}$$, $$\frac{3.1-1(-1)}{3-1}$$) = (4, 2)
Suppose m is the slope of the tangent Equation of the tangent can be taken as
y – 2 = m(x – 4)
= mx – 4m
mx – y + (2 – 4m) = 0 ………… (1)
This is a tangent to the circle
x² + y² + 4x + 2y – 4 = 0

Squaring and cross-multiplication is
(1 – 2m)² = (m² + 1)
4m² – 4m + 1 = m² + 1
3m² – 4m = 0
m(3m-4) = 0
m,= 0 or = $$\frac{4}{3}$$
m = 0
Substituting in (1), equation of the tangent is y + 2 = 0 or y -2 = 0
m = $$\frac{4}{3}$$
Substituting in (1), equation of the tangent is
$$\frac{4}{3}$$x – y + (2 – $$\frac{16}{3}$$) = 0
⇒ $$\frac{4}{3}$$x – y –$$\frac{10}{3}$$ = 0
4x – 3y – 10 = 0
Internal centre of similitude S’ divides AB internally in the ratio 3 : 1
Co-ordinates of S’ are
($$\frac{6-2}{3+1}$$, $$\frac{3-1}{3+1}$$x) = (1, $$\frac{1}{2}$$)
Equation of the tangent can be taken as
y – $$\frac{1}{2}$$ = m(x – 1)
= mx – m
mx – y + ($$\frac{1}{2}$$ – m) = 0 ………. (2)
This is a tangent to the circle
x² + y² + 4x + 2y – 4 = 0

Squaring and cross-multiply is
(1 – 2m)² = 4(m² + 1)
1 + 4m² – 4m = 4m² + 4
Here then value of m is a, so that the tangent is a vertical line, equation of the tangent is
x = $$\frac{1}{2}$$
x – 1 = 0
4m + 3 = 0
m = $$\frac{-3}{4}$$
Substituting in (2), equation of the tangent is
$$\frac{-3}{4}$$x – y + ($$\frac{1}{2}+\frac{3}{4}$$) = 0
-3x – 4y + 5 = 0
3x + 4y – 5 = 0
Equation of direct common tangents are
y – 2 = 0, 4x – 3y – 10 = 0
Equation of transvere common tangents are
x – 1 = 0, 3x + 4y – 5 = 0

Question 3.
Find the pair of tangents drawn from (3, 2) to the circle x² + y² – 6x + 4y – 2 = 0.
Solution:
S.S11 = S²1
(x² + y² – 6x + 4y – 2)
(9+ 4 – 6 × 3 + 4 × 2 – 2)
= (3x + 2y – 3(x + 3) + 2(y + 2) – 2)²
(x² + y² – 6x + 4y – 2) = (4y – 7)²
x² + y² – 6x + 4y – 2 = 16y² – 56y + 49
x² – 15y² – 6x + 60y – 51 = 0

Question 4.
Find the pair of tangents drawn from (1, 3) to the circle x² + y² – 2x + 4y – 11 = 0 and also find the angle between them.
Solution:
S.S11 = S²1
(x² + y² – 2x + 4y -11) (1 + 9-2 + 12-11) = [x + 3y – 1 (x + 1) + 2 (y + 3)- 11]²
(x² + y² – 2x + 4y – 11)9 = [5y-6]²
9x² + 9y² – 18x + 36y – 99
25y²+ 36 – 60 y
9x² – 16y² – 18x + 96y – 135 = 0

Question 5.
Find the pair of tangents from the origin to the circle x² + y² + 2gx + 2fy + c = 0 and hence deduce a condition for these tangents to be perpendicular.
Solution:
S.S11 = S²1
(x² + y² + 2gx + 2fy + c) (c) = [gx + fy + c]²
= g²x² +f²y²+ 2gfxy + 2gcx + 2fyc + c²
(gx + fy)² = c(x² + y²)
g²x² + f²y² + 2fg xy = cx² + cy²
(g² – c)x + 2fgxy + (f² – c)y² = 0
co-efficient of x² + co-efficient of y² = 0
g² – c + f² – c = 0
g² + f² = 2c

Question 6.
From a point on the circle x² + y² + 2gx + 2fy + c = 0, two tangents are drawn to the circle x² + y² + 2gx + 2fy + c sin² α + (g² + f²) cos² α = 0 (0 < a < π/2). Prove that the angle between them is 2α.
Solution:
[x²1 + y²1 + 2gx1 + 2fy1 + c sin² α + (g² + f²) cos² α] (S)
= (xx1 + yy1 + g(x + x1) + f(y + y1) + c sin² α + (g² + f²) cos² α)²
[(-c + c sin² α)+ (g² + f²) cos² α]S
= (x (x1 + g) + y (y1 + f) + gx1 + fy1 + c sin² α + (g² + f²) cos² α)²
[cos² α (g² + f² – c)] S
= [x (x1 + g) + y (y1 + f) + gx1 + fy1 + c sin² α + (g² + f²)cos² α
Let g² + f² – c = r²
= [x (x1 + g) + y (y1 + f) + gx1 + fy1 + gx1 + fy1 + c + (cos² α).r²)²
Coefficient of x² is r² cos² α – (x1 + g)²
Coefficient of y² is r² cos2 α – (y1 + f)²
Coefficient of xy is
h. cos² α r² – 2 (x1 + g) (y1 + f)

cos θ = cos 2 α
θ = 2α
Hence proved.


text:
# Microprocessors/Microcontrollers - Do registers have addresses?

My Embedded Systems professor keeps referring to the memory locations of registers as their respective "addresses". I'm confused by this; I was always under the impression that in any microprocessor, the CPU registers don't have addresses since they don't reside in the main memory (they reside in the microprocessor itself). I am also confused about what we refer to when we say the "memory location of the register" - again, it's not in main memory.

With that said, why are we referring to the locations of the CPU registers by "addresses"? Do all/some registers have addresses?

I thought about this and reasoned that maybe they're "connected" to certain main memory locations, allowing access to the values stored in the registers. To extend this thought, is this what memory mapping is?

I should also add that we are working specifically with NXP's LPC1768 microcontroller, which uses the ARM Cortex-M3 microprocessor.

It depends on the particular processor whether "registers" are in the same address space as regular data memory or separate. In either case, if there are multiple of them each one still needs a address.

Let's say the processor has 16 registers that are tightly coupled to the CPU and implemented separately from data memory. Those registers still have to be identified somehow. In this case, a 4 bit address would be needed to distinguish individual registers. In a RISC architecture, the 4-bit address of whatever register(s) a instruction worked on would be included in the instruction code. For example, the ADD instruction might add the value of a source register into a destination register. That instruction would include 4 bits to identify the source register and another 4 bits to identify the destination register. The documentation may refer to these registers by "number" 0 to 15, but that's really the address of where the registers lives in a special small memory by the CPU.

In addition to the above, even when a processor has special dedicated registers, those registers might be mapped into the general purpose data address space. References to those addresses are trapped and referred to the internal registers.

There are lots of schemes out there, but if you have more than one register, those registers need to be distinguished from each other somehow, and inside the hardware that will be with a "address", whether it is called that in the documentation or not.

• Ah, so there's the problem. I've always associated main memory/RAM with memory addresses, exclusively; I never would've thought to associate memory addresses with anything else. Thank you for clearing that up! – chevestong Mar 8 '13 at 0:11
• Also, now I'm curious; which component is the one responsible for locating and accessing these register addresses? – chevestong Mar 8 '13 at 0:12
• If they are dedicated registers there will be hardware just to select a register. Since there are so few registers, more hardware can be used to decode and act on the address bits that you could use in a normal large memory. This can make the decoding faster, allow for multiple ports, etc. Usually any one register can drive either ALU input and can save the ALU output. In some architecture (dsPIC is one example) three separate registers can be doing these things separately in the same instruction. – Olin Lathrop Mar 8 '13 at 12:42

The source of the confusion is that there are (in general) two kinds of things that can be called "registers".

The first is probably what you are familiar with: in ARM, it's registers R0, R1, R2, ... R12, SP, LR, PC and in x86 it's eax, ebx, ecx, edx, ebp, and so on. These can also be called "core registers" or "processor registers". They don't have addresses in the system memory space and can be accessed only by specific instructions.

The other is the registers that can control various hardware blocks (peripherals), in the CPU itself or external to it. On LPC1768 and many other embedded processors they're typically memory-mapped, and that's why they have addresses. For example the UART0 block is at address 0x4000C000 and that's where you need to read or write to communicate with it. To distinguish from the core registers, they can be called "peripheral registers" or "hardware registers".

On some low-end 8-bit microcontrollers like 8051 or PIC, there may be no core registers at all besides perhaps an accumulator, and all other registers are mapped into various memory areas like "internal RAM" (for temporary storage/calculation) or "Special Function Registers" (SFR) memory for the control and peripheral registers. In them, "registers" almost always have an address.

Bigger ARMs also have coprocessor registers, that can be used to control various core functions (e.g. MMU or cache) with instructions like MRC or MCR. These registers are similar to the core registers in that they don't have a memory address but just a number.

Also, on x86 you can have I/O ports, accessed by instructions in and out, which can be used to control some hardware blocks. These are similar in function to the peripheral registers but are usually not called such.

• Are the processor registers accessible in any way? – chevestong Mar 9 '13 at 4:29
• @ProSteve037: of course, otherwise there would be no point in having them :) Usuaully most instructions actually work with processor registers. E.g. on ARM: MOV, LDR, STR, ADD, SUB and so on. – Igor Skochinsky Mar 9 '13 at 16:57
• @ProSteve037 In a sense, processor registers do have a sort of address, but it is used in the register field of the opcode (the machine-code instruction-word), and cannot be confused with memory addresses (their positions in the opcode format are distinct, and the fields are different sizes). – luser droog Jul 20 '13 at 4:53

You are correct that some registers are not located inside the main memory, but rather in the microprocessor itself, and that those registers are memory-mapped into certain locations.

The LPC1768 microcontroller has only 64kB of RAM (what I believe you mean by main memory) however a 32-bit address bus and 4GB of total address space. The rest of this address space contains the flash memory storing your program, and the registers for all the peripherals (for example the output pin states, or the ADC).

Typically when you attempt to access a memory-mapped location, logic inside the microcontroller will identify where the memory address is physically located, and will operate control lines so the data gets to where it was intended, regardless of whether it is in RAM, a GPIO port or a peripheral control register.

This simplifies writing software, as you don't need to worry too much about where the registers are physically located, and makes compiling higher-level languages (like C) much easier.

In the specific case of the LPC1768, looking at the datasheet (http://www.nxp.com/documents/data_sheet/LPC1769_68_67_66_65_64_63.pdf) we can see the address map on page 20 (Figure 4), which shows where all the peripherals are mapped to in memory.

Of course, the processor also contains a handful of internal registers which are not memory mapped, these can be accessed much more quickly than anything in the address space, as the memory-management logic is slow compared to the core and are used as temporary storage during operations. Part of the job of a compiler is to handle storing data in registers and moving it out of/into memory for you.

As others have said, it depends on the microcontroller family. And it depends on what you mean by register.

The msp430 for example, has two sets of "registers". The first is the RISC register file, with 16 16bit registers. These include the Program Counter, Stack Pointer, Status, and Constant Generator registers, and 12 general use ones. These are registers in the traditional architecture use of the word.

The second set of registers are everything else. Ports, peripherals, interrupts, etc. These are part of the single memory file, and shares space with the general use RAM and Flash (Code Space)

For example the msp430g2231 has a Port 1 Output register at memory address 0x21.

You can access the register with register name p1out, but that's just a pointer to 8-bit memory address 0x21. Most importantly, that's how the compiler sees it. The header file, in this case msp430g2231.h, defines "p1out" as meaning 0x0021. Aside from the RISC register file, the common use of Register just means a memory address for x specific option. What you see as Register p1out, is just the way a higher language makes it easier for you to program, instead of memorizing memory maps.

As a generic term "register" just means a place where you can store ("register") information, nothing more.

Most architectures reserve the term register for locations within the CPU that are identified by bits in an instruction, and which are often accessible much faster than general bulk ("RAM") memory. (And often 2 or 3 registers can be accessed in parallel in one execution cycle.)

However, Microchip PIC documentation for instance, refers to all addressable locations as registers, even including RAM. When your professor copies this use of the term he should IMO inform you that this is not the way the term "register" commonly used nowadays. (Like I hope I did in my PIC assembler classes.)

• Not just microchip - look at the 8051 for a much earlier example, and even that may well have predecessors. – Chris Stratton Mar 8 '13 at 13:13
• @ChrisStratton: I'm pretty sure the General Instruments PIC (upon which Microchip's 16C54 was based) predates the 8051, and it might even predate its predecessor the 8048. – supercat Mar 8 '13 at 21:08
• Yes, it looks like it precedes the 8048 by around a year. – Chris Stratton Mar 9 '13 at 17:03

Registers do have addresses, even though they don't generally reside in memory.

Think about it a minute : an address denotes a location in some space, where memory is just one instance of a space. I/O often has its own address space; in some microcontroller architectures, code memory and data memory are separate spaces.

And so registers may have their own space too : sometimes FP and integer registers (and on the 68000 I believe, address registers) each have their own separate space.

One question is: how do we tell whether address 1 refers to byte 1 in memory, I/O port 1, or register 1? Usually from the context : in an IN or OUT instruction, obviously a port. In a register-to-register instruction, it's a register address. In a Load instruction, there will be a (big) memory address and a (small) register address, and so on.

In an ARM core, a memory address will usually be a 32-bit number; a register address will be a 5 bit number.

• Many processors have some registers which are accessed "by number", but also some registers that are only accessible using special instructions. I don't know how one could meaningfully describe the 6502's "S" register as having an address, for example. Aside from push/pop/call/return, the only instructions that access it are TSX/TXS (transfer S to X, or X to S). Bit 4 of the opcode selects between TSX and TAX, or between TXS and TXA, but it doesn't make sense to regard the opcodes as "Transfer X to register #b", since no other instructions refer to A is reg #0 and S as reg #1. – supercat Dec 5 '13 at 23:41

If one defines an address as being a set of k bits which may be used to select one item from a set of up to 2^k items, then it is common for many registers in many processors and controllers to have addresses, but also for controllers to have some registers which are strobed by circuits which detect particular conditions, and are not identifiable via any form of address. It's important to note, however, that in many cases the address wires which control CPU registers will have no relation to the address wires which are connected to larger memory systems. As such, register "addresses" will often exist in an entirely separate "universe" from memory addresses.

On most processors, register "addresses" are always either generated internally by the processor logic, outside the programmer's control, or fetched from certain bits in each instruction. The only way by change code could under software affect which register should be fetched by a particular instruction would be to patch the appropriate bits within that instruction. On the General Instruments PIC, whose design lives on in the form of the Microchip PIC, if an opcode specified all zeroes for an address, hardware would substitute the contents of a different register located at address 3. This allows code to use computations to select an address.

Perhaps the most important thing to understand about addresses is that it is possible for a system to have different address spaces that effectively exist in different universes. On the 8051, for example, there are, depending upon how one counts, at least four different address spaces and possibly as many as six; four of them are entirely independent (the instructions:

mov a,80h  ; Direct address space
mov a,@r0  ; Assume R0 = 80h
movc a,@a+dptr ; Assume A = 0 and DPTR = 80h
movx a,@dptr ; Assume DPTR = 80h

all retrieve data from "address 80h" but they read four unrelated things: an address in I/O space (the port 0 data register I think), internal data register 80h, code memory at address 0x0080, and external data memory at address 0x0080. In many systems, these things would in fact have no relation whatsoever to each other. The fact that a register will respond to a particular address in one universe says little or nothing about whether it will respond to that or any other address in a different universe.

RISC means "Reduced Instruction Set Computer". Part of the way you reduce the size of the instruction set is by having only one kind of data location, which includes Registers, RAM or I/O.

Back when people took these ideas seriously, the two expected advantages of RISC designs were, that you could make the processor much faster if you made it much simpler, and that you could optimize your program code if you could use any memory address for anything, instead of forcing everything to load and unload going through the ALU register for arithmetic, the Memory Address register for memory addressing etc.

Two remnants of that way of thinking are, (1) We have processors that PRETEND all registers are equal, by mapping registers into the memory space, and (2) We have professors that PRETEND all registers are equal, by calling registers memory locations.

Be tolerant. It was an important area of research for PHD students, which had a significant and lasting impact on the way some processors were designed.

• No. RISC does not tend to mean loss of distinction between the register file and main memory, as that would complicate instruction decoding, which is the opposite of RISC goals. RISC is classically about simple instructions which do what they do quickly, and leaving the programmer/compiler to string them together. So register and memory address versions of instructions have different encodings in a classic RISC architecture. And memory access is usually to an address provided by a register with a limited immediate displacement since only so many bits are available in the instruction word. – Chris Stratton Mar 8 '13 at 13:22
• You got that correct except the first sentence. Loss of distinction between register file and main memory is one of the ways classic RISC simplified instruction decoding, which is one of the goals of RISC. In practice, practical considerations intervene. For example see The Ultimate RISC – david Mar 13 '13 at 0:09
• A RISC instruction word quite explicitly codes a register number or a memory reference, which is a preservation of distinction compared to the situation contemplated here in which a register is coded exactly the same way as a memory address. – Chris Stratton Mar 13 '13 at 1:13
• Please read the reference first. Before posting. – david Mar 13 '13 at 2:42
• The reference is to an oddball academic architecture, not classic risc designs as actually built. – Chris Stratton Mar 13 '13 at 11:18

The 8051 if I remember right you could access the registers using memory addresses, but this is not the general case for all processors. The ARM processors have no way to do this, the general purpose registers r0-r15 cannot be accessed on the memory bus.


text:
# Citymapper API wrapper

As a simple project to tackle during the holidays I've set to write a simple wrapper around Citymapper's api to familiarise with httr, testthat and a simple CI setup (on CircleCI).

The API mainly revolves around 2 things:

• Cheking if a given point falls within their covered areas. As on their api docs there are 2 versions of this endpoint (a second one accepts multiple inputs via a JSON payload), I've implemented 2 different functions to reflect this, no idea if it'd make sense to collapse it into one.
• Computing travel time (using public transport) between two points.

Below you can find the main methods, here a link to the repo.

get_travel_time.R

#' Get travel time between two points
#'
#' Computes estimated travel time between two points using public transport.
#' If \code{time} and \code{time_type} are not specified, time of travel will be assumed to be the same time at which the request is made.
#'
#' @param start_coord Geographical coordinates of the start point in WGS84 '<latitude>,<longitude>' format.
#' @param end_coord Geographical coordinates of the arrival point in WGS84 '<latitude>,<longitude>' format.
#' @param time A date & time in ISO-8601 format (e.g \code{2014-11-06T19:00:02-0500}). If omitted travel time will be computed for travel at the time of the request.
#' @param time_type Required if time is provided. At the moment the only defined type is arrival, it computes the travel time for arriving at end_coord at the given time.
#' @inheritParams citymappr_setup
#' @return Estimated travel time in minutes (int).
#'
#' @examples
#' \dontrun{
#' get_travel_time(start_coord = "45.448643,9.207645",
#'                 end_coord = "45.452349,9.180225")
#' }
#'
#'
#' @importFrom httr GET stop_for_status content
#' @importFrom jsonlite fromJSON
#'
#' @export
get_travel_time <- function(start_coord,
end_coord,
time="",
time_type="",
api_token = Sys.getenv("CITYMAPPER_API_TOKEN")) {

resp <-GET(url = "https://developer.citymapper.com/api/1/traveltime/",
query = list(
key = api_token,
startcoord = start_coord,
endcoord = end_coord,
time = time,
time_type = time_type
)
)

stop_for_status(resp)

return(
fromJSON(
content(resp, "text"))$travel_time_minutes ) }  check_coverage.R #' Check if a point is in covered area #' #' Checks if a given point falls within Citymapper's covered areas. #' It is good practice to refresh this value regularly as covered areas might change. #' #' @inheritParams citymappr_setup #' @param point Geographical coordinates of the point in WGS84 \code{'<latitude>,<longitude>'} format. #' @return A tibble containing boolean responses for each point. #' #' @importFrom magrittr %>% #' @importFrom rlang .data #' @importFrom httr GET content stop_for_status #' @importFrom jsonlite fromJSON #' @importFrom dplyr mutate #' @importFrom tibble as_tibble #' #' @examples #' \dontrun{ #' check_coverage("45.448643,9.207645") #' } #' #' @export check_coverage <- function(point, api_token=Sys.getenv("CITYMAPPER_API_TOKEN")) { resp <- GET(url="https://developer.citymapper.com/api/1/singlepointcoverage/", query = list(key = api_token, coord = point)) stop_for_status(resp) return( fromJSON( content(resp, "text"))[["points"]]$covered
)

}

check_coverage_multi.R

#' Checks if multiple points are in covered area
#'
#' Checks if  multiple points fall within Citymapper's covered areas.
#' It is good practice to refresh this values regularly as covered areas might change.
#'
#' @inheritParams citymappr_setup
#' @param points Dataframe containing geographical coordinates of the start point in WGS84 \code{'<latitude>,<longitude>'} format.
#'   Columns should be set as \code{id (optional)} and \code{coord}.
#' @return A tibble containing boolean responses for each point. IDs column passed in \code{points} will be mirrored back in response.
#'
#' @examples
#' \dontrun{
#' # Make dataframes with coordinates and (optional) ids
#'
#' }
#'
#'
#' @importFrom magrittr %>%
#' @importFrom jsonlite fromJSON toJSON
#' @importFrom httr POST content stop_for_status
#' @importFrom tibble as_tibble
#'
#' @export
#TODO: there are problems with json parsin (coords are not parsed as a list)
check_coverage_multi <- function(points,
api_token=Sys.getenv("CITYMAPPER_API_TOKEN")) {

if (!is.data.frame(points)) {
points <- as_tibble(points)
}

# Check if column name respect c("id", "coord") convention
if(!all(c("coord") %in% names(points))) {
stop("Dataframe has wrong column names, make sure they are set as c('id', 'coord')")
}

# Get input in required JSON format
points$coord <- lapply( strsplit(as.character(points$coord), ","),
as.numeric
)

cured_input <- toJSON(list(points = points))

resp <- POST(paste0("https://developer.citymapper.com/api/1/coverage/?key=",
api_token),
body = cured_input,
encode="json")

stop_for_status(resp)

return(
fromJSON(
content(resp, "text"))[["points"]]
)

}

Even being quite a simple package, it'd be good to understand if project structure makes sense and if there's any room for improvement.

• By the way, on L41 of check_coverage_multi.R, are you sure you don't mean !all(c("id", "coord") %in% names(points))? Jan 9, 2020 at 12:21
• Good questions, I am checking just for the coord columns as it's mandatory (id is optional as it'll be just mirrored back from the endpoint for quick reference). Is there a more elegant solution? I do believe I left that if(!all(...)) there as I began checking for both fields in the first place. Jan 9, 2020 at 12:44

I think overall, it looks quite good. Some polishing is needed before you submit to CRAN (e.g. you didn't update the Title and Description fields in your DESCRIPTION). Below are also specific points you might want to consider.

## Structure of your specific project

• In terms of structure, I don't really understand the need of having two separate functions for checking coverage for a single point and for multiple points. I know the API has two different URLs for this but surely, it would be simpler for users if they have a single function that works no matter if they provide one or multiple points. Or am I missing something here?

• Currently, if the user didn't register an API key, they get a cryptic error message (Forbidden (HTTP 403)). It might be better to check if api_token is empty and return a more specific error message.

• You seem to import a lot of packages and functions that (as I far as I can tell) you're not using. If this is actually the case, it might be good to remove them from your dependency list.

• Add a BugReports field to your DESCRIPTION to guide users to the appropriate place to report issues and contribute patches.
• According to CRAN, your LICENSE file should only contain two lines with your name and the year, not the full license text.
• You have non-standard files in your package root, namely circle.yml (should be add to .Rbuildignore) and citymappR_logo.png (should be moved to man/figures).


text:
# How to do a modular exponentiation?

How to solve a problem like this:

Let $N = 11$. What is $2^{2652557887263} \pmod N$?

As part of the questions we are given the multiplication table for $\mathbb{Z}_{11}$:

x | 1  2  3  4  5  6  7  8  9  10
---------------------------------
1 | 1  2  3  4  5  6  7  8  9 10
2 | 2  4  6  8 10  1  3  5  7  9
3 | 3  6  9  1  4  7 10  2  5  8
4 | 4  8  1  5  9  2  6 10  3  7
5 | 5 10  4  9  3  8  2  7  1  6
6 | 6  1  7  2  8  3  9  4 10  5
7 | 7  3 10  6  2  9  5  1  8  4
8 | 8  5  2 10  7  4  1  9  6  3
9 | 9  7  5  3  1 10  8  6  4  2
10|10  9  8  7  6  5  4  3  2  1

...as well as $(\mathbb{Z}_{11}^*,\times)$, the group of units of $\mathbb{Z}_{11}$ under multiplication:

exp|  0   1   2   3   4   5   6   7   8   9   10
------------------------------------------------
g | g^0 g^1 g^2 g^3 g^4 g^5 g^6 g^7 g^8 g^9 g^10
------------------------------------------------
1 |  1   1   1   1   1   1   1   1   1   1   1
2 |  1   2   4   8   5  10   9   7   3   6   1
3 |  1   3   9   5   4   1   3   9   5   4   1
4 |  1   4   5   9   3   1   4   5   9   3   1
5 |  1   5   3   4   9   1   5   3   4   9   1
6 |  1   6   3   7   9  10   5   8   4   2   1
7 |  1   7   5   2   3  10   4   6   9   8   1
. |
10|  1  10   1  10   1  10   1  10   1  10   1

Overall, I'm having trouble understanding how the numbers in the table are generated, and how they're used to solve the aforementioned question.

The second row of the second table gives you the values of $g^e\pmod{11}$ for $0 \le e \le 10$. Notice that $2^{10}\pmod{11} \equiv 2^{0}\pmod{11}$. This means that $2^{10}$ raised to any power is congruent to $1\pmod{11}$.

With that in mind, it shouldn't be hard to see that $2^{2652557887263}\pmod{11} \equiv 2^3\pmod{11}$. So the answer is $8$.

P.S. I suspect your question may be slightly off-topic for this site, hence the down votes.

• I think I'm starting to see it, but I'm still a little unsure. So suppose I had 2^235422656452414554 (mod 11), would that be 2^4 (mod 11), or 16? – D. Crypt Nov 15 '16 at 18:57
• There is no "$16$" in $\mathbb{Z}_{11} = \{0,1,2,3,4,5,6,7,8,9,10\}$ – tylo Nov 15 '16 at 19:07

Modular exponentiation is done by Square and Multiply. And usually after each step the modulo operation is used.

And large exponents as in your example can be reduced by Euler's theorem, with the special case of $n$ being prime covered by Fermat's little theorem.

With that, you can actually calculate an equivalent exponent to $x$ as $x' = x\mod \phi(n)$. In your example $\phi(n) = 10$ you get $2652557887263 = 3 \mod 10$

Edit: In general when dealing with modular arithmetic, you're not actually calculating with the usual integers - we just use those integers are representations for so-called congruence classes, see the chapter about that in Wikipedia on modular arithmetic.


text:
# Score

1468
10840
40

Subtask no. Testdata Range Constraints Score
1 0~3 $N\leq 5$ 10 / 10
2 4~7 $N\leq 1000, N=M$ 20 / 20
3 8~11 $N\leq 1000$ 10 / 10
4 12~15 $N=M$ 0 / 12
5 16~19 $N\leq 5\times 10^ 5$ 0 / 48

# Testdata Results

Testdata no. Subtasks Time (ms) Memory (KiB) Verdict Score
0 1 4 5720 Accepted 100
1 1 4 5860 Accepted 100
2 1 4 5904 Accepted 100
3 1 4 5864 Accepted 100
4 2 4 6016 Accepted 100
5 2 4 5864 Accepted 100
6 2 4 5780 Accepted 100
7 2 4 5868 Accepted 100
8 3 4 5800 Accepted 100
9 3 4 5816 Accepted 100
10 3 4 5784 Accepted 100
11 3 4 5824 Accepted 100
12 4 196 9396 Wrong Answer 0
13 4 188 8908 Wrong Answer 0
14 4 180 8964 Wrong Answer 0
15 4 196 9280 Wrong Answer 0
16 5 216 10120 Wrong Answer 0
17 5 148 10840 Wrong Answer 0
18 5 140 10436 Wrong Answer 0
19 5 156 10176 Wrong Answer 0
Submitter:
Compiler:
c++14
Code Length:
1.07 KB


text:
# Inegration with square roots - calc 1

1. Homework Statement [/b]
∫x/√(x-1)dx

2. Homework Equations [/b]
I'm just stumped. I have tried u substituion with
u=√(x-1)
x=u^2+1

((u^2+1)/u)du
=(u+1/u)du

but it doesn't seem to work and I can't integrate 1/u.

I just don't know where to go with this any help would be greatly appreciated.

Aimee

Related Calculus and Beyond Homework Help News on Phys.org
cristo
Staff Emeritus
If I were doing this question, I wouldn't make the substitution you made, but would instead use the substitution u=x-1.


text:
# Equivalence of Definitions of Topology Generated by Synthetic Basis/Definition 1 iff Definition 3

## Theorem

Let $S$ be a set.

Let $\BB$ be a synthetic basis on $S$.

Let $\tau$ be the topology on $S$ generated by the synthetic basis $\BB$:

$\ds \tau = \set {\bigcup \AA: \AA \subseteq \BB}$

Then:

$\forall U \subseteq S: U \in \tau \iff \forall x \in U: \exists B \in \BB: x \in B \subseteq U$

## Proof

From Set is Subset of Union: General Result, the forward implication directly follows.

We now show that the reverse implication holds.

By hypothesis, we have that:

$\ds U \subseteq \bigcup \set {B \in \BB: B \subseteq U}$
$\ds \bigcup \set {B \in \BB: B \subseteq U} \subseteq U$

By definition of set equality:

$\ds U = \bigcup \set {B \in \BB: B \subseteq U}$

The result follows.

$\blacksquare$