text:
# Expected in-sample error of linear regression with respect to a dataset D

In my textbook, there is a statement mentioned on the topic of linear regression/machine learning, and a question, which is simply quoted as,

Consider a noisy target, $$y = (w^{*})^T \textbf{x} + \epsilon$$, for generating the data, where $$\epsilon$$ is a noise term with zero mean and $$\sigma^2$$ variance, independently generated for every example $$(\textbf{x},y)$$. The expected error of the best possible linear fit to this target is thus $$\sigma^2$$.

For the data $$D = \{ (\textbf{x}_1,y_1), ..., (\textbf{x}_N,y_N) \}$$, denote the noise in $$y_n$$ as $$\epsilon_n$$, and let $$\mathbf{\epsilon} = [\epsilon_1, \epsilon_2, ...\epsilon_N]^T$$; assume that $$X^TX$$ is invertible. By following the steps below, show that the expected in-sample error of linear regression with respect to $$D$$ is given by,

$$\mathbb{E}_D[E_{in}( \textbf{w}_{lin} )] = \sigma^2 (1 - \frac{d+1}{N})$$

Below is my methodology,

Book says that,

In-sample error vector, $$\hat{\textbf{y}} - \textbf{y}$$, can be expressed as $$(H-I)\epsilon$$, which is simply, hat matrix, $$H= X(X^TX)^{-1}X^T$$, times, error vector, $$\epsilon$$.

So, I calculated in-sample error, $$E_{in}( \textbf{w}_{lin} )$$, as,

$$E_{in}( \textbf{w}_{lin} ) = \frac{1}{N}(\hat{\textbf{y}} - \textbf{y})^T (\hat{\textbf{y}} - \textbf{y}) = \frac{1}{N} (\epsilon^T (H-I)^T (H-I) \epsilon)$$

Since it is given by the book that,

$$(I-H)^K = (I-H)$$, and also $$(I-H)$$ is symetric, $$trace(H) = d+1$$

I got the following simplified expression,

$$E_{in}( \textbf{w}_{lin} ) =\frac{1}{N} (\epsilon^T (H-I)^T (H-I) \epsilon) = \frac{1}{N} \epsilon^T (I-H) \epsilon = \frac{1}{N} \epsilon^T \epsilon - \frac{1}{N} \epsilon^T H \epsilon$$

Here, I see that,

$$\mathbb{E}_D[\frac{1}{N} \epsilon^T \epsilon] = \frac {N \sigma^2}{N}$$

And, also, the sum formed by $$- \frac{1}{N} \epsilon^T H \epsilon$$, gives the following sum,

$$- \frac{1}{N} \epsilon^T H \epsilon = - \frac{1}{N} \{ \sum_{i=1}^{N} H_{ii} \epsilon_i^2 + \sum_{i,j \ \in \ \{1..N\} \ and \ i \neq j}^{} \ H_{ij} \ \epsilon_i \ \epsilon_j \}$$

I undestand that,

$$- \frac{1}{N} \mathbb{E}_D[\sum_{i=1}^{N} H_{ii} \epsilon_i^2] = - trace(H) \ \sigma^2 = - (d+1) \ \sigma^2$$

However, I don't understand why,

$$- \frac{1}{N} \mathbb{E}_D[\sum_{i,j \ \in \ \{1..N\} \ and \ i \neq j}^{} \ H_{ij} \ \epsilon_i \ \epsilon_j ] = 0$$ $$\ \ \ \ \ \ \ \ \ \ \ \ (eq \ 1)$$

$$(eq 1)$$ should be equal to $$0$$ in order to satisfy the equation,

$$\mathbb{E}_D[E_{in}( \textbf{w}_{lin} )] = \sigma^2 (1 - \frac{d+1}{N})$$

Can any one mind to explain me why $$(eq1)$$ leads to a zero result ?

• Good news: you've already understood all the hard parts (especially that crazy trace trick for idempotent matrices). The following assumptions are made: $\epsilon_i$ and $\epsilon_j$ are independent, $\mathbb{E}(\epsilon_i) = 0$, and the $H_{ij}$ are "non-stochastic" constants. It follows $\mathbb{E}(H_{ij} \epsilon_i \epsilon_j) = H_{ij} \mathbb{E}(\epsilon_i) \mathbb{E}(\epsilon_i) = 0$. May 30 '14 at 12:35
• @WillNelson why E(ei) = 0? but $E(ei^2) \neq 0$? Aug 3 '15 at 8:16
• @user136266 $\mathbb{E}(\epsilon_i) = 0$ because $\epsilon_i$ is mentioned to have zero mean as given. $\mathbb{E}(\epsilon_i^2)$ is not simply $\mathbb{E}(\epsilon_i)^2$, it is derived from $Var(\epsilon_i) = \mathbb{E}(\epsilon_i^2) - \mathbb{E}(\epsilon_i)^2$ where $Var(\epsilon_i)$ is given as $\sigma^2$.
– peco
Aug 30 '17 at 19:21
• how can you derive: (H-I)epsilon in the first step? Oct 1 '17 at 20:54

As you write above, I start from here.

Let it be :

$$\boldsymbol {E = E_{(N,1)} = {\hat y - y}}$$

\begin{align} E_{in}(w_{lin}) &= \frac{1}{N} E^T E \\ &= \frac{1}{N} (\epsilon^T (H-I)^T (H-I) \epsilon) \\ &= \frac{1}{N}(\epsilon^T (I-H) \epsilon) \end{align}

then

\begin{align} \Bbb E_D \left[ E_{in}(w_{lin})\right] &= \frac{1}{N} \Bbb E_D[\epsilon^T (I-H) \epsilon] \\ &= \frac{1}{N} (\Bbb E_D[\epsilon^T \epsilon] - \Bbb E_D[\epsilon^T H \epsilon]) \\ &= \sigma^2 (1 - \frac{d+1}{N}) \end{align}

Because:

(1) \begin{align} \Bbb E_D[\epsilon^T \epsilon] &= \Bbb E_D[\epsilon_1^2 + \epsilon_2^2 + \cdots + \epsilon_N^2] \\ &= \Bbb E_D[\epsilon_1^2] + \cdots + \Bbb E_D[\epsilon_N^2] \\ &= N \sigma^2 \end{align}

(2) \begin{align} \Bbb E_D[\epsilon^T H \epsilon] & = \Bbb E_D \left[ \sum_{i=1}^{N} H_{ii} \epsilon_i^2 + \sum_{i \neq j}^{N}H_{ij} \epsilon_i \epsilon_j \right] \\ &= \Bbb E_D[\sum_{i=1}^{N} H_{ii} \epsilon_i^2] + \Bbb E_D[\sum_{i \neq j}^{N}H_{ij} \epsilon_i \epsilon_j] \\ &= trace(\boldsymbol H) \sigma^2 + 0 \\ &= \sigma^2 (d+1) \end{align}

since $$\epsilon_i, \epsilon_j$$ are independent, $$\Bbb E_D[\epsilon_i\epsilon_j] = \Bbb E_D[\epsilon_i] \Bbb E_D[\epsilon_j] = 0$$, and $$\Bbb E(\epsilon_i) = 0$$, $$\Bbb E(\epsilon_i^2) = \sigma^2$$

The common explanation for this (I don't know if there is a better one) is that (in linear regression) error components from random variables are assumed to be linearly independent from each other, that is, they are also random and one cannot be used to estimate the other.

With this assumption you will get that the expected sum of their products to have a zero mean.

That does not happen for the expectancy of E(ϵi²), since ϵi² will be always positive, it will never cancel itself out. And for a Gaussian noise E(ϵi²) = σ².

• Why did I say in linear regression? Because, let's say you like this type of matrix multiplication model and want to extend it to have some quadratic fitting capabilities. You could add cross products and squares of the input and use same basic algebra to fit it. You would have a longer x and more features to adjust, but if you had enough data and computing power it would work. Only that to calculate the errors, this assumption wouldn't hold, since there would be terms that would be clearly dependant on each other. Sep 27 '15 at 15:37


text:
# Combinatorics question involving having a fixed subword

Words of $20$ letters are constructed from the English Alphabet. How many such words contain the subword DISCRETE?

Can someone give a detailed explanation for this?
This is what I did: Fix a subword 'DISCRETE' and treat this as one letter.
Then,we require 12 other letters. This can be chosen in $26^{12}$ ways. Then, once picking these letters, we can arrange the entire $20$-letter word in $13!$ ways.
So total is $13! \times 26^{12}$.

• I'm afraid you double counted those situations where DISCRETE occured twice. – Zhuoran He Oct 15 '17 at 7:04
• @ZhuoranHe I just realise I over-counted more than that right? Because I should multiply by $13$ (this is double counting) instead of $13!$ – Natash1 Oct 15 '17 at 7:10
• Yes. I assumed you did your part correctly. The double counting is not easy to see. – Zhuoran He Oct 15 '17 at 7:11
• Hint: split up in 2 cases. DISCRETE one, or two times. – drhab Oct 15 '17 at 7:12
• Also DISCRETE is an easy word with no common prefix and postfix. If your word is AHA, then how many times it appeared in AHAHA becomes not well-defined. This has to do with KMP matching. – Zhuoran He Oct 15 '17 at 7:14

Let: $$W:=\{\langle L_1,\dots,L_{20}\rangle\mid L_i\in\{A,B,\dots,Z\}\}$$for $k=1,\dots13$ let: $$S_k:=\{\langle L_1,\dots,L_{20}\rangle\in W\mid \langle L_k,\dots,L_{k+7}\rangle=\langle D,I,S,C,R,E,T,E\rangle\}$$and finally let:$$S=\bigcup_{k=1}^{13}S_k$$

Then you are looking for $|S|$, and with inclusion/exclusion we find:$$|S|=\sum_{k=1}^{13}|S_k|-\sum_{1\leq i<j\leq13}|S_i\cap S_j|$$

Here $\sum_{1\leq i<j\leq13}|S_i\cap S_j|$ can be recognized as then number of 20-letter words that contain subword DISCRETE twice. In order to find it we use stars and bars.

There are $\binom{4+2}{2}=\binom{6}{2}=15$ sums $l+m+r=4$ where $l$ and $r$ are nonnegative integers. Here $l$ stands for the number of letters at the utmost left of the first DISCRETE, $m$ for the number of letters in between and $r$ for the number of letters at the utmost right of the second DISCRETE. This makes clear that $$\sum_{1\leq i<j\leq13}|S_i\cap S_j|=15\cdot26^4$$

Further it is clear that $|S_k|=26^{12}$ so our final outcome is:$$|S|=13\cdot26^{12}-15\cdot26^4$$

You cannot do permutations in the end since letters may repeat, and you overlooked that other letters may form word descrete on their own. There you must subtract all the cases with two descretes

So you can put descrete on 1st,2nd,...,13th position, it is $13\cdot26^{12}$. And double discrete you can put on 1st&2nd, 1st&3rd, ..., 5th&6th. Total of 5+4+...+1=15

$13\cdot26^{12}-15\cdot26^{4}$ is the result

format: plain


text:
# Aeromarine 60hp V-Twin Engine

### Help Support HomeBuiltAirplanes.com:

#### soupercooper

##### Well-Known Member
HBA Supporter
if you ask me Kevin has been VERY SHARING, so sharing that Aeromarine is running with it, as for Ace Aviation I cant vouch for him, Ive done business with him ONCE and logistics and delivery were bad but quality and price was good. he uses SKF bearings or some sort of german bearing maybe FAG, in my hands their high quality machined parts and nice anodized finish, someone can help maybe by adapting a gear drive to it in mean time all we have is a belt drive so be thankful we at least have that!, the poly-v belt is the widest Ive ever seen and surely can handle the HP. IMO its pretty impressive for a belt drive. I think kevin has at least 30+ hours on the belt drive but he's not good about posting his total hours on his you tube channel, I have asked him to do so but no luck yet. This engine is set up ITS NOT for anything but light LSA or maybe some stout ultralights like my Reliant SX (heavy duty J3 kitten).If I recall the engine use ball bearings on the crankshaft and not the typical sleeve bearings, i need to look into that, I do know its a tapered output shaft.

#### pictsidhe

##### Well-Known Member
I have had brief correspondence both with Kevin in England, and with the Ace Aviation PoC in India. Kevin gave me access to his Dropbox, which has a LOT of detail on his conversions. I haven't dug into it to see if the details of the redrive are there or not. You MIGHT be able to deduce all the relevant masses and spring constants from the detail drawings. I don't think either Kevin nor Ace actually know doodly about torsionals. And even Gates is pretty closed mouth about the stiffness of their sourced components. What I can say is that nothing I've seen about the Ace Redrives indicates that they have any sort of resilient decoupling element that would make them torsionally "soft". If one wanted to design one, say with a "Guibo" like a Rotax E box, I bet Ace would be happy to chew you one out of billet, for little money, decent quality, long lead time, and frustratingly slow, if any, communications.
All I wanted was pulley and belt sizes to make a first approximation of natural frequency. I have enough belt, prop and engine data to work from there. Ace does not know anything about TV, let alone have analysed it.
I eyeballed the drive dimensions from pictures instead, and didn't like the numbers that I got. That took me from probable customer, to likely competitor. I will not be copying the Ace drive, which is what they are worrying about. Ironically, I'm almost certainly going to farm out the machine work if this goes into production, which Ace does seem to do well.

#### Tallyho

##### Member
The gk engine with a redrive for use in drones has been around for a while from a company called subaruair air in china. Only seem to have a presence on alibaba. They use the 1000cc version.

#### Tallyho

##### Member
Will add that Kevin still deserves credit for bringing the smaller engine to a wider audience and his personal testing.

#### soupercooper

##### Well-Known Member
HBA Supporter
The gk engine with a redrive for use in drones has been around for a while from a company called subaruair air in china. Only seem to have a presence on alibaba. They use the 1000cc version.
View attachment 102925
looks heavy and looks really busy? maybe a clutch and other components stacked to it?, anyone else have comments whats all stacked up behind the gear drive?

#### soupercooper

##### Well-Known Member
HBA Supporter
800 Aircraft

this is Gaokin web page on there Aero version
though this link is not the engine we were discusing it just does have me curious, this gaokin engine is 2-stroke 100hp at 800cc at 77 pounds, water cooled EFI as well.

#### erkki67

##### Well-Known Member
I’ve always admired this reduction drive, it’s a tooth belt of Otto Funk and his company flyeco .

id like to see a similar PSRU on the GK engine Kevin is using.

one thing for sure, this block requires a fair additional amount of machining compaired to the Ace redrive.

#### Attachments

• 145.1 KB Views: 56

#### erkki67

##### Well-Known Member

its just for the reduction drive unit, not for the engine

#### Tallyho

##### Member
looks heavy and looks really busy? maybe a clutch and other components stacked to it?, anyone else have comments whats all stacked up behind the gear drive?
72kg and 90hp. Seem to gave a selection of redrive available. I have no idea what is in the housings. Plus it's rotax money before shipping a duties.

#### sharpvector

##### Member
The gk engine with a redrive for use in drones has been around for a while from a company called subaruair air in china. Only seem to have a presence on alibaba. They use the 1000cc version.
View attachment 102925
Not cheap at $15-20K #### Bill-Higdon ##### Well-Known Member The gk engine with a redrive for use in drones has been around for a while from a company called subaruair air in china. Only seem to have a presence on alibaba. They use the 1000cc version. View attachment 102925 Subaruair was on thise website for a while, #### soupercooper ##### Well-Known Member HBA Supporter Not cheap at$15-20K

no that price is a complete package as seen in photo, stand alone redrives i found are $1500 to$2000 range. but i got a reply from them saying "currently not available" i responded to ask when they are available, i think they are the middle man and I will try to find direct source, maybe its Subaruair but like a previous post subaruair not to be found lately. i have photos of stand alone gear and belt redrives from alibaba source of price range of $1500 to$2000 from 4 different models. i read its china mfg. but German engineering. attached is one of four varieties of stand alone redrive at $1500 to$2000 range, these will be ALOT easier to import than engines! been there done that, dealing with EPA is the killer when importing engines! they mentioned they can make adapters for other engines, there is not much out there for prop redrives besides of course rotax. and a couple others like the one for inline 4 piston yamaha engine from I forget the name right now.

#### Attachments

• 283 KB Views: 18
Last edited:

#### soupercooper

##### Well-Known Member
HBA Supporter
I’ve always admired this reduction drive, it’s a tooth belt of Otto Funk and his company flyeco .

id like to see a similar PSRU on the GK engine Kevin is using.

one thing for sure, this block requires a fair additional amount of machining compared to the Ace redrive.
that is called a cog belt and more for timing functions or applications, i believe poly-v design is better fit in our application as you want a little bit of give or slip for TV issues or vibration or prop strike etc etc? i could be wrong and IM sure someone will chime in on this statement if Im wrong.

#### rv7charlie

##### Well-Known Member
I suspect that the engineers will disagree with that a bit. Unless you're talking about something like a CVT belt, slippage isn't a good thing. Even Valley Engineering, using a multi-V belt, didn't depend on belt slippage (which would quickly burn the belt). They used a spring loaded idler, very similar in concept to what you see with automotive engines' accessory drive belts. As I understand it, the TV goes into the idler's spring, rather than slipping the belt.

I could be wrong...

#### pictsidhe

##### Well-Known Member
I suspect that the engineers will disagree with that a bit. Unless you're talking about something like a CVT belt, slippage isn't a good thing. Even Valley Engineering, using a multi-V belt, didn't depend on belt slippage (which would quickly burn the belt). They used a spring loaded idler, very similar in concept to what you see with automotive engines' accessory drive belts. As I understand it, the TV goes into the idler's spring, rather than slipping the belt.

I could be wrong...
Yes, you are!
The valley engineering idler works like a one way clutch. Once belt tension exceeds a certain level, it springs in and let's one side of the belt go slack. The belt then slips a bit. Managing TV is tricky. The system needs the natural frequency out of the useable speed range. If oscillations do build up, they can very easily reach the point that something breaks. Slippage is one way to deal with that. If you don't have a 'slippable' connection somewhere, you have to be really, really careful. Many if not most amateur sized systems are 'soft' natural frequency is below idle. But a misfire at idle or even accelerating during startup can put the drive into the danger zone. Slip of something is one way to deal with that for short periods.

#### rv7charlie

##### Well-Known Member
Valley Engineering - Big Twin
Look at rotation direction, and tensioner location.

My undestanding is that there's a difference between a 'compliant' torsional frequency changer ('absorber') and a slipping belt. One should prevent the other (along with other, worse things).

#### rv7charlie

##### Well-Known Member
But slip isn't required to change tv freq.

#### pictsidhe

##### Well-Known Member
But slip isn't required to change tv freq.
No, but it adds enough damping to stop it. Try it at high power, you will smoke your slip device. Just ask Bede. Elsewhere, it is extremely useful for those annoying points you need to run through, but don't really want a honking big device to move it away.
The Valley tensioner limits negative torque during TV events. The numbers for my own redrive suggest I need a stiff tensioner on the drive side to reduce the natural frequency and a soft 'Valley' tensioner on the slack side to damp out TV at low RPM. Like Valley, I will thoroughly test it myself. IR temperature guns offer an easy way to check how much energy the belt is absorbing.

#### BBerson

##### Light Plane Philosopher
HBA Supporter
The Valley Engineering drive had about six hard rubber balls in ports that functioned as a one way device, not belt slip.


text:
zbMATH — the first resource for mathematics

Quaternions as reflexive skew fields. (English) Zbl 1222.12003
From the text: Throughout this text a skew field, or a sfield, is a ring with a unit element 1, in which every non zero element has an inverse. Given $$D$$ an sfield with centre $$F$$ and $$\sigma$$ an involution of $$D$$, i.e. a transformation $$x\mapsto \sigma(x)$$ of $$D$$ for which $$\sigma(x + y) = \sigma(x) + \sigma(y)$$, $$\sigma(xy) = \sigma(y)\sigma(x)$$ and $$\sigma^2(x) = x$$, for any $$x, y\in D$$.
Jean Dieudonné, in his work on the structure of unitary groups, says in [Sur les groupes classiques. (Paris: Hermann) (1948; Zbl 0037.01304), p. 72] that $$D$$ is a reflexive sfield if all the elements of $$F$$ are fixed by $$\sigma$$ and if $$x+\sigma(x)$$ and $$x\sigma(x)$$ belong to $$F$$, for any $$x\in D$$. He shows (by completing his proof in [Am. J. Math. 75, 665–678 (1953; Zbl 0051.01803)]) that non-commutative reflexive sfields are generalized quaternion sfields. His proof, amongst other things, relies on theorems concerning the structure of sfields of finite rank over their center, proved earlier this century in the 1920s. Now, Eliakim Hastings Moore had already stated and provided an elementary proof for the above-mentioned result provided by Dieudonné for sfields of characteristic other than 2. In 1922, E. H. Moore has defined a determinant for hermitian matrices with coefficients in those fields whose elements, fixed by the involution, are central [Bull. Am. Math. Soc. 28, 161–162 (1922; JFM 48.0128.07)].
Moore’s proof [General analysis. With the cooperation of Raymond Walter Barnard. Pt. I. Mem. Am. Philos. Soc. Vol. 1. Philadelphia: Am. Philos. Soc. (1935; Zbl 0013.11605 and JFM 61.0433.06), pp. 104–107] is based on an identity valid for any sfield with involution whose elements fixed by the involution are central. This identity, which was expressed by W. R. Hamilton himself [Elements of quaternions. (1866), p. 317; reprinted Cambridge (2009; Zbl 1204.01046)] for usual quaternions, is, in this case a translation of the identity $\langle\vec z\times\vec t, \vec y\rangle \vec x -\langle\vec z\times\vec t, \vec x\rangle \vec y - \langle\vec x\times\vec y, \vec t\rangle \vec z +\langle\vec x\times\vec y, \vec z\rangle \vec t = 0 \tag{1}$ in which $$x,y,z$$ and $$t$$ are vectors in usual three-dimensional space, and $$\langle\vec x, \vec y\rangle$$ and $$\langle\vec x\times\vec y\rangle$$ are, respectively, the scalar and vector products of $$x$$ and $$y$$. Here we sketch out Dieudonné’s non elementary proof, present Moore’s proof because the book cited above is difficult to obtain, and also present another elementary proof based on the fact that if $$V = \{x\in D\mid \sigma(x) = -x\}$$, then $$V$$ is a vector space on the subfield $$F_0$$ of the elements of $$F$$ fixed by $$\sigma$$ and the application $$x\mapsto x^2$$ is a regular quadratic form on that vector space.
MSC:
 12E15 Skew fields, division rings 16K20 Finite-dimensional division rings
Full Text:
References:
 [1] Dieudonné J., Sur les groupes classiques,Actualités scientifiques et industrielles, No. 1040, Paris, Hermann, 1948. · Zbl 0037.01304 [2] Dieudonné J., On the structure of unitary groups (II),Amer. J. Math.,75 p. 67, (1953). · Zbl 0051.01803 [3] Moore E. H., On the determinant of an hermitian matrix of quaternionic elements,Bull Amer. Math. Soc.,28 161–162 (1922). · JFM 48.0128.07 [4] Moore E. H., with the cooperation of K. W. Barnard, ”General analysis”, Part 1, Memoirs of the American Philosophical Society, Philadelphia, 1935. [5] Hunger Parshall Karen and David E. Rowe, ”The Emergence of the American Mathematical Research Community”, 1876–1900: Sylvester J. J., Felix Klein and E. H. Moore, American Mathematical Society, 1994. · Zbl 0802.01005 [6] Hamilton W. R., ”Elements of quaternions”, Longmans, Green, & co., London, 1866. · Zbl 1204.01046 [7] Herstein I. N., ”Topics in Algebra”, Xerox College Publishing, 1964. · Zbl 0122.01301 [8] Bourbaki N., ”Éléments de Mathématique”, Chap. 1 à 3, Hermann, Paris, 1970. [9] Knus M. A., A.S. Merkurjev, M. Rost and J.P. Tignol, The Book of Involution,Amer. Math. Soc. Coll. Pub.,44, 1998. · Zbl 0955.16001 [10] Cohn P. M., Skew Field Constructions, London Math. Soc.Lect. Notes Series No 27, Cambridge University Press, 1977. · Zbl 0355.16009 [11] Herstein I. N., Noncommutative rings, the carusMaths Monographs No 15, MAA, 1973. [12] Cohn P. M., ”Algebra”, Second Edition, vol. 2, John Wiley & sons, 1989. · Zbl 0703.00002 [13] Jacobson N.,Lectures in Abstract Algebra, III, Van Nostrand-Reinhold, 1964. · Zbl 0124.27002 [14] Morandi P. J., ”Lie Algebras, Composition Algebras, and the Existence of Cross Products on Finite-Dimensional Vector Space”, Expo. Math., à paraître. · Zbl 0976.17006 [15] Dyson F. J., Quaternion determinants,Helv. Phys. Acta 45, 289–302 (1972). [16] van Praag P., Sur la norme réduite du déterminant de Dieudonné des matrices quaternioniennes,J. Algebra 136, 265–274 (1991). · Zbl 0724.15013 · doi:10.1016/0021-8693(91)90047-C [17] Aslaksen H., Quaternionic Determinants,The Math. Intel. 18, No 3, 57–65 (1996). · Zbl 0881.15007 · doi:10.1007/BF03024312 [18] van Praag P., Les formes hermitiennes quaternioniennes et le déterminant d’Eliakim Hastings Moore,Bull. Soc. Math. Belgique, Sér. A42, 767–775 (1990). · Zbl 0731.15013 [19] Tignol J. P., Pfaffiens et Déterminant de E. H. Moore,Bull. Belgian Math. Soc., Simon Stevin,6, 537–539 (1999). [20] Lang S., ”Linear Algebra”, Second Edition, Addison-Wesley Pub. Company, 1971. [21] van Praag P., Une caractérisation des corps de quaternions,Bull. Soc. Math. Belgique,10, 283–285 (1968). · Zbl 0185.09003 [22] Jacobson N., Structure of rings,Amer. Math. Soc. Colloq. Pub.,XXXVII, (1956). · Zbl 0073.02002 [23] Cohn P. M.,Algebra, Second Edition, vol. 3, 1991. [24] van Praag P., Sur certains corps non commutatifs,Bull. Math. de la Soc. Sci. Math. de la R.S. de Roumanie, t. 14 (62), nr. 4, 451–453 (1970). · Zbl 0249.16010 [25] Tignol J. P.,Lettre à l’auteur, 25 août (1999).
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
# Electric Flux: Definition & Solved Examples

## Definition of electric flux:

Let us suppose a rectangular loop in direction of flowing water is placed such that the plane of the loop is perpendicular to the flow of water. Let $A$ be the area of the loop and $v$ be the velocity of the water.

In this case, the rate of flow of water through the loop, which is denoted by $\Phi$, is defined as $\Phi=Av$ where $\Phi$ is called the flux.

If the loop is not perpendicular to the flow of water so that it makes some angle $\theta$ with the flow, in this case, the flow is defined as $\Phi=A\left(v\,\cos\theta\right)$.

This is similar to the electric field. From electrostatic recall that the electric field due to a collection of charges is visualized by some lines which are called the field lines.

On the other hand, any imaginary closed surface has a unit vector perpendicular to it. This unit vector is called the normal vector.

The analogous to electric flux is the magnetic flux which is a measure of how many magnetic field lines pass through a surface.

Unit vectors in Cartesian coordinate are described on the page below with a couple of solved problems
Unit vector solved problems

The concrete method for finding the flux of electric field through any closed surface is as follows: Once the angle between $\vec E$ and normal vector $\hat n$ to the surface of area $A$ is $\theta$, it is sufficient to multiply the electric field due to the existing field lines in the closed surface by the area of the surface.

Since the electric field is not uniform across the whole surface so one can divide the surface into infinitesimal parts which are called the area elements $dA$.

Now that the electric field across this infinitesimal element is rather uniform by multiplication of $\vec E$ and $d\vec A$, where $\vec A$ is the vector area of the surface and summing these contributions we can arrive at the definition of electric flux \begin{align*} \Phi_E &\approx \vec E_1 \cdot \Delta \vec A_1+\vec E_2 \cdot \Delta \vec A_2+\cdots+\vec E_n\cdot \Delta\vec A_n\\&=\Sigma\vec E_i\cdot\Delta \vec A_i\end{align*} In the limit of $\Delta A \rightarrow 0$, this discrete and approximate sum goes to a well-defined integral.

The mathematical language is as follows $\Phi_E=\int_S{\vec E\cdot \hat n d\vec A}=\int_S{\vec E\cdot d\vec A}$ Dot denotes the scalar product of the two quantities.

The right-hand side of the above, which is called the surface integral, in cases that the desired surface and/or electric field varies arbitrarily is a hard task to compute.

The calculation is straightforward when the charge distribution is totally symmetric since in this case, one can choose simply a suitable surface.

#### Summary:

The number of electric field lines that pass through any closed surface is called the electric flux which is a scalar quantity.

## Electric flux solved examples

In the following, a number of solved examples of electric flux are presented. More simple problems including flux of uniform or non-uniform electric fields are also provided.

Example (1): electric flux through a cylinder.

Suppose in a uniform electric field a cylinder is placed such that its axis is parallel to the field.

To compute the flux passing through the cylinder we must divide it into three parts top, bottom, and curve then the contribution of these parts to the total flux must be summed.

On the top and bottom sides, the unit normal vectors are $\hat k$, $-\hat k$, respectively. Let $\vec E$ be toward the $z$ axis i.e. $\vec E=E\hat k$.

Scalar products of top and bottom sides by electric field make the total flux since the normal vectors and $\vec E$ are parallel ($\theta =0$) and antiparallel ($\theta=180^\circ$), respectively.

The curve side has a normal vector in the radial direction which makes a right angle($θ=90^\circ$) with $\vec E$ so its contribution to the flux is zero. \begin{align*} \oint{\vec E\cdot \hat n dA}&=\int{\vec E_1\cdot\hat k dA_1}+\int{\vec E_2 \cdot \left(-\hat k\right) dA_2}\\ &+\int{\vec E_3 \cdot \hat r dA_3}\\&=E_1 A_1 -E_2A_2\end{align*}

$E_1$, $E_2$ and $E_3$ are the amount of electric fields passing through the surfaces. Since the electric field is uniform one can factor it out of the integral.

$A_3$ is the area of the curved side which is $2\pi Rl$. The electric field lines don’t pass through the curved sides and only penetrate top and bottom which in this case their amounts are the same $E_1=E_2$.

Therefore, the total flux through the cylinder is simply $\Phi_E=0$
This result is expected since the whole electric field entering the bottom side exiting the top surface.

#### Example (2):

A hemisphere of radius $R$ is placed in a uniform electric field such that its central axis is parallel to the field. Find the electric flux through it?

#### Solution:

Let the electric field be in the $z$ direction i.e. $\vec E=E_0 \hat k$. The normal vector to the hemisphere is in the radial direction so $\hat n=\hat r$. Further, the area element of a spherical surface of a constant radius in the spherical coordinate is $dA=R^{2}\,\sin\theta\, d\theta d\phi$.

Therefore,
\begin{align*}\Phi_E&=\int{\vec E\cdot \hat n\,dA}\\&=\int{\left(E_0\hat k\right)\cdot \hat r R^{2}\,\sin \theta d\theta d\phi}\end{align*}
No we must find the scalar product of $\hat r\cdot \hat k$. In spherical coordinates we have the following relation for the unit vector in the radial direction:
$\hat r=\sin \theta \cos \phi \, \hat i+\sin \theta \sin \phi \, \hat j+\cos \theta \, \hat k$
Where $\hat i,\hat j,\hat k$ are the usual unit vectors in the Cartesian coordinates. Thus
$\hat r\cdot \hat k=\cos \theta$
Where we have used the fact that $\hat i\cdot \hat k=\hat j\cdot \hat k=0$ and $\hat k\cdot \hat k=1$. Putting everything into the electric flux relation, one can obtain
\begin{align*}\Phi_E&=E_0R^{2}\int_0^2\pi{d\phi}\int_0^{\pi/2}{\underbrace{\cos \theta \sin \theta}_{\frac 12 \sin 2\theta}d\theta}\\&=E_0R^{2}\left(2\pi\right)\frac 12\left(-\frac 12\,\cos 2\theta\right)_0^{\pi/2}\\&=\pi E_0R^{2}\end{align*}

#### Example (3):

consider a planar disc of radius $12\,{\mathrm cm}$ that makes some angle $30^\circ$ with the uniform electric field $\vec E=450\,\hat i\,\mathrm {(N/C)}$. What is the amount of electric flux passing through it?

#### Solution:

Let the electric field be in the x-direction and normal to the plane be in some direction $\hat n$ which must be decomposed into the $x$ and $y$ directions, as shown in the figure. Using the definition of electric flux, we have
\begin{align*} \Phi_E&=\int{\vec E\cdot \hat n dA}\\&=\int{E_0\hat i \cdot\left(\cos 60^\circ\,\hat i+\sin 60^\circ \,\hat j\right)dA}\\&=E_0\,\cos 60^\circ\int{dA}\end{align*}
Where the integral over $dA$ is the area of the disk which is $\pi R^{2}$. Therefore
\begin{align*}\Phi_E&=E_0\left(\frac 12\right)\left(\pi R^{2}\right)\\&=(450)\left(\frac 12 \right)\pi (0.12)^{2}\\&=10.17 \quad \rm {\frac {N\cdot m^{2}}{C}}\end{align*}

Another method for finding electric flux due to systems with high symmetry is to use Gauss's law.  You can also learn this elegant method with some simple problems.


text:
# Primes of Form n^2 + 1

## Sequence

The sequence of prime numbers of the form $n^2 + 1$ begins:

$2, 5, 17, 37, 101, 197, 257, 401, 577, 677, 1297, 1601, 2917, 3137, 4357, 5477, \ldots$

These correspond to values of $n$ beginning:

$1, 2, 4, 6, 10, 14, 16, 20, 24, \ldots$


text:
Saturday, July 23, 2011

a,b,c fraction integer

Given positive integers $a,b,c$ such that
$$\frac{a}{b} + \frac{b}{c} + \frac{c}{a}$$
is also an integer, show that
$$\frac{a^2b^2}{c},\frac{b^2c^2}{a}, \frac{c^2a^2}{b}$$
are all cubic numbers.


text:
# Successor Representations

Successor representations were introduced by Dayan in 1993, as a way to represent states by thinking of how “similarity” for TD learning is similar to the temporal sequence of states that can be reached from a given state.

Dayan derived it in the tabular case, but let’s do it when assuming a feature vector $\phi$.

We assumes that the reward function can be factorised linearly: $$r(s) = \phi(s) \cdot w$$

This can then be inserted back into the value expectation formula: $$\begin{array}{rl} Q^\pi(s, a) &= E \left\lbrack \sum_{t=0}^\infty \gamma^t R(s_t) ~|~ s_o = s, a_0 = a \right\rbrack \\ & = E\left\lbrack \sum_t^\infty \gamma^t \phi(s_t) \cdot w ~|~ s_0=s, a_0 = a \right\rbrack \\ & = E\left\lbrack \sum_t^\infty \gamma^t \phi(s_t) ~|~ s_0=s, a_0 = a \right\rbrack \cdot w \\ & = \psi^\pi(s, a) \cdot w \end{array}$$

$\psi^\pi$ represents the Successor features, and does not depend on the rewards. It also represents a partial model of the world / occupancy of the states given the behaviour policy.

$w$ represents the rewards or the goal, and can be thought of as preferences about the given features $\phi(s)$ in a given task.

Assuming that the features $\phi(s)$ are good and consistent across a domain, we can imagine transfering to new tasks really quickly, as we simply need to learn new goal vectors $w$.

In Dayan’s case, the features $\phi(s)$ were directly the one-hot occupancy of a tabular state-space. This means that the successor features directly corresponds to the visitation counts under a policy. This is not as simple in more complex scenarios or when we want to learn $\phi$.

One important observation, also mentioned in passing by Dayan, is that one can rewrite the definition of the successor features $\psi$ using the Value expectation formula, obtaining independent Bellman updates for every components of $\phi$:

$$E\left\lbrack \sum_t^\infty \gamma^t \phi_i(s_t) ~|~ s_0=s, a_0 = a \right\rbrack$$

$$= E\left\lbrack \phi_i(s_t) + \gamma \psi_i(s_{t+1}, a^\star) - \psi_i(s_t, a_t) ~|~ s_0=s, a_0 = a \right\rbrack$$

In other terms, the features $\phi(s)$ behave as the rewards in a Bellman update, where $\psi(s, a)$ takes the role of the Q-values.

## References

• Peter Dayan, “Improving generalization for temporal difference learning: The successor representation”, Neural Computation, 5(4):613–624, 1993. pdf


text:
# How can I have a corrupt meritocratic government without it being perceived as such?

I like to play with superlatives. I want a government that pretends to be rightly-guided by the most sacred morals and ideals, but in reality is filled with fat cats who only care for themselves. However, the people must not know about it; they know about corruption in other countries, and the clear majority of people truly believe that their country is above that. So how far can I go in my government's corruption?

Background

The general era is something we would recognise as the 15th-16th century. There's steel and gunpowder, but no steam power. There's a literary tradition stretching back a thousand years, but few people are literate. There are religious beliefs but they are not part of the state; in its place is a state philosophy that might as well be a religion. People are steadily growing sceptical of said philosophy, but for now the government (while ostensibly encouraging critical thinking) suppresses diverging thought, passing it off as misguided and/or dangerous.

The ideal

The government, ruling over a hundred million people of many different cultures in a nation the size of Kazakhstan, works on the basis of the following philosophy: rule is only by the virtuous, and every virtuous person will end up ruling. There's imperial exams taken by every young man and a few bright women (the society is still quite sexist), and those with the best results will end up with roles in the bureaucracy. There's layers upon layers of bureaucrats that report to one another, and at the very top is a council of 52 supreme officers, along with a supreme emperor whose only political power is appointing and dismissing those officers (and giving them supreme moral guidance). The position of supreme emperor is for life, but not hereditary; when one dies, the successor is whoever got the very best score in next year's imperial exams, from a different province in the country (rotating between all the provinces).

Now a lot hinges upon the fairness of these exams, so one of the lowest positions in the bureaucracy is overseeing them. That means that the turnover rate is high among the examiners, so there's little opportunity for corruption to take root there.

Every political position of meaning is part of the bureaucracy; hereditary power transfer is virtually non-existent. Outside the state, power structures exist in the form of religious institutions, and private commercial enterprises. But the church is not quite an authority; the state philosophy is religiously pluralistic and states that all gods live together in one pantheon, leaving open which one is the head god (if any). And this is long before corporations became the lobbying influence we have today; a few figures like Jakob Fugger exist but most businesses are small and family-owned.

Practise

That's the theory. Everything stated in the previous section is either accurate or popularly perceived as such. So where can I add corruption? The easiest place is among the bureaucrats. There's so many layers and departments, and people from layer n are generally appointed and dismissed by those from layer n+1. They all socialise with one another so they can get an idea of which of potential candidates for a position would be susceptible to take bribes, and then only promote those people; effectively shutting the true idealists out of the administration beyond a certain layer. Impeachment procedures are rare since people in higher stations are assumed to be more virtuous.

But I want to go beyond that. I am looking for the most effective methods by which the highest officials can evade all scrutiny and turn their backs on the doctrine of virtue deciding position. I want ways to maintain the illusion of social mobility, compatible with the state as described, that allow for large-scale embezzlement and self-enrichment by the powerful.

Take this in a society that is not democratic and without mass media, but also not a totalitarian government that can just make people disappear and it lacks means of communication faster than a horseback courier. How corrupt can I make the country, while everyone still believes that it is not corrupt; and in what ways?

Concrete question

What measures can the government officials and powerful people in general take in this country, to disproportionally enrich themselves, without people at large perceiving their country as corrupt, given the society and history as described? Average citizens who are not closely involved with politics should be able to reasonably think that their leaders are really virtuous and not at all enriching themselves.

• Possible real-world inspiration: The Catholic Church. Nov 12, 2020 at 14:25
• @Philipp Could you elaborate? Nov 12, 2020 at 14:27
• It's an organization which maintains the appearance to be based on virtue (it's literally their brand) and being a meritocracy, but they are very good at keeping scandals under cover. And it is an organisation which is even larger than the administrations of many countries. Nov 12, 2020 at 14:28
• "perceived as such" part makes this very opinion-based. Nov 12, 2020 at 17:33
• @KeizerHarm we may be going a little off-topic here, but the downfall of Catholic Church in several countries in the early XVI century could be in part attributed to "Ninety-five Theses" distributed with the use of printing press. Nov 12, 2020 at 19:55

Unclear Rubrics

The way to check if an exam is corrected fairly is using a rubric. This says what the correct answers are, and exactly what you need to write to get full marks. This lets the marker justify their scores and lets unhappy examinees appeal with some degree of rigor. When I am unhappy with my score I point to the rubric and say "I lost marks for X but it wasn't in the rubric!".

The way to corrupt an exam is by having either no rubric, so the marker can just make up reasons someone got full marks after seeing their script. Or you have a rubric that is so vague they you can do the same.

I suggest there be several layers of increasingly vague rubrics. For example for the essay question Rubric #1 is basic spelling and grammar. #2 is basic reasoning skills, and so on until #10 is something like

Moral character conducive to the proliferation of life, liberty and the pursuit of happiness for all citizens of this great country under God.

Extra points for overblown language.

Rubric #1 is employed by level 1 bureaucrats. They chuck out anyone with bad spelling and grammar, and pass the good scripts upstairs to where level 2 bureaucrats apply Rubric #2. The first few levels work well and ensure the bureaucracy is filled with competent people. It also gives the impression the system is fair, since most people only see the first few levels.

Level 10 exams are rare, since you have to pass exams 1-9 to even sit level 10. Every level 10 exam is marked by the emperor. There is so much room for interpretation about what "moral virtue" means that the rigor disappears and the emperor can appoint whoever they want.

There is also an option to skip the first few levels of assessment if a sufficiently virtuous candidate is found. This is the story when the Chancellor's deaf-mute second cousin the in-law gets appointed Minister of Agriculture. After all, you can teach spelling and grammar but you cannot teach being a good person.

From then on we have the usual problem that no one ever sees the Minister on the street and all their public engagements are highly choreographed for maximum virtue signalling. There is no way for the common man to figure out on their own if the Minister is corrupt or not.

There might still be a basic literacy requirement. I don't think this is a problem. It certainly lines up with the real world where corrupt people in power have to be (a) smart enough to get into power and (b) smart enough to not seem corrupt.

• Sounds good, with the vast majority being righteous and perceived as such, with only the "Top-Scoring" cadets having potential to rise up and only them being affected by the corruption. Nov 12, 2020 at 14:18
• Good solution for corrupting exams. Though makes me wonder how many level 10 examiners are out there to review the millions of exams turned in each year - unless you reserve the higher levels for those already in the bureaucracy, and make them take more complicated (and fuzzy) exams before every potential promotion. Nov 12, 2020 at 14:28
• Is “conman man” a slip of the keyboard or a statement on society?? Nov 12, 2020 at 14:46
• @KeizerHarm The idea is you sit a level 1 exam, and it's marked by other level 1 people. If you pass you get to sit level 2 and that's marked by level 2 people. And so on. The number of potential markers goes down, but so does the number of exams to correct. Nov 12, 2020 at 16:07
• @JoeBloggs Typo I'm afraid. Nov 12, 2020 at 16:07

Education. Private tutors etc rigorously prepare the children of high-ranked members to score as highly as possible on the tests. They know what the expected "correct" answers will be and the tests vary little from year to year so practicing on prior papers is very effective. Note they don't learn anything useful. Just how to ace the exams.

Combine this with a bit of "leaning" on people to go easy or hard on the correct candidates. This gives you hereditary power that over time concentrates in a few families no matter how competent or not individual members are.

Daron's answer already covered vague exams. Take a look at this for a real world example of just how corrupt these things can be: https://metro.co.uk/2017/09/20/could-you-pass-this-test-given-to-black-people-registering-to-vote-in-america-in-1964-6941338/

As to the perception thing, that's easy. You keep the corruption to the higher levels and dress everything up. You control the media, the police, the intelligence services.

Anyone accusing you of corruption is a seditious traitor and needs to be "sent away for re-education".

• Sheesh, that article horrifies me. Nov 12, 2020 at 14:54
• @KeizerHarm One reason I shared it is more people need to know about it. That stuff was real and in use only 60 years ago. People are alive today who were involved in overturning it....and in implementing it. Some of the people who wrote and administered those exams are still alive and voting in the USA... Nov 12, 2020 at 14:56
• But it's a good answer, except for the bit "media, police, and intelligence services". This is a pre-industrial era, there's no media (no printing press), police system is unorganised, and intelligence services not nearly as powerful as the modern equivalents. Also I don't think re-education camps are a thing when the state can't be totalitarian enough. Nov 12, 2020 at 15:18
• @KeizerHarm "media" takes many forms. No printing press but you do have bards, storytellers, legends and ballads. You have monuments, statues, paintings, even buildings and place names. You have announcements and town criers. Nov 12, 2020 at 15:48
• On the other hand I agree that informers, police, spies, etc. may not be as organised or centralized, but they do exist and will generally act to protect authority. Nov 12, 2020 at 15:49

### Require collateral to enter or advance in the bureaucracy.

Serving the people isnt just a job for our committed public servants, but a promise and a commitment to the doctrine of trust and loyalty. Everyone who wants to join this wonderful institution needs to offer some asset as collateral in return for their service and loyalty to their branch of the government.

Externally - "every member of the government has given the deed to their house as collateral in case they cheat or steal from us, I wouldnt steal in this case so our government is obviously very virtuous!"

Practically - whistle blowing is disloyalty to your boss, so any jealous employee trying to smear their boss for selfish reasons obviously will lose their collateral. This should be made very clear on orientation. They'll die homeless and hungry if they cast the government in a bad light, and it will only embarrass their boss or bosses boss at most.

Advancing in the bureaucracy requires more collateral, if you have no more wealth, you need to share a family secret, something worth blackmailing you over (eg a signed letter that your brother confessed to cheating on his partner, true or not, or a detailed account of how your father swindled huge wealth from the masses. Anything embarrassing. Make it up if you need to.) and give that as collateral. It's needed for any promotion. It's to ensure your loyal to your government.

Each promotion requires new information more scandalous than the last.

By the time you get to the upper rungs of the corruption, you've signed letters stating your spouse is kidnapping and eating children, you father burnt down churches, and your children were gifts from satan. Your superiors have so much dirt on you they could get your former friends to burn your entire family at the stake. Any allegations of corruption by a whistleblower can be met with enough evidence to brutality destroy the families reputation enough to dismiss or bury the allegations.

So long as the masses are fed and sheltered and entertained - you could take everything else of value for yourselves.

• I like the idea, but wouldn't the confession system break down trust in government as soon as people are ousted for it? Rule is by the virtuous: if any homosexual, cheater or swindler did end up in high ranks, then the system has already failed. Nov 12, 2020 at 15:59
• @KeizerHarm they'd be caught at the lower levels, because the higher you go, the less likely you are to betray the system. That they were caught can easily be spun as the system working to expose cheats. This is basically the technique nxvm and scientology used.
– Ash
Nov 12, 2020 at 16:03
• @KeizerHarm actually on further thought the nxvm blackmails were family first, then personal. That's probably a better fit here anyway for the reason you gave. I've edited.
– Ash
Nov 12, 2020 at 16:08

Corruption is the merit.

You know, that might be the answer - to act boastfully about something we ought to be ashamed of. That's a trick that never seems to fail.

-- Catch-22

Merit is not, despite the ideal of a meritocracy, some natural, physical constant that can be determined empirically. The government, through culture, media, education, religion, and tradition, determines what is meritorious. Philosophers talk about government virtues or they get put on the banned list. Poets who want the aristocracy to support them flatter them. Teachers and preachers uphold the traditional ideals or else the community will turn on them as renegades.

So there's no need for the merit your meritocracy measures to be the merit we, the readers, would expect or want them to measure. Maybe merit is a measure of how much money you can bring in (and never you mind where it comes from), or how much your farms and workshops can produce in a year. Maybe merit is a popularity contest, and your people think of buying votes through bread and circuses to be meritorious (after all, it makes people happy). Perhaps your definition of merit is ideological purity, or loyalty to a ruling party, or to God.

The key is that, in addition to rigorously testing officials, the meritocracy also vigorously pushes its idea of merit onto the population.

• They keyword is that your income measures your "CONTRIBUTION TO SOCIETY". Nov 12, 2020 at 18:16
• That is really creative, I like it. It only becomes a bit difficult when this country feels so elevated above its neighbouring countries precisely because those countries are "totally corrupt" which the empire "most certainly isn't". So the merit of corruption needs to be specific to the empire; when other countries do it it's a sin. Nov 13, 2020 at 8:09
• @KeizerHarm "Corruption" is a pretty broad term. (Are we talking about graft? Nepotism? Favoritism to a particular group? Backroom deals between power brokers?) It wouldn't be hard to draw a distinction between two practices where we would both see as corrupt, but your nation preaches that one is virtuous and the other not. Nov 13, 2020 at 9:18
• @Cadence You're right. My vision was focused on the self-enrichment and the literal corruption of the values of merit = right; but that can be done through many different ways, some of which may still be compatible with the state philosophy. Nov 13, 2020 at 10:07

## How Should Corruption Be Quanitified?

To measure how corrupt a government can get, and compare it to different measurements, I think we need a way to quantify corruption. I think this approach might work : what % of resources (quantified as GDP), allocated to be spent on public good, actually makes it to that work.

So, for some examples : out of every \$1,000 allocated to schools, only \$10 makes it to the teacher's salary - the government is $$1 - ({10 \over 1000})$$ = 99% corrupt.

## With That In Mind, There Are Some Obvious Ways to Scale This

There is a joke about corruption -- a bureaucrat is charged with repairing a road. He gets two bids : the first bidder asks \$100 to do the job. The second bidder asks \$1,100 to do the job. The bureaucrat asks the second bidder why he's so high. The 2nd bidder says : \$500 for you, \$500 for me, and \\$100 to hire the first bidder.

There exists, I believe, a minimum cost to provide public services. But government and contractor peers can charge any amount of premium on top of that. The bigger the ledger of acquisitions becomes, the harder it is to scrutinize any one particular transaction, and the harder it becomes to prove that a single proven case of corruption is systemic, instead of an outlier.

At any given year, the government needs to appear to be delivering the same amount of service. So, for a while you can increase corruption by increasing the amount of resources you allocate from the people (taxes + inflation) : increasing the cost of the government's services, without providing any new service.

You can get creative with how you tax the people : income taxes are most obvious. Less obvious are sales taxes, head taxes, property taxes, tolls, rents, fees, or inflationary spending (printing extra money - the people who can't get themselves a raise to offset the diluted purchasing power of the money are, in a way, the one's paying a tax -- usually the poorest people).

Taxing the people has a peak upper limit where nearly all of society is working all their waking hours to earn, after taxes, just barely enough to keep them healthy enough to work tomorrow.

## Managed Decline

After taxes have peaked, government can then gradually reduce the service being provided. As long as service reduction is in tiny increments, it's not shocking enough to cause people to clearly motivate people to seek a life somewhere else.

You can make small substitutions : cheapen labor costs for the services you provide by outsourcing jobs, side-stepping your own environmental laws by getting your services from countries with no such laws, cutting non-administrative staff, rationing

## Extremes

Between raising taxes and gradually reduced services, a government can easily hit 100% corruption.

First, maybe we need to change our scale, since really corrupt governments are going to be between 99.9% and 100% corrupt. Let's just count the number of nines after 99% for these extreme cases. A 99.9% corrupt government is 1C. A 99.99999% corrupt government is 5C.

Maybe we need a different metric for really corrupt governments : percentage of potential GDP trickling down to the people, where potential GDP (pGDP) includes off-the-books activity like building your own wagon, farming, mending clothes, and so on. How much bigger than GDP is pGDP? You can press all working-age adults into service for about a 60% increase; press traditional home keeping roles into service, for another 100% increase, so pGDP $$\approx$$ 2.6 $$\times$$ GDP

There's a limit. People have minimal requirements : enough food (2,000 calories per day) to keep going, some water, sleep (about 8 hours per day), and housing. Land costs nothing for a government that can seize it, so the real minimum requirement is whatever it costs for 2,000 calories and the lost labor of 8 hours of sleep (33% of a 24 hour day). And government corruption is = $$1 - ({servicesprovided \over pGDP})$$. If a government provides nothing of value, let services provided = 1

## Trying It Out

Let's assign a value of GDP, so that we can look at some numbers. Let's say our corrupt government has a GDP of 1 million Generic Currency Units (GCU).

A totally corrupt government, providing nothing of value, forcing all able-bodied people to work 40-hour weeks (23% of 7 $$\times$$ 24-hour days), and taxing all of that effort through various means is $$1 - ({1 \over {0.23 \times 2.6 \times 1,000,000}}) =$$ 99.999% (3C) corrupt.

A less corrupt government, allowing the young to go to school and the old to retire, and allowing the people to keep their cultural traditions of half the workforce staying at home to take care of the young and old, but still taxing everything out of a 40-hour work week is $$1 - ({1 \over {0.23 \times 1,000,000}}) =$$ still 99.999% (3C) corrupt.

## Limits

A government requiring all able-bodied people to work all waking hours (16 $$\times$$ 7 = 112) (66% of the week) for the government's benefit and receiving nothing in return is $$1 - ({1 \over {0.66 \times 2.6 \times 1,000,000}}) =$$ 99.9999% (4C) corrupt.

Once people start starving to death, or dying because they fell asleep at the grinder, rebellion isn't far away.

I would suggest 4C is as corrupt as any government can become, by any means, before things fall apart. At 4C corruption has become so bad that people are literally being worked to death and getting no benefit or relief from their rulers. I believe this is a hard limit because even if the populous still believes in the government, they are ceasing to exist due to malnutrition and exhaustion.

There’s a television show, ‘Poldark’ that attempts to demonstrate these conditions in 1770s Britain.

## Meritocratic Governments are VERY easy to corrupt

As a general rule, people who want power will gravitate to where power exists unless some force prevents them from doing so. In the case of democracies and monarchies, the most power hungry members of society are prevented from rising up to the top echelons of power by the electoral process or line of succession respectively. However, any government that allows its members to self-select is much less resistant to corruption because instead of using a system designed to filter corruption out, you have a system designed to filter corruption in.

In a meritocracy, the question always boils down to "How do you define Merit". Because this question is answered by the Government, the answer always eventually transitions to "Whoever the government says has Merit."

Because the government decides who is worthy to be a member, existing members will typically select new members based on who will be the smallest threat their own power rather than who can actually do the job best. So if you are a slightly corrupt leader, you will need to bring in new members who are at least as corrupt as you to make sure that they don't whistleblow you. This creates a sort of natural selection scenario where fitness is defined by a thirst for power and lack of ethics. So, the kinds of unethical things the government is willing to will perpetually grow, but never shrinks.

This kind of Corruption can be see in the Roman Praetorian Guard where after just a few generations of letting Praetorians hand pick whoever they deemed the best of the best, they were extorting the government for salaries and bonuses worth over 20 times a normal soldier's pay, they were assassinating their own emperors and manipulating the line of imperial succession, and basically doing whatever the heck they wanted because they all agreed that they could... and this is just what can happen when a small subsection of your government practices hand-picking new members.

## But It Won't Last Long Enough For The General Population to Notice

In the 15th-16th Century, most people had very little idea about what happened outside of their own little town or neighborhood, but as much as there was less technology for spreading information, there was also less technology for spreading misinformation; so, what is "true" in this world is whatever you are told by another human being... and the only way to find the truth between two conflicting people is to have a system for defining who is more trustworthy.

So, if we replace late medieval Feudalism with a Meritocracy without changing any other cultural or technological elements, what you will see are things like the code of chivalry and the divine right of rulership come into play. The code of chivalry says that people of noble birth have an extra duty to be honest in all things; so, in this world, your leaders will be expected to be chivalrous, and the people they select will be expected to be able to follow the code of chivalry. Then the divine right of rulership says that God himself guides the succession of rulers; so, if a person is promoted to be a member of the government, then this is the will of God and is therefore beyond contestation.

With these factors in place, anything a ruler says is true, and anything a commoner says otherwise must be a lie because commoners are not bound by chivalry and they are not chosen by the will of God, and even if a leader does get caught in a lie, you still can not oppose him without risking your immortal soul by contradicting the will of God who gave them rulership.

In short, the government will become perpetually more corrupt, but never so corrupt that a significant number of people will be willing to question or oppose it. Instead what will happen is that the government will eventually select members who are so motivated by power and care so little about ethics that the leadership itself will be the government's undoing. Instead of selecting new members to bring in, someone will eventually rise up who will want to be the nation's undisputed monarch at which point there will be some manner of civil war or extermination of political opponents followed the dismantling of the meritocratic system all together.


text:
# Homework Help: Are these subspaces a vector space?

1. Mar 26, 2012

### spaghetti3451

1. The problem statement, all variables and given/known data

Consider the ordinary vectors in three demensions (ax, ay, az) with complex components.

a) Does the subset of all vectors with az = 0 constitute a vector space? If so, what is its dimension; if not; why not?

b) What about the subset of all vectors whose z component is 1?

c) How about the subset of vectors whose components are all equal?

2. Relevant equations

A vector space satisfies the following properties:

1. the sum of any two vectors is another vector.
2. vector addition is commutative and associative.
3. there exists a zero vector.
4. for every vector, there is an inverse vector.
5. the product of a vector with a scalar is another vector.
6. scalar multiplication is distributive w.r.t. vector addition and w.r.t. scalar addition
7. sclalar multiplication is associative w.r.t. mulitiplication of scalars.

3. The attempt at a solution

a) Yes. Dimension = 3.
b) No
c) Yes

What do you think?

Last edited: Mar 26, 2012
2. Mar 26, 2012

### sunjin09

a) dimension is not 3

3. Mar 26, 2012

### Bacle2

Is your vector space over the complexes, or over the reals?

After that, there are results to tell whether a subset is a subspace, that will simplify things.

4. Mar 26, 2012

### Alpha Floor

a) Yes, but dimension is 2
b) No
c) Yes, dimension = 1

I like to think of subspaces as planes or lines, like this:

The subset of all vectors (x,y,z) with z=0 is the x-y plane. This plane contains the origin, thus it is a subspace of R^3. It's dimension is 2 because you only need 2 coordinates (x and y) to determine the position of any given point.

The subset of all (x,y,z) with z=1 is a plane parallel to the x-y plane, but passing through z=1. This plane does not contain the origin, thus it is NOT a vector subspace of R^3

The subset of all (x,y,z) with x=y=z is a line that passes through (0,0,0) and (1,1,1). It contains the origin -> it is a subspace. Its dimension is 1 because with only one parameter you determine the position of any point on the line.

5. Mar 26, 2012

### spaghetti3451

I can see why you first work out whether the origin is in the subset. It's because a vector space must have a zero element. The other conditions are trivially staisfied by the subset, so I guess that's why you don't bother to check them.

Anyway, my problem is with the part where you explain how you get the dimension of the subspace. It is intuitively obvious what the dimension has to be when you consider lines and planes in cartesian coordinates. But I have been reading on the subject lately and I have seen that the dimension of a vector space equals the number of basis vectors needed to span that space. Now, in geometric terms, obviously you need two basis vectors for a plane. But, in algebraic terms, there is the unit vector for ax, one for ay, and why shouldn't there be one for az even if it's zero?

By the way, thanks for the explanation.

6. Mar 27, 2012

### Alpha Floor

Exactly

That definition is completely right, the dimension of a subspace is the number of vectors needed to form a basis.

In order to understand the concept of dimension you have to distinguish between "basis" and "generating system" (if that last term is a correct translation from spanish, if not, just substitute from now on by the correct expression) of a vector subspace.

A generating system of a vector subspace is any set of vectors, which by linear combination can "generate" the whole vector subspace. This means that any vector of the subspace can be obtained by linearly combining the vectors of the generating system, let me put an example:

For example: In vector space R^4, the set S={(x,y,z,w); w=0} is a vector subspace (actually it's the same as R^3 just with an additional 0).

Now consider the set G={ i=(1000),j=(0100),k=(0010),m=(1110),n=(0110),p=(1010) }. Notice that ANY vector of S can be obtained as a combination of the six vectors i,j,k,m,n, p. Vector v=(2,3,1,0) can be put as v=2·i + 3·j + 1·k + 0·m + 0·n + 0·p, but it can also be put as v= 1·i + 2·j + 0·k + 1·m + 0·n + 0·p, in fact, there are infinite combinations of the vectors of G that can generate vector v. We've seen that G is a special set, it has the ability to generate the entire subspace S, therefore it is called "generating system" to remark its magnificent power.

You've intuitively noticed that while G is a perfectly valid "generating system" it is somewhat "dumb". Certainly, if you eliminate vectors m, n, p the remaining i, j, k are still a generating system because you can still combine them in such a way to generate ANY vector of S. Let's do so and call B= { i, j, k } , generating system of S.

¿What is the difference between B and G, both being generating systems of the subspace S?

The difference between them is that G contains REPEATED INFORMATION and B doesn't. You CANNOT eliminate any vector of B and still have a generating system, while you CAN eliminate vectors of G and still have a generating system. In linear algebra, to express this idea quicker, we say that the vectors of G are "linearly dependent" while the vectors of B are "linearly independent".

A generating system which contains the minimum number of vectors (they are all linearly independet) is called a BASIS. Any basis is a generating system, but not any generating system is a basis. It must be clear that there is an infinite amount of BASIS for a given vector space (or vector subspace), not just one. If B= { (1000) (0100) (0010) } is a basis of S, then B* = { (1110) (0100) (0010) } is also a BASIS, and they are both equally valid.

Now we can define the dimension of a vector space: The dimension of a vector space (or subspace) is the minimum amount of linear independent vectors you need in order to form a generating system, or quicker, the dimension is the number of vectors of any basis of the vector space. In our example, the dimension of S is 3, because B contains 3 vectors.

Does this answer your question? From what I've said you can prove why (ax, ay, az) with az=0 is a vector subspace of dimension 2.

Last edited: Mar 27, 2012
7. Mar 30, 2012

### spaghetti3451

Thank you so much! That was a very well-explained answer. Hats off to you for explaining the idea so clearly and beautifully! Really, you are an exceptional teacher!

8. Mar 31, 2012

### Alpha Floor

I'm very glad that my explanation was useful to you.

It seems that my explanation was "too good" because I've received a warning from "micromass" for doing your homework. Next time my explanations will be worse in order to make things less clear. I tried to reason that I don't consider my answer to be against forum rules, but without any answer on his behalf.


text:
# Python Machine Learning for Data Generation

I am trying to learn machine learning with Python for a specific application to see if it's doable, right now it's just an idea. The goal is to generate or improve meshes for CFD simulations using ML, or DL, or whichever you recommend me.

The problem is that I found a lot of information about these things but mainly for classification, identification, prediction, and those kinds of things, but I couldn't find information relevant to my problem.

For example, I have this input data:

##INPUT##
# 2 blocks on each cartesian direction (x,y,z)
blocks = (2, 2, 2)

# points that define the limits of the geometry (vertices of a square in this case)
extremes = [(-1, -1, -1),
( 1, -1, -1),
( 1,  1, -1),
(-1,  1, -1),
(-1, -1,  1),
( 1, -1,  1),
( 1,  1,  1),
(-1,  1,  1)]

with this info, I can generate this mesh (using the blockMesh tool from OpenFOAM).

blockMesh generates a set of files, that I have parsed. The output is something like this:

points=[[-1., -1., -1.],
[ 0., -1., -1.],
[ 1., -1., -1.],
[-1.,  0., -1.],
[ 0.,  0., -1.],
....
]

faces = [[ 4.,  1.,  4., 13., 10.],
[ 4.,  3., 12., 13.,  4.],
[ 4.,  9., 10., 13., 12.],
[ 4.,  4., 13., 14.,  5.],
[ 4., 10., 11., 14., 13.],
......
]
neighbour = [1, 2, 4, 3, 5, 3, 6, 7, 5, 6, 7, 7]
owners = [0, 0, 0, 1, 1, 2, 2, 3, 4, 4, ...]

and then I can create the files again with this info.

This is pretty much what I want to do, so I hope someone can recommend something to me. Even if the recommendation is to leave it and do something else. I hope not :-D


text:
Lemma 35.28.2. The property $\mathcal{P}(f)=$“$f$ is locally quasi-finite” is étale local on the source.

Proof. We are going to use Lemma 35.23.4. By Morphisms, Lemma 29.20.11 the property of being locally quasi-finite is local for Zariski on source and target. By Morphisms, Lemmas 29.20.12 and 29.36.6 we see the precomposition of a locally quasi-finite morphism by an étale morphism is locally quasi-finite. Finally, suppose that $X \to Y$ is a morphism of affine schemes and that $X' \to X$ is a surjective étale morphism of affine schemes such that $X' \to Y$ is locally quasi-finite. Then $X' \to Y$ is of finite type, and by Lemma 35.11.2 we see that $X \to Y$ is of finite type also. Moreover, by assumption $X' \to Y$ has finite fibres, and hence $X \to Y$ has finite fibres also. We conclude that $X \to Y$ is quasi-finite by Morphisms, Lemma 29.20.10. This proves the last assumption of Lemma 35.23.4 and finishes the proof. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).


text:
# Determining a point that reached another point

I have two points, one is moving and one is stationary. I would like to know if the moving point has reached that point or not. I tried to calculate the distance between two vectors and the distance never reaches 0.

• It will likely never be exactly equal to 0, especially if you're using floats. Pick a minimum distance and check to see if the distance in less than that minimum. Oct 14 '12 at 20:33

You have one of these problems:

• a point doesn't even try to reach another point, and in 3D world it's very unlikely that two points hit each other (just like it's unlikely that one of hundreds of live threating comets will actually hit Earth)
• the point has velocities set to reach another point, but another point also has some velocity, and therefore will always run away (this reminds me of Achilles and turtle paradox)
• the point has velocities set in another point's direction, but it goes through it between checks, and if velocities are updated then, it just starts to oscillate the target point, never reaching it
• float rounding makes point A be 0.00000000001 pixels away from point B, but never exactly 0.

Solution is not to treat points as points, but as physical objects, giving them some size, e.g. spheres. You could assume a point is a sphere of 1 pixel diameter (0.5 px radius), it would mean you need to check if distance is < .5+.5 that is if (distance < 1) not if (distance == 0).

Check if the two points are close enough.

Lets say the speed of point A (moving point) is speedA and that the last frame was delta milliseconds long.

If A is moving towards B (stationary point) and is currently in a distance smaller than speedA * delta / 1000.0 it will reach the stationary point in the next frame.

You need to check if the distance between the moving point and the stationary point is less than the size of one step for the moving point.

distance(A, B) <= speedA * delta / 1000.0

If that happens the moving point will reach the stationary point in the next frame.

If this never happens, it means that point A is not moving towards point B or that it is moving in a speed so slow that it will not allow it to reach point B in a finite time such (C/n^2) where n is the current frame index and C is a constant.

The reason why this is not working is because of your understanding of the problem. You are considering the two objects to be two points. In games the position of an object in world space is most commonly a vector quantity.

Instead you should consider these two "points" as vectors. Next you can follow a few simple steps to arrive at a solution.

1. You take either vector and subtract the other from it. This creates a vector based at the origin.
2. The magnitude of this vector will then allow you to determine whether the two obejcts are occupying the same space.
3. In order to do this you compare the magnitude to the a value commonly called r. r represents the lee-way that must be considered when performing any calculation on floats. Because we do not have infinite space to hold a float value there will always be rounding errors in calculations with floats.

The pseudocode for this would be as such:

float r= 0.0000000001f;   // the lee-way for our program
Vector3 a,                // your first vector


text:
why are algebraic manipulations in general derivations valid?

My question somehow embarrasses me because this used to make sense to me before. Sometimes my brain just becomes confused with things I understood previously :(. My question is this:

Derivations of equations are done using variables only, and only rarely do we really specify the numerical values. This is because we like to have a general theorem for something, or whatever. What I don't get is why using only variables which are not really numbers is subject to the same reasoning as numbers. Variables are this sort of "a number capable of being any number" but its not really anything.

I don't know why this doesn't make sense to me right now if it was just sort of a truism before. I'd like to hear an opinion on why this sort of generality is true and valid.

I'm specifically bothered by equations in physics btw.

Thanks and sorry for the question.

• I think it would help to have an example of the kind of manipulation that is bothering you. "Equations in physics" seems to me to refer to something different from "Derivations of equations". – mweiss Jan 13 '15 at 2:46
• Because the equations generalize/abstract the properties that are satisfied by numbers. – user203864 Jan 13 '15 at 2:47
• In most cases, an “algebraic manipulation” is just a way of writing an expression that may be different in appearance from the original, but is equal for all values of the variable-letters that appear. – Lubin Jan 13 '15 at 2:55
• "What I don't get is why using only variables which are not really numbers is subject to the same reasoning as numbers." Because that's how we defined them. We defined the allowed operations based on how numbers behave. – hasnohat Jan 13 '15 at 3:32
• Hi @mweiss . I've made another question which is more specific to my actual confusion. In case you want to see it: math.stackexchange.com/questions/1103461/… – ben ari Jan 14 '15 at 1:23

An equation involving variables such as $$\tag{1} (a+b)(c+d)=ac+ad+bc+bd$$ doesn't in itself mean anything until you choose values for each of the variables. Once all of the variables have values we can do the arithmetic to evaluate each side of the equation to a number and see if the numbers are the same. Then, and only then, does the equation become something that is either true or false.

There are some equations -- such as (1) above -- with the property that they end up being true no matter which values we choose for the variables. That's a useful property; we call those equations "identities" or (in some cases) "rules".

However, we also work with equations that may or may not end up being true when we choose values for the variables -- for example $$\tag{2} 5a+2a=14$$ which becomes true if $a$ is $2$ and false if $a$ is $3$.

We can rewrite such equations using rules, to get for example $$\tag{3} 7a-14=0$$ and the point of the rewriting is that the value choices for $a$ that makes (2) true are exactly the same as the value choices for $a$ that makes (3) true.

This property is what we mean when we say the rewriting is valid, and a rewriting is valid whenever we can prove (in whichever convincing way we can think up) that the value choices that makes one equation true are the same ones that make the other true.

So in the end it all comes down to calculations on actual numbers, and the symbolic algebra on letters is just a slick way to predict how those calculations will come out before we choose which numbers to do it with. It's useful and time-saving but not in itself mysterious.

(The above is true at the algebra-precalculus level. In higher algebra we meet examples where variables really are things in themselves and everything does not straightforwardly reduce to actual values, such as formal polynomials over finite fields. But one shouldn't try to wrap one's head around those cases without being completely comfortable about the less advanced setting).

• Nicely said. The manipulation of symbols captures the pattern of manipulation that one would carry out in any specific instance with actual numbers. +1. – MPW Jan 13 '15 at 3:23


text:
# nLab Tristan Hübsch

## Selected writings:

The dimensional reduction of the standard supermultiplets of $D = 4, \mathcal{N} = 1$ supersymmetry to adinkraic representations of $D = 1, \mathcal{N}=4$:


text:
# Tag Info

Hint: A player with perfect recall means the player remembers the history of the moves up to the current information set. In particular, he remembers the previous actions he has taken. Now in Player $\mathrm I$'s second information set, can he recall whether he has taken $T_1$ or $B_1$ in his first information set?


text:
# Find exact values of $\tan(105^\circ)$ and $\tan(11\pi/12)$ without calculator [closed]

How do you find the exact values of the following without using a calculator?

$$\tan(105^\circ) \qquad \tan(11\pi/12)$$

## closed as off-topic by Zev Chonoles, Zain Patel, user223391, A.P., MicahJul 20 '15 at 20:06

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question is missing context or other details: Please improve the question by providing additional context, which ideally includes your thoughts on the problem and any attempts you have made to solve it. This information helps others identify where you have difficulties and helps them write answers appropriate to your experience level." – Zev Chonoles, Zain Patel, Community, A.P., Micah
If this question can be reworded to fit the rules in the help center, please edit the question.

Hint: Use the sum-angle formula for $\tan$:

$$\tan(\alpha+\beta)=\frac{\tan \alpha + \tan \beta}{1-\tan \alpha\tan \beta}$$

for some nice values of $\alpha,\beta$ of which you know the tangent.

Hint: $$\tan(105^\circ) = \tan(60^\circ+45^\circ)$$

$$\tan \theta = \frac{\sin\theta}{\cos\theta}$$ $$\sin(A+B) = \sin A\cos B + \cos A \sin B$$ $$\cos(A+B) = \cos A\cos B - \sin A \sin B$$

Alternatively, you can use the double angle formula for $\tan (A + B)$ as wythagoras suggested.

$$\tan 105^\circ = \tan (90+15)^\circ = -\cot 15^\circ = -1/\tan 15^\circ$$

Now, $\tan 2x = 2\tan x / (1-\tan^2 x)$

Put $x=15^\circ$ in the above equation and calculate $\tan 15^\circ$ from here and put in $$\tan 105^\circ = -1/\tan15^\circ$$

Do the same thing for your other question.

• Thanks @Micah, you have edited my response in such a beautiful fashion. I am new here, so, i dont know how to write mathematical equations here. – th ie Jul 20 '15 at 20:16


text:
# Einstein's Law of Motion

## Physical Law

The force and acceleration on a body of constant rest mass are related by the equation:

$\mathbf F = \dfrac {m_0 \mathbf a} {\paren {1 - \dfrac {v^2} {c^2} }^{\tfrac 3 2} }$

where:

$\mathbf F$ is the force on the body
$\mathbf a$ is the acceleration induced on the body
$v$ is the magnitude of the velocity of the body
$c$ is the speed of light
$m_0$ is the rest mass of the body.

## Proof

$\mathbf F = \map {\dfrac \d {\d t} } {m \mathbf v}$

we substitute Einstein's Mass-Velocity Equation:

$m = \dfrac {m_0} {\sqrt {1 - \dfrac {v^2} {c^2} } }$

to obtain:

$\mathbf F = \map {\dfrac \d {\d t} } {\dfrac {m_0 \mathbf v} {\sqrt {1 - \dfrac {v^2} {c^2} } } }$

Then we perform the differentiation with respect to time:

 $\ds \map {\frac \d {\d t} } {\frac {\mathbf v} {\sqrt {1 - \dfrac {v^2} {c^2} } } }$ $=$ $\ds \map {\frac \d {\d v} } {\frac {\mathbf v} {\sqrt {1 - \dfrac {v^2} {c^2} } } } \frac {\d v} {\d t}$ Chain Rule for Derivatives $\ds$ $=$ $\ds \mathbf a \paren {\frac {\sqrt {1 - \dfrac {v^2} {c^2} } - \dfrac v 2 \dfrac 1 {\sqrt {1 - \dfrac {v^2} {c^2} } } \dfrac{-2 v} {c^2} } {1 - \dfrac {v^2} {c^2} } }$ Chain Rule for Derivatives, Quotient Rule, etc. $\ds$ $=$ $\ds \mathbf a \paren {\frac {c^2 \paren {1 - \dfrac {v^2} {c^2} } + v^2} {c^2 \paren {1 - \dfrac {v^2} {c^2} }^{3/2} } }$ $\ds$ $=$ $\ds \mathbf a \paren {\frac 1 {\paren {1 - \dfrac {v^2} {c^2} }^{3/2} } }$

Thus we arrive at the form:

$\mathbf F = \dfrac {m_0 \mathbf a} {\paren {1 - \dfrac{v^2} {c^2} }^{\tfrac 3 2} }$

$\blacksquare$

## Comment

Thus we see that at low velocities (that is, much less than that of light), the well-known equation $\mathbf F = m \mathbf a$ holds to a high degree of accuracy.

## Source of Name

This entry was named for Albert Einstein.


text:
# Running Concurnas Programs?

Compiled programs written in Concurnas may be executed via the conc tool. For example, in conjunction with the concc tool for compilation:

Using example code, hello.conc:

System.out.println("Hello World!")

We can compile and execute this as follows:

D:\work\bin>concc hello.conc
D:\work\bin>conc hello
Hello World!
D:\work\bin>

The syntax for the conc tool is as follows:

conc options* entryPoint? cmdLineArguments*

Let us now look in detail at what is taking place above:

## Running code with Concurnas?

Compiled Concurnas code can be run with Concurnas via the conc command which comes as standard as part of the Concurnas distribution. We can also run conc in interactive Read-Evaluate-Print Loop (REPL) mode, this is explored in the REPL chapter. Here we focus upon non-interactive execution of pre compiled code. conc can be found under: conc-home. If this tool has not been added to the path, the tool may be started from within that directory. If Concurnas has not already completed its installation for the detected JDK which it is being run under, it will first complete that process (this may take a few minutes).

We use the conc command with an entry-point class or jar file reference in order to start conc in non-interactive execution mode:

D:\work>conc myClass
D:\work>conc myClass.class
D:\work>conc myJar
D:\work>conc myJar.jar

A full list of optional options for conc is found under the Command line options section.

## Bootstrapping Code?

In order to run a program with Concurnas via the conc tool we must pass an entry-point class or jar file reference. For a jar file to be used in this manner it requires a class within it to be nominated as its entry point. This entry point reference is then examined and one of the following is executed in order of precedence:

1. def main(args String[]) void

2. def main() void

3. Top level code

We see above that specifying a main method within our entry-point class is not a requirement, and if one is not defined then this will result in any top level code of the class file being invoked upon execution instead. However, using a main method is recommended in cases where we wish to use a referenced piece of code as both a library and program. This is because, where the code within the .class file is used like a library, upon first execution of something imported from that library class, all the top level code will be executed, including our code we wish to execute as a program - something which is rarely desirable. An explicit main method on the other hand must be explicitly invoked, thus avoiding this problem.

The main method declaration will receive any command line parameters passed to the program upon execution if its signature is declared as: def main(args String[]) void.

## Command line options?

There can be zero to many options specified on a call to conc:

• -classpath path or -cp path: The classpath option enables one to override the CLASSPATH environment variable. Elements are delimited via ; under Windows, and : under Linux. Elements may consist of directories, .class file references or .jar file references.

• -s: Server mode. When running in non interactive mode (i.e an entry point is provided) Concurnas will not terminate the process upon the entry point main method (or alternative) completing execution.

• -bc: Print bytecode. This option is applicable when running in REPL mode. Print the bytecode generated from the provided input.

• -J: JVM argument. Prefix jvm arguments with -J in order to pass them to the underlying JVM. e.g. -J-Xms2G -J-Xmx5G.

• -D: System property. Prefix system properties with -D in order to pass them to the underlying JVM. e.g. -Dcom.mycompany.mysetting=108.

• --help: List documentation for options above.

## Examples?

### Single file programs?

We can compile and execute our simple hello world (named littlehello.conc) as follows:

D:\work>concc littlehello.conc
Finished compilation of: D:\work\littlehello.conc -> D:\work\littlehello.class [littlehello]

D:\work>conc littlehello
hello world

D:\work>

In practice it is very rare that we will write single file programs.

### Multi file programs?

Lets take a slightly more involved hello world example (named hello.conc) which compiles into multiple class files thus requiring us to make of the classpath argument:

class SayHello{
def do(args String[]){
System.err.println("hello world received args: "+ args)
}
}

def main(args String[]){
new SayHello().do(args)
}

We can compile and execute this code as follows:

D:\work>concc hello.conc
Finished compilation of: D:\work\hello.conc -> D:\work\hello$SayHello.class [hello$SayHello], D:\work\hello.class [hello]

D:\work>conc -cp ./ hello
hello world got args: null

D:\work>

Notice above that we must make use of the -cp argument in order to specify the current directory as holding both our entry point class: hello.class and supporting SayHello class: hello$SayHello.class. Note that whilst it is best practice to specify a -cp argument, in the above case it may be omitted as Concurnas will automatically add the current directory to the classpath in instances where no -cp argument is provided and the entry class is within the current working directory1: D:\work>conc hello hello world got args: null D:\work>  We can pass command line arguments to our hello world class since its main method takes a String array argument: D:\work>conc -cp ./ hello there hello world got args: [there] D:\work>  ### Multi file programs in jar's? In practice it is often most convenient for the purposes of software distribution and organization, to package code up within jar's, these can be executed via the use of the -jar argument as illustrated here. Let's take our hello.conc we previously implemented: D:\work>concc -jar helloWorld[hello] hello.conc Finished compilation of: D:\work\hello.conc -> D:\work\hello$SayHello.class [hello\$SayHello], D:\work\hello.class [hello]

D:\work>conc helloWorld.jar
hello world got args: null

D:\work>conc helloWorld.jar there
hello world got args: [there]

D:\work>

### Running programs in server mode?

Normally, when running in non-interactive mode (i.e an entry point is provided) Concurnas will terminate the process upon the entry point main method (or alternative) completing execution. To suppress this behaviour, for instance, for a server application, we use the -s argument as follows:

D:\work>conc -s helloWorld.jar there
hello world got args: [there]

The above program will not terminate until it receives as a kill signal from the operating system.

## Terminating Code?

If we are running a Concurnas application in server mode (as par above) it can often be useful to register shutdown handlers. These are invoked upon receiving a SIGTERM signal from the operating system (check your operating system documentation for details on how to do this). More details on shutdown handlers can be found in the shutdown handlers section.

## Starting conc in interactive REPL mode?

The conc tool has the ability to run compiled Concurnas code as we have seen in this chapter. It also has the ability to run in interactive REPL mode. More information about running in interactive REPL mode can be found in the The Concurnas REPL section.

## JVM arguments?

Arguments (for example garbage collection and memory allocation tuning) may be applied to the underlying JVM executing conc by prefixing them with -J. For example:

D:\work>conc -J-Xmx2g helloWorld.jar there
hello world got args: [there]

D:\work>

## System properties?

System properties may be specified on the command line when running conc by prefixing them with -D. For example:

D:\work>conc -Dcom.mycompany.mysetting=108 helloWorld.jar there
hello world got args: [there]

D:\work>

## Adding conc to the path?

It is recommended that the <installDir>/bin be added to the system path in order to permit /conc to be run from any directory. Check your operating system documentation for details of how to do this.

## Notes?

The first time the conc tool is executed, or when a new JVM environment upon which is its being executed is detected, an 'installation' will take place wherein Concurnas will set itself up to execute efficiently upon said JVM environment by caching a copy of the JDK. This can take up to a few minutes to complete.

### Footnotes

1This feature has been added so as to aid newcomers to the programming language