text:
# Symmetric matrix

In linear algebra, a symmetric matrix is a square matrix, "A", that is equal to its transpose

:$A = A^\left\{T\right\}. ,!$

The entries of a symmetric matrix are symmetric with respect to the main diagonal (top left to bottom right). So if the entries are written as "A" = ("a""ij"), then:$a_\left\{ij\right\} = a_\left\{ji\right\} ,!$for all indices "i" and "j". The following 3×3 matrix is symmetric:

:

A matrix is called skew-symmetric or antisymmetric if its transpose is the same as its negative. The following 3×3 matrix is skew-symmetric:

:

Every diagonal matrix is symmetric, since all off-diagonal entries are zero. Similarly, each diagonal element of a skew-symmetric matrix must be zero, since each is its own negative. The following matrix is neither symmetric nor skew-symmetric:

:

In linear algebra, a symmetric matrix represents a self-adjoint operator over a real inner product space. The corresponding object for a complex inner product space is a Hermitian matrix with complex-valued entries, which is equal to its conjugate transpose. Therefore, it is generally assumed that a symmetric matrix has real-valued entries.

Symmetric matrices appear naturally in a variety of applications, and typical numerical linear algebra software makes special accommodations for them.

Properties

One of the basic theorems concerning such matrices is the finite-dimensional spectral theorem, which says that any symmetric matrix whose entries are real can be diagonalized by an orthogonal matrix. More explicitly: For every symmetric real matrix "A" there exists a real orthogonal matrix "Q" such that "D" = "Q"T"AQ" is a diagonal matrix. Every symmetric matrix is thus, up to choice of an orthonormal basis, a diagonal matrix.

Another way of stating the real spectral theorem is that the eigenvectors of a symmetric matrix are orthogonal. More precisely, a matrix is symmetric if and only if it has an orthonormal basis of eigenvectors.

Every real symmetric matrix is Hermitian, and therefore all its eigenvalues are real. (In fact, the eigenvalues are the entries in the above diagonal matrix "D", and therefore "D" is uniquely determined by "A" up to the order of its entries.) Essentially, the property of being symmetric for real matrices corresponds to the property of being Hermitian for complex matrices.

Every square real matrix "X" can be written in a unique way as the sum of a symmetric and a
skew-symmetric matrix. This is done in the following way::$X=frac\left\{1\right\}\left\{2\right\}left\left(X+X^ extrm\left\{T\right\} ight\right)+frac\left\{1\right\}\left\{2\right\}left\left(X-X^ extrm\left\{T\right\} ight\right).$(This is true more generally for every square matrix "X" with entries from any field whose characteristic is different from 2.)

The sum and difference of two symmetric matrices is again symmetric, but this is not always true for the product: given symmetric matrices "A" and "B", then "AB" is symmetric if and only if "A" and "B" commute, i.e., if "AB" = "BA". So for integer "n", "An" is symmetric if "A" is symmetric. Two real symmetric matrices commute if and only if they have the same eigenspaces.

If "A"−1 exists, it is symmetric if "A" is symmetric.

Any matrix congruent to a symmetric matrix is again symmetric: if "X" is a symmetric matrix then so is "AXA"T for any matrix "A".

Denote with $langle cdot,cdot angle$ the standard inner product on R"n". The real "n"-by-"n" matrix "A" is symmetric if and only if :$langle Ax,y angle = langle x, Ay angle quad mbox\left\{for all \right\}x,yinBbb\left\{R\right\}^n.$

It should be noted that this definition is independent of the choice of basis, and thus symmetry is a property that depends only on the linear operator A and a choice of inner product. In finite dimensions, the relationship between linear maps or operators and matrices is so close, that one often speaks of them almost interchangeably. But this basis independent definition of symmetry is often important. For example, in differential geometry each tangent space to a manifold may be endowed with an inner product, giving rise to what is called a Riemannian manifold. It may be convenient to work with explicit coordinates, but often it is not. If we do not wish to do so, we may require that tangent spaces be endowed with a non-degenerate symmetric form, and when a basis is fixed, this reduces to the familiar case of a symmetric matrix. Another area where this formulation is important is in infinite dimensional spaces called Hilbert spaces where it is simply not possible to write down a matix representation.

Using the Jordan normal form, one can prove that every square real matrix can be written as a product of two real symmetric matrices, and every square complex matrix can be written as a product of two complex symmetric matrices. (Bosch, 1986)

Every real non-singular matrix can be uniquely factored as the product of an orthogonal matrix and a symmetric positive definite matrix, which is called a polar decomposition. Singular matrices can be also factored, but not uniquely.

A symmetric $n imes n$ matrix is determined by $frac\left\{n\left(n+1\right)\right\}\left\{2\right\}$ scalars. Similarly, a skew-symmetric matrix is determined by $frac\left\{n\left(n-1\right)\right\}\left\{2\right\}$ scalars.

Occurrence

Symmetric real "n"-by-"n" matrices appear as the Hessian of twice continuously differentiable functions of "n" real variables.

Every quadratic form "q" on R"n" can be uniquely written in the form "q"(x) = xT"A"x with a symmetric "n"-by-"n" matrix "A". Because of the above spectral theorem, one can then say that every quadratic form, up to the choice of an orthonormal basis of R"n", "looks like":$q\left(x_1,ldots,x_n\right)=sum_\left\{i=1\right\}^n lambda_i x_i^2$with real numbers λ"i". This considerably simplifies the study of quadratic forms, as well as the study of the level sets {x : "q"(x) = 1} which are generalizations of conic sections.

This is important partly because the second-order behavior of every smooth multi-variable function is described by the quadratic form belonging to the function's Hessian; this is a consequence of Taylor's theorem.

* Hermitian matrix
* Normal matrix
* Hilbert matrix

Other types of symmetry or pattern in square matrices have special names; see for example:

* Circulant matrix
* Hankel matrix
* Toeplitz matrix
* Centrosymmetric matrix

References

*

* [http://www.ocolon.org/editor/template.php?.matrix_split_symm_skew Template for splitting a matrix online into a symmetric and a skew-symmetric addend]

Wikimedia Foundation. 2010.

### Look at other dictionaries:

• symmetric matrix — simetrinė matrica statusas T sritis fizika atitikmenys: angl. symmetric matrix; symmetrical matrix vok. symmetrische Matrix, f rus. симметрическая матрица, f pranc. matrice symétrique, f …   Fizikos terminų žodynas

• symmetric matrix — noun A square matrix that is its own transpose, and is symmetric about the main diagonal …   Wiktionary

• symmetric matrix — noun Date: circa 1949 a matrix that is its own transpose …   New Collegiate Dictionary

• symmetric matrix — noun : a matrix that is its own transpose …   Useful english dictionary

• Skew-symmetric matrix — In linear algebra, a skew symmetric (or antisymmetric) matrix is a square matrix A whose transpose is also its negative; that is, it satisfies the equation:: A T = − A or in component form, if A = ( a ij ):: a ij = − a ji for all i and j .For… …   Wikipedia

• Matrix (mathematics) — Specific elements of a matrix are often denoted by a variable with two subscripts. For instance, a2,1 represents the element at the second row and first column of a matrix A. In mathematics, a matrix (plural matrices, or less commonly matrixes)… …   Wikipedia

• Symmetric bilinear form — A symmetric bilinear form is, as the name implies, a bilinear form on a vector space that is symmetric. They are of great importance in the study of orthogonal polarities and quadrics.They are also more briefly referred to as symmetric forms when …   Wikipedia

• Matrix decomposition — In the mathematical discipline of linear algebra, a matrix decomposition is a factorization of a matrix into some canonical form. There are many different matrix decompositions; each finds use among a particular class of problems. Contents 1… …   Wikipedia

• Symmetric tensor — In mathematics, a symmetric tensor is a tensor that is invariant under a permutation of its vector arguments. Symmetric tensors of rank two are sometimes called quadratic forms. In more abstract terms, symmetric tensors of general rank are… …   Wikipedia

• Matrix exponential — In mathematics, the matrix exponential is a matrix function on square matrices analogous to the ordinary exponential function. Abstractly, the matrix exponential gives the connection between a matrix Lie algebra and the corresponding Lie group.… …   Wikipedia


text:
# Differences

This shows you the differences between two versions of the page.

phy124on:error_and_uncertainty [2013/01/11 18:41]
jhobbs
phy124on:error_and_uncertainty [2013/01/25 11:53] (current)
jhobbs
Line 435: Line 435:

If you do **not** check the box, and, therefore, do **not** force the fit to go through the origin (0,0), the plotting program will find a value for the intercept $b$ and its uncertainty $\Delta b$, and they will be also be printed out in the upper-left corner of the plot.   If you do **not** check the box, and, therefore, do **not** force the fit to go through the origin (0,0), the plotting program will find a value for the intercept $b$ and its uncertainty $\Delta b$, and they will be also be printed out in the upper-left corner of the plot.
+
+==== The max-min method (be careful for "constrained" vs. "unconstrained" fits) ====

Another technique you can use to estimate the error in the slope is to draw "max" and "min" lines. Here we use  Another technique you can use to estimate the error in the slope is to draw "max" and "min" lines. Here we use
-our "eyeball + brain" judgment to draw two lines, one that has the maximum slope that seems reasonable, the "max" line, and another that has the smallest slope that seems reasonable, the "min" line.  We do NOT use the computer to draw these lines, and normally we do the judgment process leading to our choice of suitable "max" and "min" lines on paper, but you can do it more quickly and simply by holding a clear plastic ruler up to the screen of the computer monitor to decide where you think the max and min lines should be.  But please DON'T draw on the screen of the computer monitor!  The surface exposed to you is made of soft plastic and can easily be scratched permanently.  Such scratches distort the image being presented on the screen.  A line is reasonable if it just passes within //most// of the error bars. You then just take two convenient points on the line, and find the change in the dependent variable "$y$" over the change in the independent variable "$x$" to calculate the slope.  Doing this to work out the slope of both lines, max and min, gives you an estimate for the uncertainty in the slope. (Note that if you decide **not** to force your eyeball + brain max and min lines to go through the origin (0,0), you also get an estimate for the uncertainty in the $y$ intercept.  This only makes sense if you did **not** "check the box" when using the plotting tool to do the linear fit.)   +our "eyeball + brain" judgment to draw two lines, one that has the maximum slope that seems reasonable, the "max" line, and another that has the smallest slope that seems reasonable, the "min" line.  We do NOT use the computer to draw these lines, and normally we do the judgment process leading to our choice of suitable "max" and "min" lines on paper, but you can do it more quickly and simply by holding a clear plastic ruler up to the screen of the computer monitor to decide where you think the max and min lines should be.  But please DON'T draw on the screen of the computer monitor!  The surface exposed to you is made of soft plastic and can easily be scratched permanently.  Such scratches distort the image being presented on the screen.  A line is reasonable if it just passes within //most// of the error bars. You then just take two convenient points on the line, and find the change in the dependent variable "$y$" over the change in the independent variable "$x$" to calculate the slope.  Doing this to work out the slope of both lines, max and min, gives you an estimate for the uncertainty in the slope.
+
+=== An example for the "unconstrained" case ===
+
+Note that if you decide **not** to force your eyeball + brain max and min lines to go through the origin (0,0), you also get an estimate for the uncertainty in the $y$ intercept.  This only makes sense if you did **not** "check the box" when using the plotting tool to do the linear fit.  For a nice example of the max-min method being applied to a case where the linear fit is "unconstrained", viz., it is not forced to pass through the origin (0,0), see Fig. 4.1 in Sec. **4.3 Linear Relationships** on pp. 22-23 of
+[[http://uregina.ca/~szymanss/uglabs/companion/Ch4_Graph_Anal.pdf|this document]] from the Department of Physics at the University of Regina.
+
+=== Our example for the "constrained" case ===

The example we show next uses the same pendulum data presented above, but this time you should notice that the plot has been made "the other way", viz., as $L$ (cm) (on the $y$-axis) versus $T^2$ ($s^2$) (on the $x$-axis).  You could do this yourself by entering the data into the plotting tool in the proper way.  A consequence of plotting the data this way is that the large error bars -- those for $T^2$ -- are now in the horizontal direction, not in the vertical direction as they were for the first plot.  This doesn't affect how we draw the "max" and "min" lines, however.  You'll notice that the  max and min lines for the present case, which appear in black on the computer screen versus green for the "best fit" line obtained with the plotting tool and versus red for the "error bars", both pass through the origin, as they should when one is comparing them to a constrained fit obtained by "checking the box", and they both pass through nearly all the "large" error bars, the horizontal ones.  Your eyeball + brain choice of suitable max and min lines would undoubtedly be slightly different from those shown in the figure, but they should be relatively close to these.  For the ones shown in the plot, which are reasonable choices, you may calculate yourself that the max line has a slope of about $\Delta y / \Delta x = 90/3.6 =25$ cm/s$^2$, and the min line has slope of about $\Delta y / \Delta x = 90/3.8 = 23.7$ cm/s$^2$.   Therefore if you used this max-min method you would conclude that the value of the slope is 24.4 $\pm$ 0.7 cm/s$^2$, as compared to the computers estimate of 24.41 $\pm$ 0.16 cm/s$^2$.   The example we show next uses the same pendulum data presented above, but this time you should notice that the plot has been made "the other way", viz., as $L$ (cm) (on the $y$-axis) versus $T^2$ ($s^2$) (on the $x$-axis).  You could do this yourself by entering the data into the plotting tool in the proper way.  A consequence of plotting the data this way is that the large error bars -- those for $T^2$ -- are now in the horizontal direction, not in the vertical direction as they were for the first plot.  This doesn't affect how we draw the "max" and "min" lines, however.  You'll notice that the  max and min lines for the present case, which appear in black on the computer screen versus green for the "best fit" line obtained with the plotting tool and versus red for the "error bars", both pass through the origin, as they should when one is comparing them to a constrained fit obtained by "checking the box", and they both pass through nearly all the "large" error bars, the horizontal ones.  Your eyeball + brain choice of suitable max and min lines would undoubtedly be slightly different from those shown in the figure, but they should be relatively close to these.  For the ones shown in the plot, which are reasonable choices, you may calculate yourself that the max line has a slope of about $\Delta y / \Delta x = 90/3.6 =25$ cm/s$^2$, and the min line has slope of about $\Delta y / \Delta x = 90/3.8 = 23.7$ cm/s$^2$.   Therefore if you used this max-min method you would conclude that the value of the slope is 24.4 $\pm$ 0.7 cm/s$^2$, as compared to the computers estimate of 24.41 $\pm$ 0.16 cm/s$^2$.

format: plain


text:
real-analysis-hw1-with-solution-2007-9-11 - Solutions to Homework 1 1(10 points Let Q be the set of all rationals in the interval[0 1 Let S ={I1 I2 Im

# real-analysis-hw1-with-solution-2007-9-11 - Solutions to...

• Notes
• 2

This preview shows page 1 - 2 out of 2 pages.

Solutions to Homework 1 1. (10 points) Let Q be the set of all rationals in the interval [0 , 1] . Let S = { I 1 , I 2 , ..., I m } be a finite collection of closed intervals covering Q. Show that m X k =1 v ( I k ) 1 . (0.1) On the other hand, for any ε > 0 , one can fi nd S = { I 1 , I 2 , ..., I m , · · ·} , which is a count- able collection of closed intervals covering Q, such that X k =1 v ( I k ) < ε. (0.2) In particular, (0.2) implies that | Q | e = 0 . (Now you see the di ff erence between the use of ”finite cover” and ”countable cover” .) Solution: For (0.1), we fi rst assume that the intervals I 1 , I 2 , ... , I m are nonoverlapping . In such case we clearly have (0.1). For arbitrary intervals I 1 , I 2 , ... , I m with overlapping, one can throw away the over- lapping part and the remaining nonoverlapping part, which we denote it as J 1 , J 2 , ... , J n , satis fi es P n k =1 v ( J k ) 1 . Therefore we have (0.1). For (0.2), it has been done in class. ¤ 2. (10 points) Find a set E R with outer measure zero and a function f : E R such that f is continuous on E and f ( E ) = [0 , 1] . This exercise says that a


text:
# meet continuous

Let $L$ be a meet semilattice. We say that $L$ is meet continuous if

1. 1.

for any monotone net $D=\{x_{i}\mid i\in I\}$ in $L$, its supremum $\bigvee D$ exists, and

2. 2.

for any $a\in L$ and any monotone net $\{x_{i}\mid i\in I\}$,

 $a\wedge\bigvee\{x_{i}\mid i\in I\}=\bigvee\{a\wedge x_{i}\mid i\in I\}.$

A monotone net $\{x_{i}\mid i\in I\}$ is a net $x:I\to L$ such that $x$ is a non-decreasing function; that is, for any $i\leq j$ in $I$, $x_{i}\leq x_{j}$ in $L$.

Note that we could have replaced the first condition by saying simply that $D\subseteq L$ is a directed set. (A monotone net is a directed set, and a directed set is a trivially a monotone net, by considering the identity function as the net). It’s not hard to see that if $D$ is a directed subset of $L$, then $a\wedge D:=\{a\wedge x\mid x\in D\}$ is also directed, so that the right hand side of the second condition makes sense.

Dually, a join semilattice $L$ is join continuous if its dual (as a meet semilattice) is meet continuous. In other words, for any antitone net $D=\{x_{i}\mid i\in I\}$, its infimum $\bigwedge D$ exists and that

 $a\vee\bigwedge\{x_{i}\mid i\in I\}=\bigwedge\{a\vee x_{i}\mid i\in I\}.$

An antitone net is just a net $x:I\to L$ such that for $i\leq j$ in $I$, $x_{j}\leq x_{i}$ in $L$.

Remarks.

• A meet continuous lattice is a complete lattice, since a poset such that finite joins and directed joins exist is a complete lattice (see the link below for a proof of this).

• Let a lattice $L$ be both meet continuous and join continuous. Let $\{x_{i}\mid i\in I\}$ be any net in $L$. We define the following:

 $\overline{\lim}\ x_{i}=\bigwedge_{j\in I}\{\bigvee_{j\leq i}x_{i}\}\qquad\mbox% { and }\qquad\underline{\lim}\ x_{i}=\bigvee_{j\in I}\{\bigwedge_{i\leq j}x_{i}\}$

If there is an $x\in L$ such that $\overline{\lim}\ x_{i}=x=\underline{\lim}\ x_{i}$, then we say that the net $\{x_{i}\}$ order converges to $x$, and we write $x_{i}\to x$, or $x=\lim\ x_{i}$. Now, define a subset $C\subseteq L$ to be closed (in $L$) if for any net $\{x_{i}\}$ in $C$ such that $x_{i}\to x$ implies that $x\in C$, and open if its set complement is closed, then $L$ becomes a topological lattice. With respect to this topology, meet $\wedge$ and join $\vee$ are easily seen to be continuous.

## References

• 1 G. Birkhoff, Lattice Theory, 3rd Edition, Volume 25, AMS, Providence (1967).
• 2 G. Gierz, K. H. Hofmann, K. Keimel, J. D. Lawson, M. W. Mislove, D. S. Scott, Continuous Lattices and Domains, Cambridge University Press, Cambridge (2003).
• 3 G. Grätzer, General Lattice Theory, 2nd Edition, Birkhäuser (1998).
 Title meet continuous Canonical name MeetContinuous Date of creation 2013-03-22 16:36:41 Last modified on 2013-03-22 16:36:41 Owner CWoo (3771) Last modified by CWoo (3771) Numerical id 12 Author CWoo (3771) Entry type Definition Classification msc 06A12 Classification msc 06B35 Synonym order convergence Related topic CriteriaForAPosetToBeACompleteLattice Related topic JoinInfiniteDistributive Defines join continuous Defines order converges


text:
# Make a golfing language [closed]

In this challenge, you get to create a language. Although you have to provide code in other languages, you will only be rated based on the language. Here are the requirements.

1. You must invent a programming language that is Turing complete.
2. You will choose a real (as in existed before this question did) language. It must be a different paradigm then the made up language.
3. You will write a boot strapping compiler. This means you write a program in your new language, that will take code in your new language, and translate it to code in your real language.
4. So people can run it initially, you will provide an interpreter (or compiler) in a real language (which may or may not be written the real language you choose above) to run programs in the new language. This does not need to be golfed.

Note: Your language can't have builtin functions for generating code in the real language. This basically means that if the real language were proprietary, your language wouldn't violate its copyright by making it to easy to generate its code.

Scoring:

Your score is the size of your compiler. Your will find your programs' sizes using roundup(s*log_2(a)) where s is the number of characters in your program and a is the number of available characters in your language (meaning huge penalties if you use Chinese characters or something.)

Tip: String characters count too, so if you are looking to really shrink how many characters are available, you will need to find a way to represent strings with few characters.

Smallest score wins!

So in summary, you invent a turing-complete language X. Then you implement an interpreter or compiler for it in Y. Finally, you implement a compiler for X in X itself. (Based on a comment from Victor.)

## closed as too broad by Justin, plannapus, manatwork, Peter Taylor, VisioNFeb 25 '14 at 13:46

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Well, this will take a considerably large amount of time... – Ismael Miguel Feb 24 '14 at 23:50
• What if the language isn't character based, like Piet? – Victor Stafusa Feb 25 '14 at 0:01
• So this is basically 1. Invent a turing-complete language X. 2. Implement an interpreter or compiler for it in Y. 3. Implement a compiler for X in X itself. Got it right? – Victor Stafusa Feb 25 '14 at 0:11
• According to the rules, taking C and swapping { and } would be a valid entry? You may have a tough time coming up with a definitive line for how different the languages have to be. – Kendall Frey Feb 25 '14 at 0:45
• Aw man, why is this closed? It's one of the only genuinely interesting challenges I've seen on this site. – Nathaniel Jul 1 '14 at 10:18

## Brainfuckoff -> Javascript, 527 characters, 3463 points

My language, Brainfuckoff is a brainfuck-derived language with the following changes:

• It has a new instruction * which sends everything in input to the output, until the end-of-input is reached.
• It has a new instruction ^ which sends everything following this and before the following backtick to the output.
• It takes a line of the input at a single shot in the start of the program, consuming each char with the , instruction.

So, here is a partially-golfed javascript compiler for my language:

function bfg(j){
w=String.fromCharCode;
r='(function(n){m=[];p=0;c=0;t=n.substring(0,0);';
for(x=0;x<j.length;x++){
q=j.charCodeAt(x);
if(q==91)r+='while(~~m[p]){';
if(q==93)r+='}';
if(q==62)r+='p++;';
if(q==60)r+='p--;';
if(q==43)r+='m[p]=1+~~m[p];';
if(q==45)r+='m[p]=-1+~~m[p];';
if(q==46)r+='t+=String.fromCharCode(~~m[p]);';
if(q==44)r+='if(c<n.length)m[p]=n.charAt(c++);';
if(q==94){z=j.indexOf(w(96),x+1);r+='t+='+w(34)+j.substring(x+1,z)+w(34)+';';x=z}
if(q==42)r+='t+=n.substring(c);c=n.length;'
}
return r+'return t})'
}

Here is a brainfuck Hello World program:

++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.

Compiling it:

program = '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.';
jsprogram = bfg(program);

The output:

 (function(n){m=[];p=0;c=0;t=n.substring(0,0);m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];while(~~m[p]){p++;m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];while(~~m[p]){p++;m[p]=1+~~m[p];m[p]=1+~~m[p];p++;m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];p++;m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];p++;m[p]=1+~~m[p];p--;p--;p--;p--;m[p]=-1+~~m[p];}p++;m[p]=1+~~m[p];p++;m[p]=1+~~m[p];p++;m[p]=-1+~~m[p];p++;p++;m[p]=1+~~m[p];while(~~m[p]){p--;}p--;m[p]=-1+~~m[p];}p++;p++;t+=String.fromCharCode(~~m[p]);p++;m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];t+=String.fromCharCode(~~m[p]);m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];t+=String.fromCharCode(~~m[p]);t+=String.fromCharCode(~~m[p]);m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];t+=String.fromCharCode(~~m[p]);p++;p++;t+=String.fromCharCode(~~m[p]);p--;m[p]=-1+~~m[p];t+=String.fromCharCode(~~m[p]);p--;t+=String.fromCharCode(~~m[p]);m[p]=1+~~m[p];m[p]=1+~~m[p];m[p]=1+~~m[p];t+=String.fromCharCode(~~m[p]);m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];t+=String.fromCharCode(~~m[p]);m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];m[p]=-1+~~m[p];t+=String.fromCharCode(~~m[p]);p++;p++;m[p]=1+~~m[p];t+=String.fromCharCode(~~m[p]);p++;m[p]=1+~~m[p];m[p]=1+~~m[p];t+=String.fromCharCode(~~m[p]);return t})

Running that:

program = '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.';
input = '';
jsprogram = bfg(program);

The output:

Hello World!

This other brainfuckoff's Hello World is simpler:

program = '^Hello World!'
input = '';
jsprogram = bfg(program);

The output:

Hello World!

Great, now a compiler of brainfuckoff to javascript written in brainfuckoff (527 characters):

^(function(j){w=String.fromCharCode;r='(function(n){m=[];p=0;c=0;t=n.substring(0,0);';for(x=0;x<j.length;x++){q=j.charCodeAt(x);if(q==91)r+='while(~~m[p]){';if(q==93)r+='}';if(q==62)r+='p++;';if(q==60)r+='p--;';if(q==43)r+='m[p]=1+~~m[p];';if(q==45)r+='m[p]=-1+~~m[p];';if(q==46)r+='t+=String.fromCharCode(~~m[p]);'; if(q==44)r+='if(c<n.length)m[p]=n.charAt(c++);';if(q==94){z=j.indexOf(w(96),x+1);r+='t+='+w(34)+j.substring(x+1,z)+w(34)+';';x=z}if(q==42)r+='t+=n.substring(c);c=n.length;'}return eval(r+'return t})')})('*^')

Compiling the compiler:

program = "^(function(j){w=String.fromCharCode;r='(function(n){m=[];p=0;c=0;t=n.substring(0,0);';for(x=0;x<j.length;x++){q=j.charCodeAt(x);if(q==91)r+='while(~~m[p]){';if(q==93)r+='}';if(q==62)r+='p++;';if(q==60)r+='p--;';if(q==43)r+='m[p]=1+~~m[p];';if(q==45)r+='m[p]=-1+~~m[p];';if(q==46)r+='t+=String.fromCharCode(~~m[p]);'; if(q==44)r+='if(c<n.length)m[p]=n.charAt(c++);';if(q==94){z=j.indexOf(w(96),x+1);r+='t+='+w(34)+j.substring(x+1,z)+w(34)+';';x=z}if(q==42)r+='t+=n.substring(c);c=n.length;'}return eval(r+'return t})')})('*^')";
jsprogram = bfg(program);

The compiled compiler:

(function(n){m=[];p=0;c=0;t=n.substring(0,0);t+="(function(j){w=String.fromCharCode;r='(function(n){m=[];p=0;c=0;t=n.substring(0,0);';for(x=0;x<j.length;x++){q=j.charCodeAt(x);if(q==91)r+='while(~~m[p]){';if(q==93)r+='}';if(q==62)r+='p++;';if(q==60)r+='p--;';if(q==43)r+='m[p]=1+~~m[p];';if(q==45)r+='m[p]=-1+~~m[p];';if(q==46)r+='t+=String.fromCharCode(~~m[p]);'; if(q==44)r+='if(c<n.length)m[p]=n.charAt(c++);';if(q==94){z=j.indexOf(w(96),x+1);r+='t+='+w(34)+j.substring(x+1,z)+w(34)+';';x=z}if(q==42)r+='t+=n.substring(c);c=n.length;'}return eval(r+'return t})')})('";t+=n.substring(c);c=n.length;t+="')";return t})

Running the compiled compiler to compile the first Hello World:

program1 = "^(function(j){w=String.fromCharCode;r='(function(n){m=[];p=0;c=0;t=n.substring(0,0);';for(x=0;x<j.length;x++){q=j.charCodeAt(x);if(q==91)r+='while(~~m[p]){';if(q==93)r+='}';if(q==62)r+='p++;';if(q==60)r+='p--;';if(q==43)r+='m[p]=1+~~m[p];';if(q==45)r+='m[p]=-1+~~m[p];';if(q==46)r+='t+=String.fromCharCode(~~m[p]);'; if(q==44)r+='if(c<n.length)m[p]=n.charAt(c++);';if(q==94){z=j.indexOf(w(96),x+1);r+='t+='+w(34)+j.substring(x+1,z)+w(34)+';';x=z}if(q==42)r+='t+=n.substring(c);c=n.length;'}return eval(r+'return t})')})('*^')";
jsprogram1 = bfg(program1);
input1 = '++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.'
jsprogram2 = eval(jsprogram1)(input1);
input2 = '';

The output:

Hello World!

Calculating the score:

roundup(527 * log_2(asciiCharOf('~') - asciiCharOf(' ') + 1))
roundup(527 * log_2(126 - 32 + 1))
roundup(527 * log_2(95))
roundup(527 * 6.5698556083309478416638388523962)
roundup(3462.3139055904095125568430752128)
3463

Note: There are indeed some ways to reduce the size of the interpreter in maybe ~20%. But this was already hard enough to do for me.

• Very nice, exactly what I intended. You rounded up incorrectly though. – PyRulez Feb 25 '14 at 15:11
• @PyRulez Fixed. Sorry for the mistake, I was a bit nervous at the time. – Victor Stafusa Feb 25 '14 at 15:17
• @PyRulez Since it is unlikely that this question will get any more attention, and since my answer is the only answer that is complete, detailed, not abusing the scoring, and meeting your expectations, could you please accept it? – Victor Stafusa Feb 27 '14 at 23:51
• Nice name (just get rid of brain from it) – User that is not a user Apr 15 '18 at 0:23

## Score = (Number too long for an SE post * log_2(1)) = 0

Given how the score is weighted by the number of characters available in the language, the less the better:

1.) My language (X) is called Compressed Unary. It is similar to Unary in that it only has one available character in the language. Unlike Unary, it uses the number "1" instead of "0". It improves on Unary by assigning the operators in a different bit order, with lower values assigned to operations that occur more often. It is proven to be Turing complete in that it can be trivially converted to Brainfuck.

The code is a string of 1s, and the length of the code determines the logic (see the description of Unary from the link above for more details. The encoding is as follows:

Brainfuck   Binary
+           (1000)
-           (1001)
>           (1010)
<           (1011)
.           (1100)
,           (1101)
[           (1110)
]           (1111)

All the binary is combined from left to right and the resulting number is how many "1"s should be in the source code. This should yield much smaller code that Unary, but will absolutely suck as a golfing language. Much better for code bowling (see the compiler below and you'll see why).

2.) I chose C#. It was easy, I could port an existing BF implementation (props to the original author), and given that log_2(1) is zero, the length of the code doesn't have any effect my score.

3.) The source code is too long to include here (stupid 30k character limit), in fact the number is too long to post here (it is 123411 characters in hex notation). The following link will give you the number in hex. You can create the bootstrap compiler simply by typing that many ones in a text file. Like I said, this completely sucks as a golfing language. It's much worse than C# for golfing.

4.) Once you type out the source code (I'd include a download link, but it would take way too long even on a fast fiber connection), you can run it through the following interpreter:

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;

namespace CompressedUnary
{
class Program
{
static void Main(string[] args)
{
BigInteger code = new BigInteger(0);
int next = 0;

try
{
using (FileStream source = new FileStream(args[0], FileMode.Open, FileAccess.Read))
{
while (next != -1)
{
if (next != 49)
{
System.Console.WriteLine("Syntax error.");
break;
}
code += 1;
}
}
}
catch (FileNotFoundException oops)
{
Console.WriteLine(oops.Message);
}

if (next == -1)
{
string processed = PreProcess(code);
Interpreter runner = new Interpreter(Console.OpenStandardInput(), Console.OpenStandardOutput());
runner.Run(processed);
}
Console.WriteLine("Done");
}

static string PreProcess(BigInteger input)
{
StringBuilder output = new StringBuilder("");
BigInteger current;

while (input > 0)
{
BigInteger.DivRem(input, 16, out current);
switch ((int)current)
{
case 0:
output.Append("+");
break;
case 1:
output.Append("-");
break;
case 2:
output.Append(">");
break;
case 3:
output.Append("<");
break;
case 4:
output.Append(".");
break;
case 5:
output.Append(",");
break;
case 6:
output.Append("[");
break;
case 7:
output.Append("]");
break;
}
}
return output.ToString();
}

enum ILCode : byte
{
NextCell = (byte)'>',
LastCell = (byte)'<',
Increment = (byte)'+',
Decrement = (byte)'-',
Output = (byte)'.',
Input = (byte)',',
BeginLoop = (byte)'[',
EndLoop = (byte)']'
}

class Machine
{
public int pointer = 0;
private int cell = 0;
private readonly Stack<int> stack = new Stack<int>();

public Machine(int memory)
{
cells = new byte[memory];
}

public byte CurrentCell
{
get { return cells[cell]; }
set { cells[cell] = value; }
}

public void Increment()
{
if (CurrentCell == 255)
CurrentCell = 0;
else
CurrentCell++;
pointer++;
}

public void Decrement()
{
if (CurrentCell == 0)
CurrentCell = 255;
else
CurrentCell--;
pointer++;
}

public void NextCell()
{
cell++;
pointer++;
}

public void LastCell()
{
cell--;
pointer++;
}

public void BeginLoop()
{
stack.Push(pointer);
pointer++;
}

public void EndLoop()
{
if (CurrentCell == 0)
pointer++;
else
pointer = stack.Pop();
}
}

class Interpreter
{

public Interpreter(Stream ioin, Stream ioout, int memorySize = 30000)
{
output = ioout;
machine = new Machine(memorySize);
actions = new Dictionary<byte, Action>
{
{(byte) ILCode.BeginLoop, machine.BeginLoop},
{(byte) ILCode.EndLoop, machine.EndLoop},
{(byte) ILCode.Increment, machine.Increment},
{(byte) ILCode.Decrement, machine.Decrement},
{(byte) ILCode.NextCell, machine.NextCell},
{(byte) ILCode.LastCell, machine.LastCell},
{(byte) ILCode.Input, InputCurrentByte},
{(byte) ILCode.Output, OutputCurrentByte},
};
}

public void Run(string program)
{
byte[] instructions = program.Select(c => (byte)c).Where(b => actions.ContainsKey(b)).ToArray();
while (machine.pointer < instructions.Length)
{
Action action = actions[instructions[machine.pointer]];
action.Invoke();
}
byte[] newLine = Environment.NewLine.Select(c => (byte)c).ToArray();
output.Write(newLine, 0, newLine.Length);
}

private void InputCurrentByte()
{
machine.CurrentCell = next;
machine.pointer++;
}

private void OutputCurrentByte()
{
output.WriteByte(machine.CurrentCell);
machine.pointer++;
}
}
}
}
`

FORE!

• Nice exploit. I should have added log_2 of the length, but too late now. – PyRulez Feb 25 '14 at 13:57


text:
# Conformal field theories at nonzero temperature: Operator product expansions, Monte Carlo, and holography Academic Article

•
• Overview
•
• Research
•
• Identity
•
•
• View All
•

### abstract

• We compute the non-zero temperature conductivity of conserved flavor currents in conformal field theories (CFTs) in 2+1 spacetime dimensions. At frequencies much greater than the temperature, $\hbar\omega>> k_B T$, the $\omega$ dependence can be computed from the operator product expansion (OPE) between the currents and operators which acquire a non-zero expectation value at T > 0. Such results are found to be in excellent agreement with quantum Monte Carlo studies of the O(2) Wilson-Fisher CFT. Results for the conductivity and other observables are also obtained in vector 1/N expansions. We match these large $\omega$ results to the corresponding correlators of holographic representations of the CFT: the holographic approach then allows us to extrapolate to small $\hbar \omega/(k_B T)$. Other holographic studies implicitly only used the OPE between the currents and the energy-momentum tensor, and this yields the correct leading large $\omega$ behavior for a large class of CFTs. However, for the Wilson-Fisher CFT a relevant "thermal" operator must also be considered, and then consistency with the Monte Carlo results is obtained without a previously needed ad hoc rescaling of the T value. We also establish sum rules obeyed by the conductivity of a wide class of CFTs.

### publication date

• December 1, 2014


text:
Welcome to symthic forums! We would love if you'd register!
You don't have to be expert in bit baking, everyone is more than welcome to join our community.

You are not logged in.

## CTE Battlefield Roots Initiative

Hey! If this is your first visit on symthic.com, also check out our weapon damage charts.
Currently we have charts for Battlefield 3, Call of Duty: Black Ops 2, Medal of Honor: Warfighter and Call of Duty: Modern Warfare 3

PvF 2017 Champion

Posts: 7,069

Date of registration
: Apr 3rd 2012

Platform: PC

Battlelog:

Reputation modifier: 19

Wednesday, March 29th 2017, 10:37am

The Ammo Box will continue to be irrelevant up to the moment it becomes necessary
Data Browser

Passive Spotting is the future!

With this, I'll rid MGO3 of infestation. Sans bad gameplay MGO3 will be torn asunder. And then it shall be free. People will suffer, of course - a phantom pain.

Reddit and Konami will rewrite the records... And I will be demonized in human memory. But... The thirst for good gameplay that I have planted will infest MGO3. No one can stop it now. The Rebalance Mod will unleash that thirst unto the future.

Are you a scrub?

### Quoted from "blahdy"

If it flies, it dies™.

Posts: 1,920

Date of registration
: Jan 12th 2014

Platform: PC

Battlelog:

Reputation modifier: 14

Wednesday, March 29th 2017, 10:45am

### Quoted from "VincentNZ"

Yeah but he will elementally disagree, I said ammo was rarely an issue, because of death mostly and finding an ammo crate wasn't either. Also you could always look for a suport player and hit him with an axe.

With the new system they would have shifted the focus from looking for a support, to the support looking for the guys to resupply them so they could do their job again. I still think the way to go is to buff the ammo crates and pouches to allow a mobile and therefore constant resupply, to not break the flow of the game.
It does also help with balancing potentially very strong gagdets, like the K-Bullet.
In the proposed system overcharged K-bullets were blatantly OP - lol planes. For assaults constantly dying they were looking at a short pool on ammo that would eventually find them either support hunting or sitting around for the passive to kick back to full. Why? Getting sent back to the respawn screen always seemed like a fair way to get a 100% capable toon again to me.

I'm actually in no way against the concept of passive regen, especially for stuff that is class core like the flare gun. The flare gun absolutely should have passive regen so that can have some sort of meaningful uptime without hunting down a support player and poking him until he drops. That has been a consistent issue for the throwable recon gadgets for quite some time.

Posts: 1,920

Date of registration
: Jan 12th 2014

Platform: PC

Battlelog:

Reputation modifier: 14

Wednesday, March 29th 2017, 10:47am

### Quoted from "NoctyrneSAGA"

The Ammo Box will continue to be irrelevant up to the moment it becomes necessary
Support is in no way an underplayed class in BF1. The pouches let you mash Q to throw anyone a packet. If people just played the game with some modicum of competence reliable re-supply would be a non-issue.

PvF 2017 Champion

Posts: 7,069

Date of registration
: Apr 3rd 2012

Platform: PC

Battlelog:

Reputation modifier: 19

Wednesday, March 29th 2017, 10:52am

The doublethink assumption that Ammo Boxes are always present and never present is why they are the sole source of ammo yet players are spawned with so much ammo they will not really need a box
Data Browser

Passive Spotting is the future!

With this, I'll rid MGO3 of infestation. Sans bad gameplay MGO3 will be torn asunder. And then it shall be free. People will suffer, of course - a phantom pain.

Reddit and Konami will rewrite the records... And I will be demonized in human memory. But... The thirst for good gameplay that I have planted will infest MGO3. No one can stop it now. The Rebalance Mod will unleash that thirst unto the future.

Are you a scrub?

### Quoted from "blahdy"

If it flies, it dies™.

Posts: 3,291

Date of registration
: Apr 26th 2013

Platform: PS4

Location: Arizona, USA

Reputation modifier: 15

Wednesday, March 29th 2017, 10:54am

You still can only shoot one K-Bullet at a time. Since they don't behave like normal bullets and each one has to be re-chambered, it gives planes a shitload of time to get the hell out of dodge, especially for a good pilot. Plus you're not even guaranteed to hit every shot you can get in. Overcharged K-Bullets would be no different than non-overcharged K-Bullets against planes. Tanks? Sure, but not planes.
To Aim Assist or not to Aim Assist, that is the question.

### Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38

AccelerationInputThreshold 0.98
AccelerationMultiplier 5.0
AccelerationDamping 4.0
AccelerationTimeThreshold 0.15
SquaredAcceleration 0.0
MaxAcceleration::Vec2
x 2.0
y 2.0
YawSpeedStrength 1.0
PitchSpeedStrength 1.0
AttractDistanceFallOffs::Vec2
x 1.0
y 1.2
AttractSoftZone 0.75
AttractUserInputMultiplier 0.45
AttractUserInputMultiplier_NoZoom 0.5
AttractOwnSpeedInfluence 0.0
AttractTargetSpeedInfluence 0.85
AttractOwnRequiredMovementForMaximumAttract 0.0
AttractStartInputThreshold 0.1
AttractMoveInputCap 0.0
AttractYawStrength 1.0
AttractPitchStrength 0.34
MaxToTargetAngle 45.0
MaxToTargetXZAngle 45.0
ViewObstructedKeepTime 0.0
SnapZoomLateralSpeedLimit 1000.0
SnapZoomTime 0.2
SnapZoomPostTimeNoInput 0.2
SnapZoomPostTime 0.2
SnapZoomReticlePointPriority 999
SnapZoomAutoEngageTime 0.0
SnapZoomBreakTimeAtMaxInput 0.2
SnapZoomBreakMaxInput 0.2
SnapZoomBreakMinAngle 90.0
SnapZoomSpamGuardTime 1.2
SoldierBackupSkeletonCollisionData *nullGuid*
CheckBoneCenterOnlyDistance 40.0

### Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

AccelerationInputThreshold 0.98
AccelerationMultiplier 5.0
AccelerationDamping 4.0
AccelerationTimeThreshold 0.15
SquaredAcceleration 0.0
MaxAcceleration::Vec2
x 2.0
y 2.0
YawSpeedStrength 1.0
PitchSpeedStrength 1.0
AttractDistanceFallOffs::Vec2
x 1.0
y 1.2
AttractSoftZone 0.0
AttractUserInputMultiplier 1.0
AttractUserInputMultiplier_NoZoom -1.0
AttractOwnSpeedInfluence 0.0
AttractTargetSpeedInfluence 0.0
AttractOwnRequiredMovementForMaximumAttract 0.0
AttractStartInputThreshold 0.0
AttractMoveInputCap 0.0
AttractYawStrength 0.0
AttractPitchStrength 0.0
MaxToTargetAngle 45.0
MaxToTargetXZAngle 45.0
ViewObstructedKeepTime 0.0
SnapZoomLateralSpeedLimit 1000.0
SnapZoomTime 0.2
SnapZoomPostTimeNoInput 0.0
SnapZoomPostTime 0.0
SnapZoomReticlePointPriority 999
SnapZoomAutoEngageTime 0.0
SnapZoomBreakTimeAtMaxInput -1.0
SnapZoomBreakMaxInput 0.2
SnapZoomBreakMinAngle 90.0
SnapZoomSpamGuardTime 0.5
SoldierBackupSkeletonCollisionData *nullGuid*
CheckBoneCenterOnlyDistance 40.0
DisableForcedTargetRecalcDistance 7.0

### Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39

 AccelerationInputThreshold 0.98
AccelerationMultiplier 5.0
AccelerationDamping 4.0
AccelerationTimeThreshold 0.15
SquaredAcceleration 0.0
MaxAcceleration::Vec2
x 2.0
y 2.0
YawSpeedStrength 1.0
PitchSpeedStrength 1.0
AttractDistanceFallOffs::Vec2
x 1.0
y 1.2
AttractSoftZone 0.75
AttractUserInputMultiplier 0.45
AttractUserInputMultiplier_NoZoom 0.5
AttractOwnSpeedInfluence 0.0
AttractTargetSpeedInfluence 0.85
AttractOwnRequiredMovementForMaximumAttract 0.0
AttractStartInputThreshold 0.1
AttractMoveInputCap 0.0
AttractYawStrength 1.0
AttractPitchStrength 0.34
MaxToTargetAngle 45.0
MaxToTargetXZAngle 45.0
ViewObstructedKeepTime 0.0
SnapZoomLateralSpeedLimit 1000.0
SnapZoomTime 0.2
SnapZoomPostTimeNoInput 0.0
SnapZoomPostTime 0.0
SnapZoomReticlePointPriority 999
SnapZoomAutoEngageTime 0.0
SnapZoomBreakTimeAtMaxInput -1.0
SnapZoomBreakMaxInput 0.2
SnapZoomBreakMinAngle 90.0
SnapZoomSpamGuardTime 0.5
SoldierBackupSkeletonCollisionData *nullGuid*
CheckBoneCenterOnlyDistance 40.0
DisableForcedTargetRecalcDistance 7.0

### Quoted from "Zer0Cod3x"

the Sebstalder is quiet good since it can 3hit kill at any distanc ,but In my opinion i actually thikn the sweeper is better, its got a really really fast firerate that can beat alll those Noobmaticos, Helregall adn shitguns in close quarters , and its also really accurate out to like l;ong range,. overall great allround gun, jsut my 2\$ tho

### My "Contributions"

Posts: 105

Date of registration
: Oct 28th 2016

Platform: PS4

Location: California

Battlelog:

Reputation modifier: 3

Wednesday, March 29th 2017, 12:22pm

Considering that the passionate (and ignorant) push for highly restrictive gameplay from the community is never going to go away, we might as well work on a compromise.

If the community really does not want passive regeneration of health or ammo, why not just add health and ammo stations to every map, each being some degree away from the objectives? It's a very common FPS feature. In this way, Medics and Supports still won't be overly crucial to a team's success in a game and complaints about "lack of realism" and "reduction in teamwork" can be silenced. The only tradeoff is that positioning after disengagement remains somewhat restrictive. Players will now be forced to run to specific areas of the map to re-reach full combat potential, without having to count on the competence of their teammates to reinstate them.

We'd also have to consider how fast these stations can regenerate health, as well as what should happen if engagements around and for these resources occur. Will regeneration cease for all players near the station when suppressed or taking damage? Will it be slowed? Can these stations be destroyed, and how long will it take before they respawn? An interesting topic I'd like to discuss and hear criticism/positive feedback on.

Can't get a title

Posts: 1,531

Date of registration
: Dec 23rd 2013

Platform: Xbox One

Location: The Land of Multitudinous Kangaroos

Reputation modifier: 13

Wednesday, March 29th 2017, 1:01pm

### Quoted from "tankmayvin"

Support is in no way an underplayed class in BF1. The pouches let you mash Q to throw anyone a packet. If people just played the game with some modicum of competence reliable re-supply would be a non-issue.

Having access to a constant supply of ammo is useless for the vast majority of players.

If we do a little maths:

The Model 8.35 spawns with 70 bullets. Assuming that you can kill one person per magazine (not even counting sidearm kills), that's 14 people you need to kill before you start looking for a Support player. Unless you have an infantry KD of 14, you don't need access to a constant supply of ammo. You'll die before you ever run out.

That is the problem DICE is trying to fix with Ammo 2.0. Or rather, would be fixing, if Ammo 2.0 were to apply to primary weapon ammo as well.

@SomeRandomGuy

Essentially, the health and ammo stations turn into capture points of their own. Adding another 5-10 "flags" to CQ is unnecessary IMO, especially when two of your classes are specifically designed to supply you with health and ammo.
something something Model 8 bestgun

### Quoted from "Pastafarianism"

Next, wanna try adding a guy that you KNOW is bad, and just testing to see that? Example: PP-2000 (god I so wanna love this gun, and yet...)

### Quoted from "Pastafarianism"

Example: PP-2000 (god I so wanna love this gun, and yet...)

Yes, it comes in last so far, but that is mostly because I'm making it shoot at 100m ADS - Not Moving as one of the criteria. Even then, between 50-100m Not Moving, when you include Useability, it is only 1.37% worse than the MTAR-21. Within 50m then it even beats the A-91.

Have a look, vs. the A-91 Carbine:

Using it with Muzzle Brake and Compensator is a wash in terms of overall performance. Comp is SLIGHTLY more accurate, while MB is SLIGHTLY more easy to use. Their overall scores are basically tied, with MB just ahead. I guess either can be recommended.

### Quoted from "Pastafarianism"

But... You can't be counting for the fact that it takes 9 bullets to kill at "long" range... Don't you dare tell me my A-91 is worse than a 9 BTK 650 RPM mediocre PDW.

Also. Just go heavy barrel. The recoil is low enough.

### Quoted from "Zer0Cod3x"

Well, technically...

Comparing a PP2K with HB and an A-91 with comp and stubby (as you suggested in an earlier post), at 50m not moving, the A-91 is only better by 4 damage per hitrate. While at 75m and 100m, surprisingly the PP2K does better than the A-91 (I'm pretty damn surprised as well).

And 10m and 50m moving the PP2K also does more damage per hitrate than the A-91. At 25m the A-91 is only better by about half a bullet's damage as well.

In addition, the PP2K has a much larger mag size and substantially less recoil. And it looks hella awesome. So comparing the A-91 to a PDW is of some worth after all, as the PP2K is better (technically, not practically) than the A-91.

Mind blown.

### Quoted from "Pastafarianism"

I... I...

*cries in a corner*

### Quoted from "Veritable"

Zer0Cod3x explained it very well. If you look at the raw numbers right here on Symthic Comparison, you can see how that happened:

A-91 vs PP-2000 | BF4 Weapon Comparison | Symthic

A-91's "23%" RPM advantage only afforded it 1 extra round.

Velocities are wash.

V-Recoil are wash (and this is HBar on PP2k vs. A-91 without).

Hipfire and ADS - Moving are better on the PP2k, but it's a PDW and not the surprising part.

The surprising part is that, as equipped (and we see above that PP2k HBar has almost same V-Recoil as A-91 without HBar so why not?), the PDW performs better at 50 - 100m than a bloody Carbine. Why?

SIPS, 42% better on the PP2k.

And here is the most important part. ADS - Not Moving Spread, 0.35 vs. 0.2, 43% improvement.

Without HBar then of course the PP2k loses, which is why when I add all the attachments together for an Overall Ranking, it would slot below the A-91. Run HBar on it, though, then... I'm sorry

### Quoted from "Pastafarianism"

@Veritable
@Zer0Cod3x
I... I...
But...
Wha...
I AM HAVING AN EXISTENTIAL CRISIS IN SCHOOL BECAUSE OF YOU TWO.

FUCK YOU NERDS AND YOUR FANCY NUMBERS

SEXY RUSSIAN BULLPUPS FTW.

In all seriousness, thank you both so much for giving me the numbers. I still don't want to accept them. You have led the horse to water. I still need to drink.

Posts: 1,920

Date of registration
: Jan 12th 2014

Platform: PC

Battlelog:

Reputation modifier: 14

Wednesday, March 29th 2017, 1:30pm

### Quoted from "tankmayvin"

Support is in no way an underplayed class in BF1. The pouches let you mash Q to throw anyone a packet. If people just played the game with some modicum of competence reliable re-supply would be a non-issue.

Having access to a constant supply of ammo is useless for the vast majority of players.

If we do a little maths:

The Model 8.35 spawns with 70 bullets. Assuming that you can kill one person per magazine (not even counting sidearm kills), that's 14 people you need to kill before you start looking for a Support player. Unless you have an infantry KD of 14, you don't need access to a constant supply of ammo. You'll die before you ever run out.

That is the problem DICE is trying to fix with Ammo 2.0. Or rather, would be fixing, if Ammo 2.0 were to apply to primary weapon ammo as well.

@SomeRandomGuy

Essentially, the health and ammo stations turn into capture points of their own. Adding another 5-10 "flags" to CQ is unnecessary IMO, especially when two of your classes are specifically designed to supply you with health and ammo.
I frequently run out of ammo using automatico though.

I'm not sure that having more than enough small arms ammo to survive a typical life is a problem even worth fixing.

It's pulling in two directions: making sure players can play their roles without needing to wait for a mage/healer to show, but making sure that mage/healer is super relevant in all things that involve shooting. IOW in everything.

Other than the lack of passive regen on things like flare guns exactly what is so bad about Ammo 1.0?

Moderator

Posts: 439

Date of registration
: Apr 14th 2012

Platform: PC

Location: Germany

Battlelog:

Reputation modifier: 12

Wednesday, March 29th 2017, 1:40pm

First, it's the Community TEST Enviroment. Testing whether these things work out or not is kinda what it's there for.
Also, how exactly are K-Bullet OP on paper? Even with only 1 shot for the rocket gun, an assault will do almost three times the damage(175 base vs ~65 base against an A7V) and it's not much more difficult to land.
With the current CTE stats, a full rocket gun dump will do 525 damage. Then you add another 175 damage every 8s when supplied or every 30s without. Full K-bullet dump is 260 damage with another 65 every 4 seconds or every 20s without a support. As you probably noted, this is all before angle mods. A bit annoying when driving a tank but if they amass enough K-Bullets to kill me, having the same amount of RGs shot at me would be much more concerning.

### Quoted

The problems with the RG aren't solved by a floating ammo pool whose quality is tied to a supply of ammo. Getting sent to the respawn screen to try again works perfectly fine as a mechanic and it ensures that you will face an increasingly easy fight with a full ammo load vs a somewhat damaged tank.

Why should the fight get easier as it goes on? You'll have to explain that one to me as I think it's completely nonsensical. We are not in a singleplayer game where the player might've selected a difficulty that's too high for them. If they are in over their heads, it's matchmaking that needs to be fixed. All you encourage is having people throw bodies at tanks instead of actually learning how to handle them.

### Quoted

The entire premise that a mix of support and assault should be better at tank killing than n+1 assaults is flawed concept and should die.

The support class is already hugely and decisively relevant to vehicle combat because they repair friendly vehicles. 1 support repairing 1 tank can let something like a breakthrough solo 2 enemy 1 man tanks - how is that not decisively powerful? It's a hell of lot more powerful than dropping ammo and herpa-derping away.

Support doesn't need to be decisive on both ends of the equation.

Because the only things that Support brought to the game were repairing and sustained, ranged damage. Their infantry support abilities were completely irrelevant in most situations and broken in others, making a redesign necessary. What you think is a change aimed towards fixing grenade spam is actually a change made to make resupply relevant with grenade spam fix as a secondary goal. And that then necessitates that a support is more valuable for a given amount of assaults than another assault is. Because if it is not then why bother with it? You'd lose burst damage and not gain much in return. Now it's a choice between the additional burst damage of an assault against the sustained damage and manpower efficiency of a support.

### Quoted

And why the hell should medic be relevant in fighting tanks? They've already got the two most powerful abilities in the game, and the best general purpose weapon.

Because every class should be relevant in every situation. It's not a difficult concept to grasp. Look at medics in BF3/4 and you'll understand.

As for resupply stations and similar, it's bad for balance because suddenly, everything depends more on how often you pass by one of these stations rather than than actively resupplying.
Alternatively, and this is the version I prefer, simply use them as a reskin for the passive effects. Put a couple bandages and some ammo in a small crate every 50ish meters and tell the community that being in a certain radius near those enables slow healing and resupply.
Problem is, people start with too much ammo for resupply to be relevant. If you drop their ammo capacity down, they need some way of regaining it without a support. Supports should be there to enhance fighting abilities of nearby allies, not be there to have a fighting chance.
So, use them as cover for systems already in place.
Bro of Oscar, the gentleman ninja

### Quoted

[22:09:20] Failure117: Legion: Tank Expert and Pokemon Afficianado

[16:21:16] Oscar Perez Lijo: In soviet russia legion is top poster

Holy War? No Thanks.

Posts: 2,592

Date of registration
: Jul 25th 2013

Platform: PC

Battlelog:

Reputation modifier: 15

Wednesday, March 29th 2017, 1:47pm

Ammo crates would be underused as well, by the time you reached them you would be on full health or close and your ammo would likely not be depleted either. An ammo crate or support is also likely to be in close proximity to you in any case.

While your math is correct regarding possible kills, it greatly depends on weapon and personal accuracy level. The Automatic weapons and shotguns are likely to be depleted faster than a regular SLR. BAs have a rather high potential kill capacity, but I find myself low on ammo a lot, because my accuracy is a fair bit lower.

Players that are not so accurate will always burn through their primary ammo faster than more accurate players. So mingling with primary ammo capacity will always have different effects on players. I still believe that I get more points as a support from resupplying regular ammo than from gadgets.

Gadgets however are indeed more cruicial, namely the assault gadgets, but I do not see the general issue considering the average lifespan of even a good player. Fact is, if you are engaging a tank you are putting your life on the line. A recon player firing away K-bullets and signal flares from 100m away not so much, so they should not have the benefit of passive ammo regen.

The support class is the key. It should be made so that full resupplies are something that can happen passive and active with both ammo gadgets. So you either throw a pouch or crate at them and they continue their journey, or you plant your crate and pouches at a key location for ongoing stationary resupply. So no sitting on an ammo box unless you gain the tactical advantage that way. Would keep both options relevant.
It is still an awkward system, because the pouches are obviously rarely seen lying around, so you can not acitvely seek out one, while the ammo crate does not offer the mobile advantage. One of the two should have been scrapped and the positives should have been applied to surviving gadget.

1 guests


text:
# $V_{us}$ from semileptonic hyperon decays [poster]

Director’s review of the Nuclear Science Division [PDF of poster]

Soon LHCb will have millions of hyperon semileptonic decays available for analysis. We propose to calculate transition form factors which, when combined with measurements of decay widths from LHCb, will be used to determine the Cabibbo–Kobayashi–Maskawa (CKM) matrix element $V_{us}$. Along the way, we will also calculate the hyperon mass spectrum and axial charges as a test of baryon chiral perturbation theory, which will serve as the framework for the form factor calculations.

## $V_{us}$ from the lattice [talk]

Los Alamos National Lab [invited talk] [PDF of slides]

## The nucleon mass and sigma term from lattice QCD [talk]

Chiral Dynamics 2021 bulletin [PDF of slides]

## lsqfit-gui

less than 1 minute read

Graphical user interface for lsqfit using dash.

## Determining properties of hyperons [talk]

Lattice 2021 bulletin [PDF of slides]

## $V_{us}$ from semileptonic hyperon decays [poster]

less than 1 minute read

Director’s review of the Nuclear Science Division [PDF of poster]

## Scale setting with $m_\Omega$

Python code for our scale setting analysis.

## Scale setting the Möbius Domain Wall Fermion on gradient-flowed HISQ action using the Omega baryon mass and the gradient-flow scales $t_0$ and $w_0$

Phys. Rev. D 103, 054511 (2021) [arXiv:2011.12166]

## Lattice calculation of $F_K/F_\pi$ from a mixed domain-wall on HISQ action [talk]

American Physical Society bulletin [PDF of slides]

## spacetime-plots

A python noteboook for plotting points and lines, expressly written for making spacetime diagrams. To get started with a tutorial, launch the binder inst...

## $F_K/F_\pi$ from MDWF on HISQ
Python code for our $F_K/F_\pi$ analysis.


text:
# How does one solve a cubic polynomial with complex coefficients?

I have found formulas online for the the roots of a cubic polynomial with real coefficients, but they all said this they would not work for polynomials with complex coefficients. I need to solve the following: $x^3+cx^2+\alpha$ where $c>0$ and $\alpha\in\mathbb{C}$. Anyone have the formula

-

In my answer here, I give a cubic formula that works for complex coefficients and works with the way principal roots are defined on non-real complex numbers in the vast majority of calculators and computer algebra systems.

-


text:
# Check which object triggered another

Two animated car object both contain a rigid body, a box collider and a script with an OnTriggerEnter event.

I want to check which car started the collision event, by hitting the other car.

Consider two cars; regardless of whether carA hits carB or carB hits carA, both cars contain the same script with the same event. So both cars become the trigger.

How do I identify which car started the collision? I wish to do so without the use of raycasting, as it is too expensive for what I am wanting to do.

• Took me a bit to understand what you actually mean. It sounds like your asking "check which objects they are" not "check which one started it". I can see the confusion, in the answers.. Aug 20, 2016 at 1:05

You can find out the tag or name of the objects that collided, this information is stored in the Collider other you pass to the OnTriggerEnter(Collider other) function.

Deciding who hit who is something you need to set the criteria for.

• this is not the answer Jun 13, 2016 at 8:50
• I agree; I initially upvoted this answer thinking it was obviously correct. I believe the answerer made the same mistake I had when reading the question, and misinterpreted it. The actual question asks 'how to figure out who hit who', which this answer appears to address only by repeating that it is '.. something you need to set a criteria for'. Aug 20, 2016 at 3:00

You could create a boolean, for example bool canCrash, and make sure it is true when ever the car changes from the previous position. Then, on collision, you check if canCrash == true and, if it isn't but the speed of the car was higher than the car it collided into.

I think that's the right direction to go.

• i want to tell you that if two object trigger their trigger event fired abruptly. Jul 15, 2016 at 5:29

Playing around collision and the Debug.Log(), I have confirmed that OnTriggerEnter triggers in a specific order; that is, when carA moves into carB, it will set off the OnTriggerEnter method attached to carB. This always seems to happen first, with the OnTriggerEvent method attached to carA triggering, second.

Working off of the answer submitted by Vadim Tatarnikov, I set up bool collisonInstigator that typically defaults as false. I was than able to check for collisionInstigator == true during OnTriggerEnter. If collisionInstigator == false, we assume that the other collider is the instigator, and set other.<script>.collisionInstigator = true. When the instigators OnTrigger method calls, which we can assume will be directly after the first, we find that collisionInstigator == true.

This tells us that we are currently in the OnTrigger method for the car that started the collision, allowing us to run our logic as required. The only other thing we have to do is ensure that we set collisionInstigator = false at the end of our logic, to set it back up for the next potential collision scenario, assuming your not calling for the instigator to be destroyed or any other logic that would make further collisions with that game object impossible.

public class CarAI : MonoBehaviour
{
public bool collisionInstigator = false;

void OnTriggerEnter(Collider other)
{
if(collisionInstigator == true)
{
// I am crashing into the other car; run logic

DebugCollision(other.gameObject);   // confirm order through debug
collisionInstigator = false;        // don't forget to reset the flag!
}
else
{
// I am being crashed into by the other car
other.GetComponent<CarAI>().collisionInstigator = true;
}
}

///<summary>Using tags, we can double check our logic regarding which GameObject
/// is the "instigator"</summary>
void DebugCollision(GameObject other)
{
string myName = gameObject.name;
string otherName = other.gameObject.name;

Debug.Log(myName + " is colliding with " + otherName);
}
}

Using DebugCollision(GameObject other) to debug a clearer formatted string of the collision, I confirmed that the above script will correctly pick the "instigator" across a variety of speeds, using both Transform.Translate() and RigidBody.AddForce() methods.

## You can check the speed of both cars

During collision, there will be two cases:

1. One car is moving, one car is stationary.
2. Both cars are moving.

You need to decide which car intentionally hit the other, and obviously, OnTriggerEnter() will not help. To check for speed, use GetComponent<Rigidbody2D>().velocity or GetComponent<Rigidbody>().velocity.

### case one - one car is stationary

In the first case, it's pretty simple. The car that has speed is the car that is hitting the other car.

### case two - both cars are moving

It's tricky for the second case. You can say the car with more speed intentionally hit other car; though it's not always true, it will work most of the time.

I think you'd be more lucky to use OnCollisionEnter to avoid a double event.

You could also combine your condition with a second criteria, deciding which is the "collider" and which is "collided" (depending on your game context). For instance, you could check for the fastest car, the car that is changing direction, the car with the most on the outside.. there would be a behavior for the "collider", and a behavior for the "collidee".

You could also tweak the collision event with tag name identification; if the tags of both cars are "AI cars", treat them as a bounce, only. If one tag is "player car", treat it as a real shock.

• what are you saying man complete not understand Jun 13, 2016 at 9:58


text:
1. Mar 6, 2014

### QuantumX

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

$220000=\sqrt{1.4*10^{32}*\left[ln(\frac{6.17*10^{20}+x}{6.17*10^{20}})-\frac{x}{6.17*10^{20}+x}\right]*\frac{1}{x}}$

It's supposed to give me the radius of the Milky Way's dark matter halo. I expect to get a value of around 100 kpc (equation will produce a value in m), although that would assume I didn't mess up anywhere in deriving it.

Please don't ask me to show you how I derived it, I mean we can do that, but right now I'd really just like to get a value for x. I just can't solve it myself, and all online calculators I've tried it on have failed.

Can you please help me solve it, it took me all day to get here and now I can't get the actual value.

Thanks!!

2. Mar 6, 2014

### SteamKing

Staff Emeritus
Show us what steps you've already taken. If you are looking for a totally algebraic solution, where you get x = some number, that doesn't appear to be in the cards. It'll probably take an iterative method to find x.

3. Mar 6, 2014

### SammyS

Staff Emeritus
Graph the function.

4. Mar 6, 2014

### QuantumX

I can't, I don't have any sort of math software, even if I did I doubt it would do it haha.

It 's supposed to be a value, but I can see how it would be impossible to get from this.

Still, any help is appreciated.

5. Mar 6, 2014

### SammyS

Staff Emeritus
Try WolframAlpha .

6. Mar 6, 2014

### QuantumX

Basically, the way I derived it (and this may now be more appropriate for the astrophysics section)

is by using the equation

$V=\sqrt{\frac{GM}{R}}$

I want to estimate the point at which orbital velocity and mass are no longer linearly related. The velocity of the flat portion of the Milky Way's rotation curve is around 220,000m/s. I am looking for a radius Rmax at which the orbital velocity drops off, and that would be the edge of the dark matter halo.

So I have V, I'm looking for R and I now need M to substitute in the above equation.

$M=4/3\pi r^3ρ(r)$

Integrating:

$M=∫ 4 \pi r^2ρ(r)dr = 4\pi ρ_{0}Rs^3[ln(\frac{Rs + Rmax}{Rs}) - \frac{Rmax}{Rs+Rmax}]$

I have values for ρ(0) and Rs (those are constants for our galaxy)

So substituting everything, I get the equation you see.

7. Mar 6, 2014

### QuantumX

@SammyS - Thank you so much, that worked. I got a graph, but I'm not sure how to interpret it...

Here's the equation in a form that works for WolframAlpha

220000=sqrt(1.4*10^32*(ln((6.17*10^20+x)/(6.17*10^20))- (x/(6.17*10^20+x))*(1/x))

Yeah, I guess it's a function because the radius is a function of the density, but I thought for some reason that problem would be solved by the fact I had the density constants for our galaxy. I wish WolframAlpha would show me more of the graph, so I can see where it gets near flat, that's what I'll call x for my estimate.

I just totally have no idea what I'm doing haha, but it's been fun.

8. Mar 6, 2014

### SammyS

Staff Emeritus
Well, you could change x to units of pc or kpc. (I assume x is in meters.)

Or try this for the given expression. (I divided both sides or your equation by 220000 then subtracted 1.) https://www.wolframalpha.com/input/?i=plot+%281.18322%2F220000%29*10%5E16+sqrt%28%28-x%2F%286.17x10%5E20%2Bx%29%2Blog%281.62075x10%5E-21+%286.17x10%5E20%2Bx%29%29%29%2Fx%29-1+for+x+from+8*10%5E20+to+2+*+10%5E21

9. Mar 6, 2014

### Staff: Mentor

Let y = x /6.17 x 1020
Then:
$220000=\sqrt{\frac{2.27\times 10^{11}}{y}*\left[ln(1+y)-\frac{y}{1+y}\right]}$
Square both sides:
$$0.213=\left[\frac{ln(1+y)}{y}-\frac{1}{1+y}\right]$$
The solution to this equation is approximately y = 1.5.

Chet

Last edited: Mar 6, 2014
10. Mar 6, 2014

### QuantumX

Hm, well I'm not sure how to interpret yours.

When I look at mine:

https://www.wolframalpha.com/input/...0+x)/(6.17*10^20))-+(x/(6.17*10^20+x))*(1/x))

I see that the curve for x ends right at 3.75*10^21 m = 121.5 kpc, which is within the range of current estimates for the radius of the galaxy (the dark matter halo that is).

That's just an observation, I' not sure how to read the graph honestly. Does the curve end where the graph ends, or does it continue?

I know that x is radius, but what is y ? Is it density? That wouldn't make sense, since density is in kg/m^3, which would be way too much according to the graph for that radius.

Sorry for the super newbie questions.

11. Mar 6, 2014

### QuantumX

Hm, that only gives 30 kpc for the radius, it's supposed to be around 10 times that.

12. Mar 6, 2014

### Staff: Mentor

Sorry about that. Substitute the result, and see if it satisfies your equation.

Chet

13. Mar 6, 2014

### QuantumX

That's what I did, it's off by a factor of 10, but I'm sure the error is in my calculations somewhere.

14. Mar 6, 2014

### SammyS

Staff Emeritus
Here's the WA graph for $\displaystyle \left[\frac{ln(1+y)}{y}-\frac{1}{1+y}\right]- 0.213$

So, there are two solutions.

File size:
2.7 KB
Views:
115


text:
# Relating Current Density and Drift Speed

## Homework Statement

The figure shows wire section 1 of diameter 4R and wire section 2 of diameter 2R, connected by a tapered section. The wire is copper and carries a current. Assume that the current is uniformly distributed across any cross-sectional area through the wire's width. The electric potential change V along the length L = 1.95 m shown in section 2 is 13.5 µV. The number of charge carriers per unit volume is 8.49 1028 m-3. What is the drift speed of the conduction electrons in section 1?

## Homework Equations

J = nev
v here represents the drift speed
E = pJ
E= V/L
i = nAev
J = i / A

## The Attempt at a Solution

I included a lot of equations on the basis that they have some of the known quantities in them.

I can't really see how to move from knowing what the problem gives me to come up with the drift speed.

I'm given n, the number of charge carriers per unit volume, and the only equations I have that have n in them are J = nev and i = nAev.

So I would need to know J, right? So
J = E / p
and
p = (V/L) / (i/A)
and since i = nAev (and since E = V / L)
I can write
nev = (V/L) / ((V/L) / (nAev)/A)
but then the v cancels out.

So I've gotten no where.


text:
# About Fig. 4 of Fagundes et al. (2007)

July 12, 2011
By

(This article was first published on Xi'an's Og » R, and kindly contributed to R-bloggers)

Yesterday, we had a meeting of our EMILE network on statistics for population genetics (in Montpellier) and we were discussing our respective recent advances in ABC model choice. One of our colleagues mentioned the constant request (from referees) to include the post-ABC processing devised by Fagundes et al. in their 2007 ABC paper. (This paper contains a wealth of statistical innovations, but I only focus here on this post-checking device.)

The method centres around the above figure, with the attached caption

Fig. 4. Empirical distributions of the estimated relative probabilities of the AFREG model when the AFREG (solid line), MREBIG (dashed line), and ASEG (dotted line) models are the true models. Here, we simulated 1,000 data sets under the AFREG, MREBIG, and ASEG models by drawing random parameter values from the priors. The density estimates of the three models at the AFREG posterior probability = 0.781 (vertical line) were used to compute the probability that AFREG is the correct model given our observation that PAFREG = 0.781. This probability is equal to 0.817.

which aims at computing a p-value based on the ABC estimate of the posterior probability of a model.

I am somehow uncertain about the added value of this computation and about the paradox of the sentence “the probability that AFREG is the correct model [given] the AFREG posterior probability (..) is equal to 0.817″… If I understand correctly the approach followed by Fagundes et al., they simulate samples from the joint distribution over parameter and (pseudo-)data conditional on each model, then approximate the density of the [ABC estimated] posterior probabilities of the AFREG model by a non parametric density estimate, presumably density(), which means in Bayesian terms the marginal likelihoods (or evidences) of the posterior probability of  the AFREG model under each of the models under comparison. The “probability that AFREG is the correct model given our observation that PAFREG = 0.781″ is then completely correct in the sense that it is truly a posterior probability for this model based on the sole observation of the transform (or statistic) of the data x equal to PAFREG(x). However, if we only look at the Bayesian perspective and do not consider the computational aspects, there is no rationale in moving from the data (or from the summary statistics) to a single statistic equal to PAFREG(x), as this induces a loss of information. (Furthermore, it seems to me that the answer is not invariant against the choice of the model whose posterior probability is computed, if more than two models are compared. In other words, the posterior probability of the AFREG model given the sole observation of PAFREG(x). is not necessarily the same as the posterior probability of the AFREG model given the sole observation of PASEG(x)…) Although this is not at all advised by the paper, it seems to me that some users of this processing opt instead for simulations of the parameter taken from the ABC posterior, which amounts to using the “data twice“, i.e. the squared likelihood instead of the likelihood…  So, while the procedure is formally correct (despite Templeton’s arguments against it), it has no added value. Obviously, one could alternatively argue that the computational precision in approximating the marginal likelihoods is higher with the (non-parametric) solution based on PAFREG(x) than the (ABC) solution based on x, but this is yet to be demonstrated (and weighted against the information loss).

Just as a side remark on the polychotomous logistic regression approximation to the posterior probabilities introduced in Fagundes et al.: the idea is quite enticing, as a statistical regularisation of ABC simulations. It could be exploited further by using a standard model selection strategy in order to pick the summary statistics that are truly contributed to explain the model index.

Filed under: R, Statistics, University life Tagged: ABC, Alan Templeton, Bayes factor, Bayesian model choice, information theory, model choice, posterior predictive, R, summary statistics

R-bloggers.com offers daily e-mail updates about R news and tutorials on topics such as: visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...


text:
## replace_date('19 November 2012');

### Long Term Trading System (aka IRA System)

In this post I'd like to present a basic mechanical trading system for Long Term positions suitable for EOD or weekend traders: "Trend_LT". This particular system is intended for daily or weekly time frames and is based on PPO (or MACD). The system uses the inclination or declination of the PPO-/MACD-signal line as a proxy for the LT direction of the trend. The system also has a build in filter to prevent going short during counter trend corrections in a LT uptrend.

The "Trend_LT" system encompasses three possible positions:
- long, i.e. a position in the eft SPY;
- short, i.e. a position in the eft SH or perhaps even better: HDGE;
- neutral, because cash is position too!

The rules of this system are short and simple:
1. Long when EMA5 of (EMA13 - EMA55) is rising.
2. Short when EMA5 of (EMA13 - EMA55) is falling and price(=close) < SMA89.
So no shorts when price >= SMA89.
3. Use the extreme point rule for entry/exit stops to minimize whipsawing.

A chart of the system showing some 1,000 trading days on the SPX:

A chart of the system with 1,000 weeks of SPX depicted:

## replace_date('11 November 2012');

### Thrill Rides by PayPal

[Updates at end of post]

Last summer my two sons and I were having "fun" in some of the roller coasters of Six Flags/Magic Mountain near LA. Think of telling names like "Viper", "Scream", "X2" and of course the 26 stories high "Goliath". We were looking for thrills and we sure found them. Oh yeah.

You know what beats a roller coaster thrill ride? Ask any blogger. Nothing in the world is so thrilling, let alone encouraging, as that “Notification of Donation Received” e-mail from PayPal.

## replace_date('13 May 2012');

### PPO ROC'n Roll

[It has been a while since my last post, but as you can see, I had to attend a dancecourse :)]

You know MACD. Meet its cousin: PPO or PercentagePriceOscillator. Simply put: PPO is the value of MACD divided by the longer moving average. This result is then multiplied by 100 to express the value in a percentage. Compared to MACD, PPO is more suitable for long term analysis.

Just like MACD, PPO can have a histogram too. Trading PPO in the conventional way by the crossings of the PPO-line and the Signal line, may result in chasing trades, because PPO, just like MACD, suffers more or less lag. The amount of lag differs greatly depending on the settings used, but while fast settings reduce lag considerably, they also come with the risk of whipsawing.

Why not use the histogram differently and reduce lag considerably? Why not make it dynamical to express the ROC of the PPO-line? Instead of showing the difference between the PPO-line and its Signal line, let the histogram show the daily Rate of Change of the PPO-line itself. The result is a PPO with a built-in Early Warning System combined with a nice divergence feature!

## replace_date('20 February 2012');

### thinkscript code for McClellan Summation Index and Histogram

The McClellan Summation Index works well to help investors identify important turning points in the market. The Summation Index gives a longer term signal when it confirms, or fails to confirm, the trend in the stock market itself. It can provide an early signal of a trend change too. thinkDesktop offers the Summation Index as a standard study and with some thinkering we have a histogram too.

The chart shows two studies, which can be used separately. The studies are to be used on the daily time frame. Like the standard TOS study NYSE, NASDAQ or AMEX can be selected.

## replace_date('15 February 2012');

### Summation Indexes are rolling over

[The thinkscript studies will be soon available for download or "copy/paste".]

## replace_date('29 January 2012');

### State of the Markets

This weekend market update holds an extensive review of the weekly and daily status of TrendXplorer in the various markets.

The weekly SPX painted a bullish cross on the 10 and 40 SMA's, on the daily chart the equivalents of the 50 and 200 SMA's a cross is very close, but did not happen (yet?). During the last 10 years every bullish cross was followed by a prolonged period of rising prices. Only in Spring 2002, the bullish cross was soon followed by a bearish one. At that time however the 200 SMA was firmly downsloping, while right now it is fairly flat with some positive bias. Notice on the daily, momentum is waning somewhat and unlike the DJI, SPX did not take out its July tops. The Dow did take out its July 2011 double top and the high of this week is only some 34 points under the May 2, 2011 top. The NDX did take out its high of last July and had follow through during this market week. Notice the steep rise during this last month. What goes up fast goes down fast? The weekly and daily charts show quite some negative divergence. ## replace_date('17 January 2012'); ### "Not impossible. Inevitable. Goodbye, Mr. Anderson." Tomorrow Silver will see its daily 50MA cross the 400MA. It is inevitable! The MA-pair differ only 0.1 point, while the 400MA is rising 0.3 points each day and the 50MA declines 0.1 point. The last time such a down cross occurred was in mid September, 2008. Further the 50, 100, 150 and 200 MA's (not shown on chart) are in bearish alignment. Price is stalling and mayor resistance is building with the both the 50 and 400 MA just overhead. So mr. Anderson, are you going down or do you play your Neo tricks? In XLF, the 200MA held as resistance. In Gold the non-triggered sell signal is cancelled. NDX shot up, causing a new buy signal to be issued. On the US Dollar notice the 8th touch of the up sloping tendline. TLT is hovering around its 50MA. ## replace_date('16 January 2012'); ### Hidden negative divergence in XLF, Gold battling with daily 200MA While TrendXplorer still has XLF in an uptrend, it is showing hidden negative divergence (see chart). The lower high in price (a hanging man doji) was accompanied by a higher high in momentum and last Friday momentum was waning again. This concurs with the weakness stocks are showing at the moment. Prices stalled and the new buy signal in NDX (not shown) was canceled by a red square (see Trading the Trend for explanation) With US markets closed today Gold futures retreated a bit, battling with their daily 200MA. Notice the re-sell signal of last Thursday on the second chart. It looks like Gold has found its resistance again. ## replace_date('14 January 2012'); ### Implosion of the inverse correlation in the markets? To measure is to know A correlation comparison study on USD/EUR, SPX, Gold, Oil, AUD/USD and VIX The other day a visitor on my blog stated the markets inverse correlation with the US Dollar had pretty much imploded. In the meantime AlbertaRocks also published his peace on this subject: USD - "Inverse" About To Become The Norm To be able to validate this statement in a better way than eyeballing the charts, I wrote a thinkscript study that compares the trend in a given stock, index or currency against another showing the correlation, be it positive or negative, in a subpane. That is: when both rise or decline in tandem, positive correlation is at hand, signaled by a green flag. Otherwise negative correlation is assumed, signaled by a red flag. Because of data issues I had to use the inverted EUR/USD spot prices as a proxy for the US dollar. SPX : USD/EUR My measurements show that on a week to week basis green and red flags fly all over the place in an erratic, chaotic way. On a day to day basis the randomness seems to be even greater. So any meaningful correlation on these timeframes is virtually non existent, neither negative nor positive (see upper subpane on charts). When correlation is measured by the waning and waxing of the weekly 10-period moving averages (50-period daily moving averages), the most extensive conclusion in my judgement would probably be that there are times when values move in tandem or non-tandem for a while, but both connections and disconnections seem to "just" happen. Whether the markets rise or fall, is of no difference too. And tandems fall apart just as quick as they pair up together, seemingly for no obvious reason. Only when measured on the larger timeframe of a 40-period moving average (200 days) the quite popular believe that there was inverse correlation until recently turns out to be only partly true. My TOS-charts go back 20 years and until April 2002 positive correlation had the upper hand. Since then inverse correlation took over as the prevailing trend. But notice also during these recent years there are weeks and weeks on stretch with positive correlation. ## replace_date('12 January 2012'); ### Hanging man doji day for stocks, oil leaking Both SPY, DIA, QQQ and IWM printed a hanging man doji on the charts, with a suspicious new buy signal on the QQQ's (see chart). So the rise in stocks is struggling. UUP was fairly lower, while (of course) its mirror: FXE went higher. Perhaps the most interesting was oil, which took quite a drop (see chart). ## replace_date('11 January 2012'); ### Stocks fail to rise, cover signal on SLV The market was slow, not to mention dull, today. Stocks stalled, in spite (yes!) of a rising US dollar. Only one thing of importance to mention: TrendXplorer issued a cover signal on SLV. GLD is putting its sell signal to the test. And now something completely different: Hat tip for DV for being the first donor to this blog. Thanks for your generosity, DV! [Update: Charts added of SLV and GLD] ## replace_date('10 January 2012'); ### Stocks rise on lackluster volume After a few days of hesitation SPY followed SPX in triggering the buy signal TrendXplorer issued. The rise occurred on low volume though, well below the 50ma. NDX is the last big index that is still in neutral sell territory and on the verge of having is sell signal too. NDX's rise is on higher volume at around the 50ma, but volume in the QQQ's (chart not shown) was low again. ## replace_date('09 January 2012'); ### Superimposed studies for thinkorswim All charts on this blog are made with the award winning thinkDesktop, the charting software provided by thinkorswim (TOS). thinkDesktop allows users to write private studies such as TrendXplorer in "thinkscript". One of the not so widespread options is to use superimposed studies Stockchart users are familiar with. While some quotes such asCPC unfortunately are not (yet?) available, most are. And those can be superimposed on any pricecharts, be it ratiowise, standard or inverted.

Want to have VIX inverted on your own TOS pricechart with SPX?

Want the \$DJI priced in "real money" as Bob Prechter likes to say?

Heck, why not price AAPL in terms of orange juice, whatever combination seems sensible? Well, as of today every TOS-er can too.

## replace_date('08 January 2012');

### US Dollar looks fatigued: stocks ready to spurt?

The US Dollar has been rising since Oct, 27. Both on the weekly and the daily chart negative divergence is building up indicating exhaustion and a possible near term reversal. For stocks such an occurrence could be a sign for the start of a new rally triggering in SPY the buy signal TrendXplorer issued the first trading day of 2012. Notice that the both the signals on SPY and SH still await confirmation.
(Dollar charts are shown with closing prices only for better distinction.)

## replace_date('07 January 2012');

### Private domain name for TrendXplorer: www.trendxplorer.info

As of today TrendXplorer is located at: www.trendxplorer.info as its top domain name. Please change your bookmarks. BTW, the "old" address indexswingtrader.blogspot.com stays in use too.

## replace_date('05 January 2012');

### Quiet market, Euro drops

Today it looked almost like the markets took the day off, so there is no reason to say much. Except for the Euro/Dollar, it had to take quite a blow. The USD is hitting overhead resistance and knocking at the door to go up. If the correlation of the last couple of years still holds up, this move in the currencies spells trouble for stocks.

## replace_date('04 January 2012');

### About gallows and positive divergence

For the third time in a row SPX painted a hanging man doji on its chart. On the two prior occasions price was heading due south.
SLV noted a positive divergence with follow through during yesterday and the day before. Today SLV stalled a bit, perhaps taking a pause. TrendXplorer colors still bright red, waiting for the white dot first. So no action is needed yet.

## replace_date('03 January 2012');

### SPX: buysignal triggered

Today last weeks buy signal was triggered. We had a solid price bar above the 200MA. Will it pop and drop, like last July or do we get follow through during the rest of this first week of the new year? We'll have to wait and see. Stops can be set just below the green low of last week.

## replace_date('02 January 2012');

### Follow through or reversal?

Following the fake out in the beginning of July, last week TrendXplorer issued its third buy signal in six months time for SPX. Until now none of those signals actually got triggered, they were reversed instead. Notice how price is hugging the 200MA. Furthermore the DJIA even had seven buy signals, all above the 200MA, but none with any follow through. Will this time be different? We just have to wait and see.


text:
• ### 题目描述

Assume the coasting is an infinite straight line. Land is in one side of coasting, sea in the other. Each small island is a point locating in the sea side. And any radar installation, locating on the coasting, can only cover d distance, so an island in the sea can be covered by a radius installation, if the distance between them is at most d.
We use Cartesian coordinate system, defining the coasting is the x-axis. The sea side is above x-axis, and the land side below. Given the position of each island in the sea, and given the distance of the coverage of the radar installation, your task is to write a program to find the minimal number of radar installations to cover all the islands. Note that the position of an island is represented by its x-y coordinates.

• ### 输入

The input consists of several test cases. The first line of each case contains two integers n (1<=n<=1000) and d, where n is the number of islands in the sea and d is the distance of coverage of the radar installation. This is followed by n lines each containing two integers representing the coordinate of the position of each island. Then a blank line follows to separate the cases.
The input is terminated by a line containing pair of zeros

• ### 输出

For each test case output one line consisting of the test case number followed by the minimal number of radar installations needed. “-1” installation means no solution for that case.

• ### 样例输入

3 2
1 2
-3 1

2 1
1 2
0 2

0 0

Case 1: 2
Case 2: 1

• ### 思路

由于所有雷达全在x轴上，可把每个岛屿以d为圆心画圆，记录圆与x轴的两个交点存入pair中，把所有点对按右交点升序排列，判断后一个左交点是否小于前一个右交点即可。

• ### 代码

#include<iostream>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
using namespace std;

vector<pair<double,double> > v;

int main()
{
int n,d,cnt=0;
while(cin>>n>>d)
{
cnt++;
if(n==0&&d==0)
return 0;
int maxx=-1;
for(int i=0;i<n;i++)
{
int x,y;
cin>>x>>y;
v.push_back(make_pair(x+sqrt(abs(1.0*d*d-y*y)),x-sqrt(abs(1.0*d*d-y*y))));
maxx=max(maxx,y);
}
if(maxx>d)
{
cout<<"Case "<<cnt<<": -1"<<endl;
continue;
}
sort(v.begin(),v.end());
int ans=1;
double tmp=v[0].first;
for(int i=1;i<n;i++)
{
if(v[i].second>tmp)
{
ans++;
tmp=v[i].first;
}
else if(v[i].first<tmp)
tmp=v[i].first;
}
cout<<"Case "<<cnt<<": "<<ans<<endl;
v.clear();
}
}


text:
Unbounded countable subset

(Edit: The first formulation is wrong. See the second answer) Does every totally ordered set contain an unbounded countable subset. In other words: If S is a totally ordered set, can we find a (edit: at most) countable subset A, such that for every $s \in S$, there is a $a \in A, a\geq s$?

-
No. This is a homework problem. – Sam Nead Nov 26 '09 at 16:36
I agree, this is a homework problem: -1. – Alberto García-Raboso Nov 26 '09 at 17:06
I am baffled as to why people think this is a homework problem. It could be assigned in a set theory class, but it is a very natural question and the counter-examples are not elementary. I'll bow to peer pressure and not give an explicit construction, but the basic hint here is to read up on ordinal numbers. – David Speyer Nov 26 '09 at 17:47
It was not a homework problem, but it was inspired by a homework problem. The problem was: Show that if $K_1\supset K_2\supset \dots$ is a decreasing sequence of non-empty compact sets, the intersection $\cap_{i=1}^{\infty} K_i$ is non-empty. I was wondering if this could be generalized: Let $(K_i)_{i\in I}$ be a system of non-empty compact sets, such that for for all $i,j\in I: K_i\subset K_j \vee K_i\supset K_j$. Is the intersection $\cap_{i\in I} K_i$ non-empty? This is why thought of the problem, but I got interested in the problem for its own rights. – Sune Jakobsen Nov 26 '09 at 18:26
For the record, I remember inventing and thinking about this question when I was first learning set theory. My motivation went as follows: An equivalent formulation of Zorn's lemma is "In a nonempty poset where every totally ordered subset has an upper bound, there is a maximal element." At the time I found it hard to think about arbitrary totally ordered sets, so I wondered if I could replace this by "In a nonempty poset where every ascending sequence $(a_i)_{i \in Z}$ has an upper bound, there is a maximal element." – David Speyer Nov 27 '09 at 0:16

There is a counterexample in the long line L. It is totally ordered and every sequence has a limit in L. see the following:

http://en.wikipedia.org/wiki/Long_line_(topology)

-
As long as we are answering homework questions (grump!) a simpler counter-example is provided by the first uncountable ordinal. – Sam Nead Nov 26 '09 at 17:46
The fact that the long line is a counterexample is completely derivative on the fact that omega_1 (the first uncountable ordinal) is a counterexample. Thus, Sam Nead's answer in the comment here is far better. – Joel David Hamkins Dec 1 '09 at 17:05

Keyword: cofinality.

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

Added MUCH later: To be slightly more explicit, for any cardinal $\kappa$, the cofinality of the successor cardinal $\kappa^+$ is $\kappa^+$, so not only can we not in general find an unbounded (=cofinal) countable subset, there is no fixed cardinality $\kappa$ such that every totally ordered set has an unbounded subset of cardinality at most $\kappa$.

-
care to explain? – thejoshwolfe Jun 7 at 20:20
@thejoshwolfe: The OP's question is equivalent to: "does every totally ordered set have countable cofinality?" So learning about cofinality -- say from the linked to article -- will answer the question. – Pete L. Clark Jun 7 at 21:46
i think you're supposed to actually answer the question in a stackexchange answer to a question. meta.stackexchange.com/a/8259/206371 cofinality seems like it would be a cool concept to use to answer the question, but I can't figure out how it would work. For example, I had no idea the OP's question was equivalent to your sentence; I wouldn't have figured that out on my own without spending hours reading several interlinking wikipedia articles. – thejoshwolfe Jun 8 at 2:38
@thejoshwolfe: This answer is almost seven years old and in fact predates mathoverflow being part of the stackexchange system and predates the site math.SE. As it is an undergraduate level set theory question, if it were asked today it would probably be closed and/or migrated. The existence of totally ordered sets -- e.g. cardinals -- of uncountable cofinality is the answer to the question, and that is discussed in the article. If you have further questions, please feel free to ask on math.SE. – Pete L. Clark Jun 8 at 3:17