text:
# Tag Info

1

Compute the eigenvalues of $A$ and $B$. These are of course $1, 1, 3$. Compute eigenvectors of $A$. These are $$\begin{bmatrix}-2\\1\\0\end{bmatrix}, \begin{bmatrix}0\\0\\1\end{bmatrix}, \begin{bmatrix}0\\1\\1\end{bmatrix},$$ where the first two are relative to $1$, and the third to $3$. Simlarly for $B$ one has $$\begin{bmatrix}0\\1\\0\end{bmatrix}, ... 0 Let a_{ij} be the entries of the matrix A. Our basis is given by$$ v_1 = \pmatrix{1&0\\0&0}, \quad v_2 = \pmatrix{0&1\\0&0}, \quad v_3 = \pmatrix{0&0\\1&0}, \quad v_4 = \pmatrix{0&0\\0&1} $$We note that$$ T(v_1) = a_{11}v_1 + a_{21} v_3\\ T(v_2) = a_{11}v_2 + a_{21} v_4\\ T(v_3) = a_{12}v_1 + a_{22} v_3\\ T(v_4) = ...

3

If the two matrix $A$ and $B$ are similar then they are similar to the same Jordan matrix $J$; so find the change matrices $S$ and $T$ such that $$A=SJS^{-1}\quad;\quad B=TJT^{-1}$$ so $$A=ST^{-1}BTS^{-1}$$ and then we have $P=TS^{-1}$.

3

Suppose, you have $$A=S^{-1}DS$$ and $$B=T^{-1}DT$$ Then we have $$D=TBT^{-1}$$ So, we get $$A=S^{-1}TBT^{-1}S$$ So, with $$P:=T^{-1}S$$ you have the required transformation.

1

Let $x$ an eigenvector of $B^TB$ associated to the eigenvalue $\lambda$, which is real since $B^TB$ is symmetric, then $$\lambda ||x||^2=\langle B^TB x,x\rangle=\langle Bx,Bx\rangle=||Bx||^2\implies \lambda\ge0$$

2

They are always non-negative. Suppose $\lambda$ is an eigenvalue of $B^TB$ corresponding to an unit eigenvector $v$, then $\langle v, B^T B v \rangle = \lambda = \langle Bv, B v \rangle = \|Bv\|^2$. Hence $\lambda \ge 0$.

-1

Yes. $$\sum_{i=1}^n \sum_{j=1}^n a_i a_j 2^{x_ix_j}=\left(\sum_{i=1}^n a_i2^{x_i}\right)^2.$$

0

Attempt: W.L.O.G $\det B=0$ $\operatorname{rank}[(A+A^T)(B+B^T)]=\operatorname{rank}[AB+AB^T+A^T(B+B^T)]=\operatorname{rank}[AB^T+A^T(B+B^T)] \le \operatorname{rank}(AB^T)+\operatorname{rank}[A^T(B+B^T)] \le \operatorname{rank}B^T+\operatorname{rank}A^T=\operatorname{rank}A+\operatorname{rank}B \le (2k+1)+\operatorname{rank}AB=2k+1$ So that, if equality ...

0

I assume that $B^T$ has more columns than rows, and that $m=2n$. Then let $C_{n \times n}$ be a rotation-matrix (=orthogonal) and $D_{n \times n}=I_{n \times n}$ Then let $B^T= 0.5 \cdot [C \quad D]$ being a blockmatrix, then $B^T \cdot B = I_{n \times n}$

2

$$(A+B)^{-1}=[B(B^{-1}A+I)]^{-1}=[B(B^{-1}+A^{-1})A]^{-1}$$ Now use that $(XY)^{-1}=X^{-1}Y^{-1}$ to get $$[B(B^{-1}+A^{-1})A]^{-1}=A^{-1}(B^{-1}+A^{-1})^{-1}B^{-1}$$ Notice that there is a missing $-1$ in your formula. To get the other equation start with $$(A+B)^{-1}=[A(I+A^{-1}B)]^{-1}=[A(B^{-1}+A^{-1})B]^{-1}$$ and then ...

3

You can construct matrices with this property as follows: assume $m\geq n$ and endow $\Bbb R^m$ with the standard euclidean inner product. Pick vectors ${\bf v}_1,...,{\bf v}_n$ such that ${\bf v_i}\cdot{\bf v_i}=\delta_i^j$. Then the matrix $B$ whose rows are the vectors ${\bf v}_1,...,{\bf v}_n$ (in any coordinate system) has the desired property.

2

Here's an example: $B = \begin{pmatrix}1 \\ 0 \end{pmatrix}$ then $B^T\cdot B=1$. For something less simple, you can consider $B = \begin{pmatrix} 1 & 0 \\ 0 & 1 \\ 0 & 0 \end{pmatrix}$.

3

Hints : The diagonal elements have to be $0$ If the lower left triangle is given, the upper right triangle is determined by $a_{ij}=-a_{ji}$

0

on the other hand, I can't find any pair of a,b such that...Why is that? You cannot find such a pair because your assumption but from the text it seems that the matrix of the form ..is the most general form of O(2) is not true: As you noted every rotation $$R=\left[ \begin{array}{cc} a & -b \\ b & a \end{array} \right]$$ has determinant ...

1

HINT: $a^2+b^2=1$ and $T(e_1) =(a,b)^t$, give you two solutions not one: $T_1(e_2) =(-b,a)^t$ and $T_2(e_2) =(b,-a)^t$.

0

0

If you want to form the $(m_1+m_2) \times (n_1+n_2)$ block matrix \begin{equation*} M = \begin{bmatrix} A & B\\ C & D \end{bmatrix} \end{equation*} where $A$ is $m_1 \times n_1$, $B$ is $m_1 \times n_2$, $C$ is $m_2 \times n_1$ and $D$ is $m_2 \times n_2$, you just need to type M = [A, B; C, D];

1

Hint. The key is to show that the rank of at least one of the two matrices is at most $k$. Once this is shown, use the facts that $\det(XY)=\det(X)\det(Y)$ and $\operatorname{rank}(C+D)\le\operatorname{rank}(C)+\operatorname{rank}(D)$ to complete the proof.

2

After an orthogonal change of basis $A^TA$ becomes a diagonal matrix $D$ with nonnegative entries $d_1,\dots,d_n$. The question is then whether $$f(\lambda) = \det(\lambda I+D) = \prod_{i=0}^n(\lambda+d_i)$$ increases or decreases as $\lambda$ increases. For $\lambda\geq0$, we see that each term in the product is positive and increases with $\lambda$ so ...

0

I would do it one transformation at a time and then form the product of the matrices. So, to begin with, we have $$\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} 0 \\ 1 \end{pmatrix} = \begin{pmatrix} 2 \\ 1 \end{pmatrix}$$ and by implication $$\begin{pmatrix} a & b \\ c & d \end{pmatrix} \begin{pmatrix} 1 \\ 0 \end{pmatrix} ... 1 Hint: What happens when you expand and simplify the polynomial product$$(1 - x)(1 + x + \cdots + x^n)?$$Can you produce a polynomial analogue of the resulting equation? 0 It has failed because: \dim (A+(-B)) \ge \dim A 0 It says you get B from A (or vice versa) by adding a matrix of rank s. What else do you want it to say? EDIT: The column space of A has dimension K = \text{rank}(A). The column space of B could be anything from K - s to K. 1 The Gauss' map is \Omega\to\Bbb R^3 given by p\longmapsto \dfrac{\partial_1\times\partial_2}{||\partial_1\times\partial_2||}, where \partial_1=\frac{\partial f}{\partial v} and \partial_2=\frac{\partial f}{\partial w}. We can see this map as a vector field N:\Sigma\to\Bbb R^3, i.e. an assignation  \left(\begin{array}{c} x\\ y\\ z ... 1 I'm going to give a complete proof of this result, which has a surprisingly conceptual basis, using the quaternions. I believe it can possibly be simplified further. Let \mathbb{H} be the division ring of the quaternions. It contains \mathbb{C} as a subring. View \mathbb{H} as a left-\mathbb{H}-vector space over itself. An arbitrary endomorphism of ... 0 This won't quite work: e.g. you might have A = I, in which case your T could be any invertible matrix, and there's no reason to think T B T^{-1} will be in Jordan normal form. What you want to do is choose T on each eigenspace of A to put into Jordan form the restriction of B to that eigenspace. 1 Assume that W_c is the matrix with orthonormal columns forming a basis of V_c and let W_c^\perp be such that W:=[W_c,W_c^\perp] is unitary (W_c contains a basis of the orthogonal complement of V_c). We have AW_c=cW_c, so$$ A[W_c,W_c^\perp]=[W_c,W_c^\perp]\begin{bmatrix}cI & B_{12} \\ 0 & B_{22}\end{bmatrix}=:WB, $$that is, A is ... 3 A simple and classic result (prove it): if two endomorphisms commute then the eigenspace of one is invariant by the other. Now since A and A^* commute then V_c is invariant by A^* hence for all w\in V_c we have A^*w\in V_c so for v\in (V_c)^\perp:$$\langle Av,w \rangle =\langle v,A^*w\rangle=0$$and the result follows 0 The proof for the Wikipedia formula was given in this thread, which unfortunately still leads to a system for which an inverse needs to be taken in order to solve the determinant. At least I was able to prove that in this general case it's impossible: Inserting my matrix into the proof for \begin{bmatrix}A&B\\B &A \end{bmatrix} Gives ... 8 Let AB\in F^{n,n}, F any field, n odd. Assume they satisfy A^2 = AB+BA. From A^2=AB+BA it follows$$ AB-BA= A^2-2BA= (A-2B)A. $$Then it holds$$ \det(AB-BA) = \det((A-2B)A) = \det(A(A-2B)). $$Now we have$$ A(A-2B) = A^2-2AB = BA-AB. $$This proves$$ \det(AB-BA) = \det(BA-AB) = \det( -(AB-BA)) = (-1)^n \det(AB-BA), $$and since n is odd, ... 3 This was easier than I originally thought. Note that$$ AB - BA = AB + BA - 2BA = A^2 - 2BA = (A-2B)A\\ -(AB - BA) = AB + BA - 2AB= A^2 - 2AB = A(A - 2B) $$and that we have both \det(AB - BA) = \det(-(AB - BA)) and \det(AB - BA) = -\det(-(AB - BA)). My original approach: note that AB - BA has trace zero. Then, we note that$$ AB - BA = AB + BA - ...

0

What did you try? You could use the well-known formula $$\DeclareMathOperator{\Var}{Var} \Var(AX) = A \Var(X) A^T$$ You can find such formulas here: https://en.wikipedia.org/wiki/Multivariate_random_variable

2

A partial answer. I usually prove that $A=(I-Q)(I+Q)^{-1}$ is skew-Hermitian by showing that $A^\ast=-A$ rather than $A+A^\ast=0$. The merit of doing this is that we can factor out $Q^\ast$ and make the proof shorter: $$A^\ast = \left[ (I-Q)(I+Q)^{-1} \right]^\ast \color{red}{=} (I+Q^\ast)^{-1}(I-Q^\ast) \color{blue}{=} ... 2 According to your link a submatrix is just a block of another matrix. So this is just a connected 'rectangle' of numbers of the original matrix, that means (as you already assumed) that you cannot skip rows or columns. But if you consider following link, you can skip rows or columns, that means you can construct any submatrix by deleting whole columns and ... 5 Hint$$\dfrac{1}{2}[(a+b)^2+(b+c)^2+(a+c)^2]=a^2+b^2+c^2+ab+ac+bc\le 0$$so we have$$a=-b,b=-c,c=-a\Longrightarrow a=b=c=0$$0 After two well chosen row operations you can get$$ \left( \begin {array}{cccccc} a&1&a&0&0&0\\ -ab&0&1- ab&b&0&0\\ 0&0&c&1-cd&0&-cd\\ 0 &0&0&d&1&d\end {array} \right) $$Since we cannot have both -ab and 1-ab as zero, the rank is at least 3. The rank can only be 3 if rows 2 ... 0 You're given the matrix in row echelon form!$$A= \begin{pmatrix} a & 1 & a & 0 & 0 & 0 \\ 0 & b & 1 & b & 0 & 0 \\ 0 & 0 & c & 1 & c & 0 \\ 0 & 0 & 0 & d & 1 & d \\ \end{pmatrix} $$Now, there's no way row 1 and row \;2\; are linearly dependent , as it'd have to be ... 0 we can show that rank(A) > 2 by leaving out the first column. second row is replaced by second row minus b times the first row. we have two cases: ab = 1 and ab \neq 1. let us take the easier case ab \neq 1. now you have pivots 1, 1-ab, 1 in rows 1, 2,  and 3. so rank(A) \ge 3 the second case ab = 1, now we have pivots 1 on rows ... 0 Looking at these matrices as maps, we have that \;B:\Bbb F^m\to\Bbb F^n\; , and thus \;\dim\text{Im}\,B\le n\; , so \;\dim\text{Im}\,A(B)\;\le n . Or shortly: linear maps (or matrices) cannot increase the dimension of the domain. 2 Notice that$$E_{ij}E_{kl}=\delta_{jk}E_{il}$$so if a matrix$$A=\sum_{1\le k,l\le n}a_{kl}E_{kl}$$commutes with the all the matrices then it commutes with E_{ij} hence we get$$AE_{ij}=E_{ij}A\iff \sum_{k=1}^n a_{ki}E_{kj}=\sum_{l=1}^n a_{jl} E_{il}$$so we see that$$a_{ii}=a_{jj}=:\lambda\;\forall i,j\quad \text{and} \quad a_{ki}=0\;\forall k\ne ...

1

Hint: Compute $A E_{ij}$ and $E_{ij} A$. Force them to be equal.

2

If $A$ is orthogonal such that $\color{blue}{\text{$A+I$is invertible}}$, then $$X+X^T=(A+I)^{-1}(A-I)+(A-I)^T(A+I)^{-T} =(A+I)^{-1}[\underbrace{(A-I)(A+I)^T+(A+I)(A-I)^T}_{=0}](A+I)^{-T}=0.$$

2

Use the case for two matrices and use induction: $$(ABC)^T = C^T(AB)^T = C^TB^TA^T.$$ You can easily generalize this to arbitrarily large products and see that transposing a product inverts the order of the product. In your particular case you get that: $$A^TC^TB^T = (BCA)^T.$$

3

Absolutely no conditions (except for compatibility*, of course): $$A^T C^T B^T = A^T (C^T B^T) = A^T (BC)^T = ((BC)A)^T = (BCA)^T$$ By associativity of matrix multiplication and by $(AB)^T = B^T A^T$. *Matrices $A, B$ are said to be compatible if the product $AB$ exists, i.e. if the number of rows of $B$ is equal to the number of columns of $A$.

0

It's a trick. Since $X = IX$, then $aX = a(IX) = (aI)X$.

3

There are three kinds of 2-tensors, of type $(0,2)$, $(2,0)$ and $(1,1)$. Let's take the metric tensor $g$ of type $(0,2)$. If $p$ is a point in your manifold and $V:=T_p M$ the tangential space as a vectorspace, then the metric is a bilinear map $$g_p:V \times V \rightarrow \mathbb{R}$$ and "the matrix" of $g$ is a description of $g$ if you choose a ...

2

All reflections in the plane have matrices of the form $$\left( \begin{array}{cc} \cos \alpha & \sin \alpha \\ \sin \alpha & - \cos \alpha \end{array} \right)$$ or, for any $a^2 + b^2 = 1,$ $$\left( \begin{array}{cc} a & b \\ b & - a \end{array} \right)$$

1

Eigenvalues of $A\bar{A}$ have been thoroughly studied in D.C. Youla, A normal form for a matrix under the unitary congruence group, Canad. J. Math. 13(1961), 694-704. In the paper, it is proved (in Lemma 5) that for any complex square matrix $A$, those eigenvalues of $A\bar{A}$ that are not real nonnegative must either be non-real and occur in ...

0

An $n\times n$ matrix with $n$ independent eigenvectors can be written as $A=P^{-1}DP$, where $D$ is the diagonal matrix $diag(\lambda_1\:\lambda_2\:...\lambda_n)$ and $P$ is the matrix $(\vec{v}_1\:|\:\vec{v}_2\:|...|\:\vec{v}_n)$ where $v_i$ is the corresponding eigenvector to $\lambda_i$. ...

2

Writing the matrix down in the basis defined by the eigenvectors is trivial. It's just $$M=\left( \begin{array}{ccc} 1 & 0 & 0 \\ 0 & -2 & 0 \\ 0 & 0 & 2 \end{array} \right).$$ Now, all we need is the change of basis matrix to change to the standard coordinate basis, namely:  S = \left( \begin{array}{ccc} 1 & 1 & ...

Top 50 recent answers are included


text:
# How to fix missing or incorrect mappings from glyphtounicode.tex

glyphtounicode.tex has been described as the best solution for generating copy-and-pasteable symbols. However, I find that various symbols that I need to use do not paste as the appropriate Unicode codepoints/characters. How can I fix this?

This is how my macros should be pasting:

• \nSubset: ⋐̸ (U+22D0 U+0338)
• \cong: ≅ (U+2245)
• \ncong: ≇ (U+2247)
• \bigcup: ⋃ (U+22C3)
• \notin: ∉ (U+2209)
• \neq: ≠ (U+2260)
• \llbracket: ⟦ (U+27E6); \rrbracket: ⟧ (U+27E7)
• \llparenthesis: (|; \rrparenthesis: |)
• Update: Unicode offers the symbol pairs ⦇ ⦈ (U+2987/U+2988) and ⦅ ⦆ (U+2985/U+2986), which many might consider a better choice for these macros.
• \coloneqq: ≔ (U+2254)
• \models: ⊧ (U+22A7) [currently |=]
• \Rsh: ↱ (U+21B1)
• \textlengthmark: ː (U+02D0) [currently :]
• \blackdiamond: ⬩ (U+2B29)
• \sqbullet: ▪ (U+25AA)
• \square: ▫ (U+25AB)

(Note: Earlier I erroneously stated that \neg pastes incorrectly as ￢ (U+FFE2) instead of ¬ (U+00AC). This is not correct: \neg pastes correctly; it's Word that replaces this by the other symbol, just as I noticed that Word doesn't copy all accented letters correctly from pdf-files (whereas they paste exactly right into Notepad). I actually don't know whether this is truly a Word issue (if so, it's likely a legacy encoding/font hack) or has to do with pdflatex or maybe the Unicode/non-Unicode clipboard distinction in Windows. Anyone feel free to add (non-ranty) insight into this.)

This is how they currently paste:

>; ; ;
S
; <; ,; J; K; L; M;B; |=;é; :; ˛; ‚; ˝

(The linebreaks before and after \bigcup ("S") are probably caused by it being a big operator, so they're nothing to worry about.)

Here is minimal example code:

\documentclass{article}
\input glyphtounicode % I am using the updated version from http://www.lcdf.org/type/ (lcdf-typetools-2.94.tar.gz).
\pdfgentounicode=1
\usepackage[T3,T1]{fontenc} % The T3-encoding is required by the tipa-package.
\usepackage[noenc,safe]{tipa} % \textlengthmark
\usepackage{txfonts}
\usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd}
\usepackage[mathb]{mathabx}

\begin{document}

\noindent $$\nSubset; \cong; \ncong; \bigcup; \notin; \neq; \llbracket; \rrbracket; \llparenthesis; \rrparenthesis; \coloneqq; \models; \Rsh; \mbox{\textlengthmark}; \blackdiamond; \sqbullet; \square$$ \\

\noindent $$\nexists$$

\end{document}

The symbol ∄ (\nexists) at the end has been included to demonstrate that glyphtounicode.tex is compatible with my code, because it pastes correctly (and in fact requires a recent version of glyphtounicode.tex, see the comment in my code).

-

You can add your own definitions. Eg. here an example how to copy an "a" as "A":

\documentclass[a4paper,12pt]{article}

\usepackage[ansinew]{inputenc}
\usepackage[T1]{fontenc}
\input{glyphtounicode}

\pdfglyphtounicode{a}{0041} %0041=A
\pdfgentounicode=1
\begin{document}
aaaaa
\end{document}

The main problem is naturally to find the names of the glyphs you are using. In case you know the font you can find the names in the afm or the pfb. You can also add \pdfcompresslevel=0 to your document and then inspect the pdf. Look for lines starting with /CharSet (there will be more than one if you use more than one font). E.g. if I add \int to the example I will find /CharSet (/integraltext) and integraltext is the name of the glyph.

In case that the symbol is not a single glyph or that its name is not unique or changes from one font family to the next you will probably need to use the accsupp-package. Is it possible to provide alternative text to use when copying text from the PDF?.

-
Thanks, but that's exactly why I'm asking: I have no idea how to find the names of the glyphs that I am using. I also don't know what it means for a name to not be unique, and all of these involve macros I didn't define myself, so I don't actually know how to obviously and effectively use accsup with this (from superficial inspection). So ideally a solution would give me concrete fixes for the above symbols/macros. Also, some of these do have lines in glyphtounicode.tex (\pdfglyphtounicode{approximatelyequal}{2245}), so I am not sure what's going wrong. –  Lover of Structure Aug 8 '12 at 9:51
@user14996 I added some remarks how to find out the names. –  Ulrike Fischer Aug 8 '12 at 10:01
I appreciate your help and efforts, but I am not sure what difference the \pdfcompresslevel would make and what a pfb is. I also do not know how to know which font a given macro from a given package is using. Ideally one solution for each case (from someone) and I'll figure out the rest by myself. Sorry ... this is after looking at this for a couple of hours, and I'm a beginner as far as font matters are concerned. –  Lover of Structure Aug 8 '12 at 10:15
Sorry I didn't mean the pfb but the pdf. If you add \pdfcompresslevel=0 to your document and compile then the pdf is more or less a normal text file and you can open it in your editor. –  Ulrike Fischer Aug 8 '12 at 10:37
If you wrap a mathematical symbol e.g. in braces this "hides" its "math meaning" and so can affect spacing. E.g. $a=b$ has a very different spacing to $a{=}b$ as in the second case the = is not longer a relation. –  Ulrike Fischer Aug 17 '12 at 8:20

The following concrete solution is based on Ulrike Fischer's answer:

Solution, part 1 (using \pdfglyphtounicode): The following lines help with the first batch of symbols:

\pdfglyphtounicode{notsubsetdbl}{22D0 0338}
\pdfglyphtounicode{simequal}{2245}
\pdfglyphtounicode{notsimequal}{2247}
\pdfglyphtounicode{uniontext}{22C3}
\pdfglyphtounicode{nelement}{2209}
\pdfglyphtounicode{nequal}{2260}
\pdfglyphtounicode{llbracket}{27E6}
\pdfglyphtounicode{rrbracket}{27E7}
\pdfglyphtounicode{llparenthesis}{0028 007C}
\pdfglyphtounicode{rrparenthesis}{007C 0029}
\pdfglyphtounicode{colonequal}{2254}

The macros \models, \Rsh, \textlengthmark, \blackdiamond, \sqbullet, \square seem to require the accsupp package. In the pdf-file, they are handled with the following glyphnames respectively: bar + equal, eacute, colon, ogonek, quotesinglbase, hungarumlaut. This explains their pasting behavior; these are names with normally different meanings, namely the ones shown by what's being pasted.

Solution, part 2 (using the package accsupp): The following code creates new "Unicode-compatible" commands. A user will of course need to replace the old commands with these new ones (\models by \Umodels etc.). The math character classes (mathord etc) used here are based on my unique needs.

\RequirePackage{accsupp} % Unicode-pastable versions of symbols
\newcommand*{\Umodels}{\BeginAccSupp{method=hex,unicode,ActualText=22A7}\mathrel{\models}\EndAccSupp{}}
\newcommand*{\URsh}{\BeginAccSupp{method=hex,unicode,ActualText=21B1}\mathord{\Rsh}\EndAccSupp{}}
\newcommand*{\Utextlengthmark}{\BeginAccSupp{method=hex,unicode,ActualText=02D0}\textlengthmark\EndAccSupp{}}
\newcommand*{\Ublackdiamond}{\BeginAccSupp{method=hex,unicode,ActualText=2B29}\mathord{\blackdiamond}\EndAccSupp{}}
\newcommand*{\Usqbullet}{\BeginAccSupp{method=hex,unicode,ActualText=25AA}\mathord{\sqbullet}\EndAccSupp{}}
\newcommand*{\Usquare}{\BeginAccSupp{method=hex,unicode,ActualText=25AB}\mathord{\square}\EndAccSupp{}}

(To those who are wondering, the value of ActualText can also be a space-separated list of hexadecimal UTF-16 values. Note that these are not Unicode codepoints but their UTF-16 representation (these are not identical for characters outside of Unicode's basic multilingual plane, BMP). For more information on how to paste Unicode characters outside of the BMP, see this question/answer.)

Bonus addendum: How to fix existing \pdfglyphtounicode assignments: If you would like to change an existing assignment such as U+25C1 for \lhd (glyphtounicode.tex contains the line \pdfglyphtounicode{triangleleft}{25C1}), simply reinvoke the \pdfglyphtounicode macro after the line \input glyphtounicode; for example you may write \pdfglyphtounicode{triangleleft}{22B2}, which will override the original definition.

-

format: plain


text:
View more

View more

View more

### Image of the Day Submit

IOTD | Top Screenshots

### The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.

# How Common are Data Errors in TCP?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

10 replies to this topic

### #1tufflax  Members

Posted 23 June 2011 - 01:51 PM

Hi!

How common are data corruption/errors in TCP? I mean errors that slip by the correction facilities.

I had my game server running 30 minutes, during that time had 2 clients sending about 150 KB of data to the server. After about 30 minutes, my server crashed because it read an illegal value (my server does not yet deal well with illegal client data). The server ran on the same computer as the clients, and although it is possible that I have made a mistake, I find it to be a bad explaination, because for those 30 minutes basically the same messages were sent over and over. It has happened 3 times in the last 2 days. So it's kind of rare, too rare for me to think that it is a coding mistake, yet common enough to make me wonder what it can be.

I was under the impression that TCP is very reliable, especially when just sending to 127.0.0.1.

Do you have any ideas of what might be wrong?

Edited by tufflax, 06 November 2012 - 06:22 PM.

### #2jeff8j  Members

Posted 23 June 2011 - 02:18 PM

You say you dont handle illegal client data do you know if anything else could possibly be connecting to it and sending some data your not expecting? What port are you using?

Firefox youtube video and audio downloader MP3 MP4 OGG WEBM

### #3ApochPiQ  Moderators

Posted 23 June 2011 - 02:35 PM

Think of it this way.

Unaugmented TCP is basically what is used to download .EXE files and such from the web.

When was the last time you downloaded something and discovered it was corrupted? When was the last time you found a spelling mistake on a web page that magically went away when you refreshed, because it was actually a TCP transmission error?

TCP doesn't corrupt your data.
Wielder of the Sacred Wands

### #4tufflax  Members

Posted 23 June 2011 - 02:40 PM

You say you dont handle illegal client data do you know if anything else could possibly be connecting to it and sending some data your not expecting? What port are you using?

Good point! Maybe that's what's happening. I'll look into this. I was using port 2345 or 1300 something like that. Just typing 4-digit numbers... Although I'm beind a firewall... Where does standard ports that might be open end?

Think of it this way.

Unaugmented TCP is basically what is used to download .EXE files and such from the web.

When was the last time you downloaded something and discovered it was corrupted? When was the last time you found a spelling mistake on a web page that magically went away when you refreshed, because it was actually a TCP transmission error?

TCP doesn't corrupt your data.

Yeah that's what I thought...

### #5hplus0603  Moderators

Posted 23 June 2011 - 02:40 PM

Hi!

How common is data corruption/errors in TCP? I mean errors that slip by the correction facilities.

I had my game server running 30 minutes, during that time had 2 clients sending about 150 KB of data to the server. After about 30 minutes, my server crashed because it read an illegal value (my server does not yet deal well with illegal client data). The server ran on the same computer as the clients, and although it is possible that I have made a mistake, I find it to be a bad explaination, because for those 30 minutes basically the same messages were sent over and over. It has happened 3 times in the last 2 days. So it's kind of rare, too rare for me to think that it is a coding mistake, yet common enough to make me wonder what it can be.

I was under the impression that TCP was very reliable, especially when just sending to 127.0.0.1.

Do you have any ideas of what might be wrong?

TCP data basically doesn't get corrupted. Each little segment is protected with a separate CRC, as well as generally by physical-layer systems (depending on specifics). Consider: When verifying md5sums of downloaded files, I've never had a download fail, even if the download is a 4 GB ISO file.

My guess is that your client or server code is wrong, or that someone else connected to your server and sent it garbage. For example, a memory corruption bug could cause random data to get corrupted.
enum Bool { True, False, FileNotFound };

### #6tufflax  Members

Posted 23 June 2011 - 05:19 PM

Hm, just tried again; I ran the server for about 20 minutes before the same problem occurred again. I was keeping track of all the connected clients, no new one ever connects. The message is from one of my own clients. But I'm using asserts in the client to make sure the client never sends illegal data. Moreover, I'm sending the exact same message about 30000 times or so before the problem occurs. I just connected the client and let it sit there sending and receiving updates. This is starting to annoy me. I find it totally believable that I have made a mistake, I just find it strange that it just happens all of a sudden after I have done the exact same thing ten thousand times before.

Any ideas?

Some code (in Clojure, but using Java socket channels. If you know Java and are curious you can probably figure out what I'm doing). The error occurs in this first file when I'm reading from the channel, in this piece (I get something negative out from getShort on the buffer:

Edit: Darn the indentation is messed up...

(zero? (.remaining rbuf)) (let [len (.. rbuf (flip) (getShort))
test (if (neg? len)
(println (.getInetAddress (.socket chan))))
new-netmap (assoc netmap :read-tmp (ByteBuffer/allocate len))]

which is part of this next file

Shared networking code:
;;;; Remember the following while working with this code:
;;;;
;;;; * You must use channels and buffers when using select, not
;;;;   the socket streams.
;;;;
;;;; * When using select, you have to call functions in this order:
;;;;   select
;;;;   selectedKeys
;;;;   do stuff with keys in the set
;;;;   remove keys from the key set
;;;;
;;;;   You cannot rely only on the flags of selection keys.
;;;;
;;;; * When writing to buffers, first write, then flip, then read, then clear.
;;;;
;;;; * Newly created buffers have (.remaining buffer) = their length,
;;;;   so if you want to create a buffer used for writing, it can appear to
;;;;   have data in it from the beginning. Use (doto new-buff (.flip)).

(ns game.networking
(:import java.nio.ByteBuffer
(java.io ObjectOutputStream ByteArrayOutputStream
ObjectInputStream ByteArrayInputStream
IOException)))

(defn- to-byte-array
"Turns obj into a byte[]."
[obj]
(with-open [baos (ByteArrayOutputStream.)
oos (ObjectOutputStream. baos)]
(.writeObject oos obj)
(.toByteArray baos)))

(defn- from-byte-array
"Turns the byte[] ba into an object."
[ba]
(with-open [bais (ByteArrayInputStream. ba)
ois (ObjectInputStream. bais)]

(defn- channel-operation
"Calls op (a read/write fn) on chan and returns
true if it filled/emptied the buffer."
[op chan buffer]
(op chan buffer)
(zero? (.remaining buffer)))

"Reads from chan into buffer. If the buffer becomes full,
returns true, else false."
[chan buffer]
(channel-operation (memfn read buf) chan buffer))

(defn- write-from-buffer
"Writes from buffer into chan. If the whole buffer was written,
returns true, else false."
[chan buffer]
(channel-operation (memfn write buf) chan buffer))

"Reads data from a channel found in netmap.
The netmap needs to contain chan, rbuf and read-tmp.

If netmap has been changed as a result of reading, calls
new-netmap-f with the new netmap as argument.

If a message has been completely read, calls new-msg-f
on the message.

Operates in the following manner:

1) Checks if there is an incomplete message in read-tmp and,
if so, tries to complete it.

2) If not, checks if the length of the next message has
been read, and if so, creates a new ByteBuffer of the
correct length and assocs it with read-tmp in netmap.

3) Otherwise, try to read the length of the next
message into rbuf."
[{:keys [chan rbuf read-tmp] :as netmap} new-netmap-f new-msg-f]
(cond
; incomplete msg: read more
(let [msg (from-byte-array (.array read-tmp))
new-netmap (assoc netmap :read-tmp nil)]
(new-netmap-f new-netmap)
(new-msg-f msg new-netmap)
(recur new-netmap new-netmap-f new-msg-f)))
; have read length: prepare buffer for msg
(zero? (.remaining rbuf)) (let [len (.. rbuf (flip) (getShort))
test (if (neg? len)
(println (.getInetAddress (.socket chan))))
new-netmap (assoc netmap :read-tmp (ByteBuffer/allocate len))]
(.clear rbuf)
(new-netmap-f new-netmap)
(recur new-netmap new-netmap-f new-msg-f))
; new msg: read 2 bytes from chan into rbuf (the length of the next message)
; (tries to fill rbuf, so if it can only read 1 byte,
; will come back to here later)
:else (if (read-into-buffer chan rbuf) (recur netmap new-netmap-f new-msg-f))))

(defn write-to-channel
"Writes data to a channel, found in netmap. The
netmap needs to contain chan, wbuf, write-tmp and write-q.

If netmap has been changed as a result of writing, calls
new-netmap-f with the new netmap as argument."
[{:keys [chan wbuf write-tmp write-q] :as netmap} new-netmap-f]
(cond
; length not written: write it
(pos? (.remaining wbuf)) (if (write-from-buffer chan wbuf)
(recur netmap new-netmap-f))
; msg not written: write it
write-tmp (if (write-from-buffer chan write-tmp)
(let [new-netmap (assoc netmap :write-tmp nil)]
(new-netmap-f new-netmap)
(recur new-netmap new-netmap-f)))
; no incomplete msg: see if there's one in write-q
write-q (let [test (assert (= (class "a") (class (last write-q))))
msg (to-byte-array (last write-q))
len (alength msg)]
(.clear wbuf)
(assert (pos? (short len)))
(.putShort wbuf (short len))
(.flip wbuf)
(let [new-netmap (assoc netmap
:write-tmp (ByteBuffer/wrap msg)
:write-q (butlast write-q))]
(new-netmap-f new-netmap)
(recur new-netmap new-netmap-f)))))

Module on the client side. Everything is sent with send-msg, and every msg is a String.
(ns game.networking.client
java.nio.channels.SocketChannel
java.nio.ByteBuffer)
(:require [game.networking :as net])
(:use game.utility))

(def- netmap (atom nil))

(def- msgs (atom nil))

(defn get-msgs []
(let [ms (reverse @msgs)]
(reset! msgs nil)
ms))

(defn send-msg [msg]
(let [new-netmap (update-in @netmap [:write-q] conj msg)]
(reset! netmap new-netmap)))

; make private later!
(defn update-netmap [nm]
(reset! netmap nm))

; make private later!
(defn handle-msg [msg _]
(swap! msgs conj (read-string msg)))

; make private later!
(defn create-netmap [ip port]
{:chan (let [sc (doto (SocketChannel/open (InetSocketAddress. ip port))
(.configureBlocking false))]
(.. sc (socket) (setTcpNoDelay true))
sc)
:write-q nil
:write-tmp nil
:rbuf (ByteBuffer/allocate 2)
:wbuf (doto (ByteBuffer/allocate 2) (.flip))})

(defn connect-to-server [ip port]
(let [nm (create-netmap ip port)]
(update-netmap nm)))

(defn update-network []
(net/write-to-channel @netmap update-netmap)
(net/read-from-channel @netmap update-netmap handle-msg))

A networking module on the server side:
(ns game.networking.server
(:import java.nio.ByteBuffer
(java.nio.channels Selector ServerSocketChannel SocketChannel
SelectionKey)
java.io.IOException)
(:use game.utility
clojure.contrib.repl-utils)
(:require [game.networking :as net]))

; ska vara private sen!
(def- clients (atom {}))
; ska vara private sen!
(def- id-counter (atom 0))
; ska vara private sen!
(def- msgs (atom nil))

(def- connected-addresses (atom nil))

(def- disconnected-clients (atom nil))

; debug
(def- bugg (atom []))

(defn get-msgs []
(let [ms (reverse @msgs)]
(reset! msgs nil)
ms))

(defn send-msg [ids msg]
(dorun (map (fn [id]
(let [new-clients (update-in @clients [id :write-q] conj msg)]
(reset! clients new-clients)))
ids)))

(defn create-server
"Creates a non-blocking TCP server that listens for incoming
connections and, when a client connects, calls f on the new
client's SelectionKey.

The server uses select to check for incoming connections and
to check for incoming data on established connections. Returns
a function that should be called periodically to call select.
The returned function returns the set of selected SelectionKeys."
[port f]
(let [selector (Selector/open)
ssc (doto (ServerSocketChannel/open) (.configureBlocking false))
ss (doto (.socket ssc) (.bind (InetSocketAddress. port)))
selection-key (.register ssc selector SelectionKey/OP_ACCEPT)]
(fn []
(swap! bugg conj (count (.keys selector)))
(.select selector)
(let [keys (.selectedKeys selector)]
; One has to check if the selected keys contains a key, not just the keys flags
(if (and (.contains keys selection-key) (.isAcceptable selection-key))
(let [sc (doto (.accept ssc) (.configureBlocking false))
client-key (doto (.register sc selector (bit-or SelectionKey/OP_READ
SelectionKey/OP_WRITE))
(.attach (swap! id-counter inc)))]
(show (.socket sc))
(flush)
(.. sc (socket) (setTcpNoDelay true))
(f client-key)
(.remove keys selection-key)))
keys))))

(defn- new-client
"Takes a SelectionKey as input and returns a map
of various player-related things."
[selection-key]
{:s-key selection-key
:chan (.channel selection-key)
:write-q nil
:write-tmp nil
:rbuf (ByteBuffer/allocate 2)
:wbuf (doto (ByteBuffer/allocate 2) (.flip))
:id (.attachment selection-key)})

"Adds a new client to players."
[selection-key]
(let [client (new-client selection-key)]
(swap! clients assoc (.attachment selection-key) client)))

(defn- collect-new-msg [msg netmap]
(swap! msgs conj (conj (read-string msg) (netmap :id))))

(defn- update-client-netmap [{id :id :as netmap}]
(swap! clients assoc id netmap))

(defn- disconnect-client [{:keys [id chan]}]
(swap! disconnected-clients conj id)
(.close chan)
(swap! clients dissoc id))

(defn get-disconnected-clients []
(let [dcs @disconnected-clients]
(reset! disconnected-clients nil)
dcs))

(defn update-network
"Calls the fn server, which performs a select operation on the server,
and accepts new incoming connctions. Also reads messages from the clients,
and collect them, in the form of lists, in msgs."
[server]
(let [keys (server)]
(doseq [key keys]
(let [client (@clients (.attachment key))]
(try
(net/read-from-channel client update-client-netmap collect-new-msg))
(if (and (client :write-q) (.isWritable key))
(net/write-to-channel client update-client-netmap))
(catch IOException e (disconnect-client client)))))
(.clear keys)))

### #7Antheus  Members

Posted 23 June 2011 - 05:42 PM

TCP doesn't corrupt your data.

I believe google published an article on errors in their data centers. Data corruption is in the order of 1 per petabyte (maybe even messages) or so. It's absurdly low, but it's there. Only application-level checksums detected those.

It's also highly unlikely it happened here, there are way too many other more likely factors to consider.

However, nio used to have some obscure bugs and unexpected or undefined behavior, some even conflicting official documentation. My bet in this case would be that networking errors are caused by those. They were never fixed even in standard library and most ended up with WONTFIX. They also depend on individual platform stacks, so they are not universally reproducible. Problems are caused by inconsistent implementation of Berkeley socket API and incorrect interpretation of something or another, I forgot.

Ideally, you would go rummaging through Sun's bug tracker for nio related issues and try to ensure they don't occur in Clojure bindings. But that's rather tedious task. Mina (IIRC) project did a framework on top of nio which might contain some more insight into that.

I also seem to remember there being a race condition or synchronization bug with nio selector.

Beside that, there could be a lot wrong in Clojure bindings. The selectors work fine most of the time, but I do recall there being some obscure edge cases that simply aren't handled. I think even most Java examples are broken in this way.

### #8hplus0603  Moderators

Posted 23 June 2011 - 05:44 PM

I'm sending the exact same message about 30000 times or so

(zero? (.remaining rbuf)) (let [len (.. rbuf (flip) (getShort))

Something to consider: The maximum number in a signed short is 32767. If you use a message sequence number or similar, and store it as a short, you would get an error after that value.

Sounds like you have a reproducible case, though. That's good! Print out the number of messages you have gotten every 100 messages or so, and check what the value is after crash. Then set a breakpoint after that number of messages, and re-run the case, so you can debug when the crash happens. Or, if you have access to VMWare Workstation, try using Replay Debugging.

You can also log all the data to a big file after receiving it, for later analysis. You may be able to then pipe that file back into the server to repeat the behavior that clients already had, to reproduce the crash faster so you can debug it.

I'm not that familiar with Clojure (been 20 years since I did Scheme :-) so I didn't take the time to read through all your code, sorry. Maybe someone else on the board?
enum Bool { True, False, FileNotFound };

### #9tufflax  Members

Posted 23 June 2011 - 06:41 PM

TCP doesn't corrupt your data.

I believe google published an article on errors in their data centers. Data corruption is in the order of 1 per petabyte (maybe even messages) or so. It's absurdly low, but it's there. Only application-level checksums detected those.

It's also highly unlikely it happened here, there are way too many other more likely factors to consider.

However, nio used to have some obscure bugs and unexpected or undefined behavior, some even conflicting official documentation. My bet in this case would be that networking errors are caused by those. They were never fixed even in standard library and most ended up with WONTFIX. They also depend on individual platform stacks, so they are not universally reproducible. Problems are caused by inconsistent implementation of Berkeley socket API and incorrect interpretation of something or another, I forgot.

Ideally, you would go rummaging through Sun's bug tracker for nio related issues and try to ensure they don't occur in Clojure bindings. But that's rather tedious task. Mina (IIRC) project did a framework on top of nio which might contain some more insight into that.

I also seem to remember there being a race condition or synchronization bug with nio selector.

Beside that, there could be a lot wrong in Clojure bindings. The selectors work fine most of the time, but I do recall there being some obscure edge cases that simply aren't handled. I think even most Java examples are broken in this way.

Clojure does not use bindings. They are the exact same Java classes.

But OK, that sounds bad...

### #10tufflax  Members

Posted 23 June 2011 - 06:55 PM

I'm sending the exact same message about 30000 times or so

(zero? (.remaining rbuf)) (let [len (.. rbuf (flip) (getShort))

Something to consider: The maximum number in a signed short is 32767. If you use a message sequence number or similar, and store it as a short, you would get an error after that value.

Sounds like you have a reproducible case, though. That's good! Print out the number of messages you have gotten every 100 messages or so, and check what the value is after crash. Then set a breakpoint after that number of messages, and re-run the case, so you can debug when the crash happens. Or, if you have access to VMWare Workstation, try using Replay Debugging.

You can also log all the data to a big file after receiving it, for later analysis. You may be able to then pipe that file back into the server to repeat the behavior that clients already had, to reproduce the crash faster so you can debug it.

I'm not that familiar with Clojure (been 20 years since I did Scheme :-) so I didn't take the time to read through all your code, sorry. Maybe someone else on the board?

The number is the length of the messages, not a sequence number of some kind. If it was off I would notice it right away because I use a ByteArrayInputStream to read the messages back, and it would not work if I didn't give it a byte array with a whole object in it (the byte array is the next <length> bytes of the socketchannel). When I said it was the exact same messages over and over I didn't lie.

### #11tufflax  Members

Posted 23 June 2011 - 08:03 PM

Hm, now the server has run for an hour or so without running into the problem, the client has send over 200 000 messages to it. Not so reproducible after all...

But maybe it's a good idea for me to use a framework such as MINA anyway. Do any of you have any experience with it? Any tips?

Btw, Antheus, I have not been able to find any info on bugs in nio. It sounds strange that Sun (or Oracle?) would just not fix bugs in it. And Mina is built upon it, so it must be manageable somehow? You are making me paranoid.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
# How do you factor ?

Jul 24, 2015

It depends.

#### Explanation:

Here's an incomplete list of pointers:

(1) Do all the terms have a common factor?

If so, separate out the common factor first...

$2 {x}^{2} + 8 x + 8 = 2 \left({x}^{2} + 4 x + 4\right)$

$12 {x}^{2} y - 4 x {y}^{2} + 8 x y = 4 x y \left(3 x - y + 2\right)$

(2) Do all the coefficients add up to $0$?

e.g. $f \left(x\right) = {x}^{2} + 3 x - 4$

Here $f \left(1\right) = 1 + 3 - 4 = 0$. Hence $\left(x - 1\right)$ is a factor of $f \left(x\right)$

(3) Do the coefficients of the even degree terms minus the coefficients of the odd degree terms add up to $0$?

e.g. $f \left(x\right) = {x}^{2} - 3 x - 4$

Here $f \left(- 1\right) = 1 - \left(- 3\right) - 4 = 0$. Hence $\left(x + 1\right)$ is a factor of $f \left(x\right)$

(4) Is the polynomial a difference or sum of squares or cubes?

${a}^{2} - {b}^{2} = \left(a - b\right) \left(a + b\right)$

e.g. $4 {x}^{2} - 9 = \left(2 x - 3\right) \left(2 x + 3\right)$

${a}^{3} - {b}^{3} = \left(a - b\right) \left({a}^{2} + a b + {b}^{2}\right)$

e.g. $8 {x}^{6} - 27 = \left(2 {x}^{2} - 3\right) \left(4 {x}^{4} + 6 {x}^{2} + 9\right)$

${a}^{3} + {b}^{3} = \left(a + b\right) \left({a}^{2} - a b + {b}^{2}\right)$

Note that ${a}^{2} + {b}^{2}$ is only reducible to linear factors with complex coefficients.

${a}^{2} + {b}^{2} = \left(a - i b\right) \left(a + i b\right)$

(5) Is the polynomial recognisable as a perfect square trinomial?

${\left(a + b\right)}^{2} = {a}^{2} + 2 a b + {b}^{2}$

${\left(a - b\right)}^{2} = {a}^{2} - 2 a b + {b}^{2}$

e.g. $4 {x}^{2} - 12 x + 9 = {\left(2 x - 3\right)}^{2}$

(6) Is the polynomial easily factorisable as $\left(x + a\right) \left(x - b\right)$ or similar?

$\left(x + a\right) \left(x - b\right) = {x}^{2} + \left(a - b\right) x - a b$

e.g. ${x}^{2} + x - 12 = \left(x + 4\right) \left(x - 3\right)$ based on the observation that $4 \cdot 3 = 12$ and $4 - 3 = 1$

(7) Check the discriminant for a quadratic

For a quadratic in the form $f \left(x\right) = a {x}^{2} + b x + c$, check the value of the discriminant $\Delta = {b}^{2} - 4 a c$.

If $\Delta > 0$ and is a perfect square, then it may be simplest to use some version of the AC Method or similar to factor the quadratic as it does have rational factors.

If $\Delta > 0$ is not a perfect square, then use the quadratic formula to find the roots ${x}_{1}$ and ${x}_{2}$ of $f \left(x\right) = 0$ and hence factor $f \left(x\right)$ as $a \left(x - {x}_{1}\right) \left(x - {x}_{2}\right)$

If $\Delta = 0$, you have a perfect square trinomial. Look at (5) above.

If $\Delta < 0$, $f \left(x\right)$ has no linear factors with real coefficients. If you allow complex coefficients you can still use the quadratic formula, etc, but the result will be linear factors with complex coefficients.


text:
AgreeStat Analytics

## Unweighted Analysis of Contingency Tables

Input Data Imported from an External Dataset

When analyzing categorical ratings organized in a contingency table, you may either import that data from an external data file (see figure below), or enter it manually in the data grid (see this document).  Here, it is assumed that you are importing your rating data from an external data source.

Play this video to see step by step how a simple unweighted analysis of contingency tables is done.

Basic Analysis of Contingency Table with agreestat360.com, using Imported Data


text:
## Alternative proof of the fact that heapify can be linear-time

As an exercise, I’m trying to prove by myself that constructing a binary heap from an array in-place can be $$O(N)$$. I’ve come up with an idea, but I’m not sure about its correctness.

Firstly, I define the following procedure (pseudocode):

process_node():     if the node has children:         select the child node with the maximum value         if the selected node's value is greater than the value of current node:             swap current node with the selected node

Then I run this procedure on all non-leaf nodes going down level by level in the binary tree view of the array. So the root is processed first, then comes the first level etc. After doing this, a half of leaf nodes become smaller than all of their ancestors. Another run of the procedure on the same nodes settles the other half of the leaves. Thus, they have been put in place in the heap and can be removed from the processing.

The number of leaves is halved, and so is the number of non-leaf nodes. The procedure is run again on new non-leaves, and the process is repeated until all the elements of the array are processed.

The number of nodes on which the procedure is run starts with $$N/2$$ and later is halved. We get a decreasing geometric series with the sum being $$O(N)$$.

Are there any mistakes in my reasoning?

## Meterpreter reverse shell alternative

What can you do if you are behind NAT but can’t do port forwarding and don’t want to pay for a virtual server with internet-facing IP? I read the answer to this question which suggests some tunneling software (e.g. ionide, pwnat) but those have to be installed on the target machine too and you can’t use them with Meterpreter. That question is four years old so are there better alternatives now?

## Alternative to hook_node_access for Media entities (Drupal 8.6)

It seems that hook_node_access does not fire for Media entities. Is there an alternative hook, or some way of forcing Media to use hook_node_access?

## Subsites are redirecting to localhost after alternative access mapping in sharepoint production Environment

Subsites are redirecting to localhost after alternative access mapping in sharepoint production Environment.

    Because of this the public url is redirecting to the default port url.      Please help any one regarding this issue.

Regards,

Surakshith.

## Alternative “File Open” (not stack “DocumentsUi”) for WhatsApp?

DocumentsUI, the AOSP standard “file manager” is quite buggy here (I use Lineage 15.1), especially in the context of multi-user and work profile (meaning it does not show files for other users then the main user and is hence not usable).

For “simple” file browsing, I therefore substituted DocumentsUI app (com.android.documentsui) with com.simplemobiletools.filemanager.pro which works much better.

My issue and the core of the question is, that the glorious “facebook” WhatsApp Manager when attempting to attach files, resorts to opening the intent specifically for com.android.documentsui and fails even to open com.simplemobiletools.filemanager.pro even in the case that it is the only filemanager still installed. Hence I cannot attach files in other users in Whatsapp, due to the buggy DocumentsUI and WhatsApp not being willing/capable/well-enough-designed to make a general “FileOpen” intent, instead of referring directly to com.android.documentsui

I understand that WhatsApp is particularly made very little IT-able persons, who do not care about privacy very much, therefore it is clear that the WhatApp is not geared to allow/accomodate for educated and more able users which might desire to use not the standard com.android.documentsui.

An answer to this question would be to provide an insight which com.android.documentsui would be able to integrate well with WhatsApp Messenger

## Alternative database hosting from Amazon and digital ocean?

Right now amazon cost me 600 usd so im looking to migrate to a more reasonable budget.
I tried digital ocean but because of their limited f… | Read the rest of http://www.webhostingtalk.com/showthread.php?t=1758124&goto=newpost

## Alternative to Android studio [on hold]

I have win 10 with just 4 GB of RAM and minimal requirements for Android studio is 8 GB. Are there any other alternative for that which are comapatible in my RAM?

## Alternative CSS for specific URLs

How can I make an Alternative CSS file only be applied to specific URLs? for instance, only to all pages after “/SitePages”.

Regards

## Alternative Lie bracket on $\chi^{\infty}(M)$ where $M$ is a Riemannian manifold with a symplectic structure

Let $$(M,\omega, g)$$ be a Riemannian symplectic manifold. The poisson bracket of two functions $$f,g$$ is denoted by $$\{f,g\}$$. The Hamiltonian vector field associated to a function $$f$$ is denoted by $$H_f$$.

We define a Lie algebra structure on $$\chi^{\infty}(M)$$ as follows:

$$[X,Y]=H_{\{div(X),div(Y)\} }$$

Question 1: Is the Lie algebra $$\chi^{\infty}(M)/I$$ a simple Lie algebra where $$I$$ is the ideal $$I=\{X\in \chi^{\infty}(M)\mid div(X)=0\}$$

As the second step for this question we would like to change the definition of the lie algebra operation by replacing the Hamiltonian vector field with gradient vector field. But we are not sure that it satisfies the Jackobi identity. So we ask the following question:

Question 2: Under which compatibilty condition between $$\omega$$ and $$g$$, the following operation is a Lie algebra bracket on $$\chi^{\infty}(M)$$:

$$[X,Y]=\nabla_{\{div(X),div(Y)\}}$$ is there an example of this situation with satisfication of the Jackobi identity?


text:
# American Institute of Mathematical Sciences

• Previous Article
A necessary condition for mean-field type stochastic differential equations with correlated state and observation noises
• JIMO Home
• This Issue
• Next Article
Improved approximating $2$-CatSP for $\sigma\geq 0.50$ with an unbalanced rounding matrix
October  2016, 12(4): 1267-1285. doi: 10.3934/jimo.2016.12.1267

## Stability analysis of a delayed social epidemics model with general contact rate and its optimal control

 1 College of Electrical and Information engineering, Lanzhou University of Technology, Lanzhou, Gansu, 730050, China, China 2 Department of Mathematics and Computer Science, Faculty of Sciences Ben M'sik, Hassan II University, P.O. Box 7955, Sidi Othman, Casablanca, Morocco 3 Department of Applied Mathematics, Lanzhou University of Technology, Lanzhou, Gansu, 730050, China

Received  May 2014 Revised  October 2015 Published  January 2016

In this paper, we formulate an alcohol quitting model in which we consider the impact of distributed time delay between contact and infection process by characterizing dynamic nature of alcoholism behaviours, and we generalize the infection rate to the general case, simultaneously, we consider two different control strategies. Next, we discuss the qualities on the model, the existence and boundedness as well as positivity of the equilibrium are involved. Then, under certain proper conditions, we construct appropriate Lyapunov functionals to prove the global stability of alcohol free equilibrium point $E_{0}$ and alcoholism equilibrium $E^{*}$ respectively. Furthermore, the optimal control strategies are derived by proposing an objective functional and using classic Pontryagin's Maximum Principle. Numerical simulations are conducted to support our theoretical results derived in optimal control.
Citation: Xun-Yang Wang, Khalid Hattaf, Hai-Feng Huo, Hong Xiang. Stability analysis of a delayed social epidemics model with general contact rate and its optimal control. Journal of Industrial & Management Optimization, 2016, 12 (4) : 1267-1285. doi: 10.3934/jimo.2016.12.1267
##### References:

show all references

##### References:
 [1] A. M. Elaiw, N. H. AlShamrani, A. Abdel-Aty, H. Dutta. Stability analysis of a general HIV dynamics model with multi-stages of infected cells and two routes of infection. Discrete & Continuous Dynamical Systems - S, 2020  doi: 10.3934/dcdss.2020441 [2] Hai Huang, Xianlong Fu. Optimal control problems for a neutral integro-differential system with infinite delay. Evolution Equations & Control Theory, 2020  doi: 10.3934/eect.2020107 [3] Jianquan Li, Xin Xie, Dian Zhang, Jia Li, Xiaolin Lin. Qualitative analysis of a simple tumor-immune system with time delay of tumor action. Discrete & Continuous Dynamical Systems - B, 2020  doi: 10.3934/dcdsb.2020341 [4] Giuseppina Guatteri, Federica Masiero. Stochastic maximum principle for problems with delay with dependence on the past through general measures. Mathematical Control & Related Fields, 2020  doi: 10.3934/mcrf.2020048 [5] Feifei Cheng, Ji Li. Geometric singular perturbation analysis of Degasperis-Procesi equation with distributed delay. Discrete & Continuous Dynamical Systems - A, 2021, 41 (2) : 967-985. doi: 10.3934/dcds.2020305 [6] Chongyang Liu, Meijia Han, Zhaohua Gong, Kok Lay Teo. Robust parameter estimation for constrained time-delay systems with inexact measurements. Journal of Industrial & Management Optimization, 2021, 17 (1) : 317-337. doi: 10.3934/jimo.2019113 [7] Lars Grüne, Matthias A. Müller, Christopher M. Kellett, Steven R. Weller. Strict dissipativity for discrete time discounted optimal control problems. Mathematical Control & Related Fields, 2020  doi: 10.3934/mcrf.2020046 [8] Xin-Guang Yang, Lu Li, Xingjie Yan, Ling Ding. The structure and stability of pullback attractors for 3D Brinkman-Forchheimer equation with delay. Electronic Research Archive, 2020, 28 (4) : 1395-1418. doi: 10.3934/era.2020074 [9] Pierluigi Colli, Gianni Gilardi, Jürgen Sprekels. Deep quench approximation and optimal control of general Cahn–Hilliard systems with fractional operators and double obstacle potentials. Discrete & Continuous Dynamical Systems - S, 2021, 14 (1) : 243-271. doi: 10.3934/dcdss.2020213 [10] Hong Niu, Zhijiang Feng, Qijin Xiao, Yajun Zhang. A PID control method based on optimal control strategy. Numerical Algebra, Control & Optimization, 2021, 11 (1) : 117-126. doi: 10.3934/naco.2020019 [11] Stefan Ruschel, Serhiy Yanchuk. The spectrum of delay differential equations with multiple hierarchical large delays. Discrete & Continuous Dynamical Systems - S, 2021, 14 (1) : 151-175. doi: 10.3934/dcdss.2020321 [12] Cuicui Li, Lin Zhou, Zhidong Teng, Buyu Wen. The threshold dynamics of a discrete-time echinococcosis transmission model. Discrete & Continuous Dynamical Systems - B, 2020  doi: 10.3934/dcdsb.2020339 [13] Awais Younus, Zoubia Dastgeer, Nudrat Ishaq, Abdul Ghaffar, Kottakkaran Sooppy Nisar, Devendra Kumar. On the observability of conformable linear time-invariant control systems. Discrete & Continuous Dynamical Systems - S, 2020  doi: 10.3934/dcdss.2020444 [14] Soniya Singh, Sumit Arora, Manil T. Mohan, Jaydev Dabas. Approximate controllability of second order impulsive systems with state-dependent delay in Banach spaces. Evolution Equations & Control Theory, 2020  doi: 10.3934/eect.2020103 [15] Fathalla A. Rihan, Hebatallah J. Alsakaji. Stochastic delay differential equations of three-species prey-predator system with cooperation among prey species. Discrete & Continuous Dynamical Systems - S, 2020  doi: 10.3934/dcdss.2020468 [16] Veena Goswami, Gopinath Panda. Optimal customer behavior in observable and unobservable discrete-time queues. Journal of Industrial & Management Optimization, 2021, 17 (1) : 299-316. doi: 10.3934/jimo.2019112 [17] Youming Guo, Tingting Li. Optimal control strategies for an online game addiction model with low and high risk exposure. Discrete & Continuous Dynamical Systems - B, 2020  doi: 10.3934/dcdsb.2020347 [18] Stefan Doboszczak, Manil T. Mohan, Sivaguru S. Sritharan. Pontryagin maximum principle for the optimal control of linearized compressible navier-stokes equations with state constraints. Evolution Equations & Control Theory, 2020  doi: 10.3934/eect.2020110 [19] Bernard Bonnard, Jérémy Rouot. Geometric optimal techniques to control the muscular force response to functional electrical stimulation using a non-isometric force-fatigue model. Journal of Geometric Mechanics, 2020  doi: 10.3934/jgm.2020032 [20] Riccarda Rossi, Ulisse Stefanelli, Marita Thomas. Rate-independent evolution of sets. Discrete & Continuous Dynamical Systems - S, 2021, 14 (1) : 89-119. doi: 10.3934/dcdss.2020304

2019 Impact Factor: 1.366


text:
# What is the shape of an antennas output?

I've been told that EM beams are "gaussian" beams that spread nonlinearly, so the spot size grows faster and faster as you travel further away.

However, when you talk about an antenna, it is defined by a beamwidth expressed in degrees, which makes it seem like there is a constant growth of the spotsize.

So do antennas not output gaussian beams, or does the beamwidth express something different than I am thinking?

• I think "beams that spread nonlinearly, so the spot size grows faster and faster" is wrong or misinterpreted. EM radiation travels in a straight line. As long as you are in the far field, when the pattern has fully formed, the pattern at distance 2X is twice as wide as the pattern at distance X, for any beam shape. – tomnexus Jan 15 '17 at 5:58

Antenna can have many beams depending on shape, Lambertian response from Pad Antenna like SMD LEDs, or Torroidal response from Dipoles. Gaussian is not a common shape for EM Antenna but very common for light sources. A few exceptions perhaps similar are very high gain Helix or high precision parabolic dishes but not perfect Gaussian shape.

Gaussian shapes are more likely to define light beams such as some LED's or Lasers with a Gaussian lens. e.g.

Full Width Half Maximum, FWHM , is equivalent to -3dB power or 50% Iv peak.

where full angle $\Theta=2\theta$ of half angle

## True Gaussian response FWHM can be related to Standard deviation by

• $\Theta_{50\%} =2ln(2)\sigma ≈ 2.455\sigma$ and
• $\Theta_{10\%} ≈ 4.22 \sigma$

Above are 3 different hypothetical Gaussian profiles.

The offset one is not as bad as above but common for IR LED's which is why Half Beamwidth is used for these device specs and Full Beamwidth is used for visible LEDs.

This is because IR LED parabolic lenses are very small and chip angle may be offset. Visible LED's use transparent substrate with parabolic reflectors and only a few are Gaussian in profile. ( although some are very smooth Gaussian-like)

Perhaps some IR LED OEM's are using Full angle now to avoid this confusion.

Here is a smooth Gaussian laser response. 5mw Green laser

For advanced principles on Gaussian Light http://marketplace.idexop.com/store/SupportDocuments/Gaussian_Beam_PropagationWEB.

• Both answers were good, but the added detail and figures made the explanation more clear to me on this one. – Zephyr Jan 16 '17 at 14:20
1. You can express the solution to the electromagnetic wave equation using various different basis functions. Usually we choose a basis set that is convenient for matching up some boundary conditions that apply to our problem. The gaussian beams are a convenient basis set when working with a beam emitted from an aperture. But you might prefer the spherical harmonics if your antenna radiates more isotropically, for example.

TLDR: Gaussian beams are just one choice of how to express the emission from an antenna.

2. The gaussian beams do diverge with an angle, which for the 0th order beam is given by $$\Theta = \frac{\lambda}{\pi w_0}$$ where $\Theta$ is the full angle of divergence (not the half-angle), and $w_0$ is the beam's waist diameter. So there's no contradiction between saying that a radiation pattern is a gaussian beam and saying that it diverges with a known angle.

The shape of antenna output also depends on the type of antenna. In the case of an omnidirectional antenna, electromagnetic radiation is uniform in all the direction and shape is spherical in nature. While in the case of Directional antenna ( like antenna arrays), electromagnetic radiation or energy is more in a particular direction compare to other direction so the shape is like a pencil beam. There are many other specific shapes generated by shaped beam pattern antennas.