News aggregator
Mark Jason Dominus: A message to the aliens, part 1/23 (numbers)
Earlier articles: Introduction Common features
This is page 1 of the Cosmic Call message. An explanation follows.
This page, headed with the glyph for “mathematics” , explains the numeral symbols that will be used throughout the rest of the document. I should warn you that these first few pages are a little dull, establishing basic mathematical notions. The good stuff comes a little later.
The page is in three sections. The first section explains the individual digit symbols. A typical portion looks like this:
•••• ••• = 0111 = 7
Here the number 7 is written in three ways: first, as seven dots, probably unmistakeable. Second, as a 4bit binary number, using the same bit symbols that are used in the page numbers. The three forms are separated by the glyph , which means “equals”. The ten digits, in order from 0 to 9, are represented by the glyphs
0
1
2
3
4
5
6
7
8
9
The authors did a great job selecting glyphs that resemble the numerals they represent. All have some resemblance except for 4, which has 4 horizontal strokes. Watch out for 4; it's easy to confuse with 3.
The second section serves two purposes. It confirms the meaning of the ten digits, and it also informs the aliens that the rest of the message will write numerals in base ten. For example, the number 14:
••••• ••••• •••• = 14
Again, there are 14 dots, an equal sign, and the numeral 14, this time written with the two glyphs (1) and (4). The base2 version is omitted this time, to save space. The aliens know from this that we are using base 10; had it been, say, base 8, the glyphs would have been .
People often ask why the numbers are written in base 10, rather than say in base 2. One good answer is: why not? We write numbers in base 10; is there a reason to hide that from the aliens? The whole point of the message is to tell the aliens a little bit about ourselves, so why disguise the fact that we use base10 numerals? Another reason is that base10 numbers are easier to proofread for the humans sending the message.
The third section of the page is a list of prime numbers from 2 to 89:
67, 71, 73, 79, 83
and finally the number
,
I often wonder what the aliens will think of the . Will they laugh at how cute we are, boasting about the sweet little prime number we found? Or will they be astounded and wonder why we think we know that such a big number is prime?
The next article, to appear 20150812, will discuss page 2, shown at right. (Click to enlarge.) Try to figure it out before then.Bug in Template Haskell?
Works.hs
{# LANGUAGE TemplateHaskell #} module Works where import Language.Haskell.TH stringNewtype :: String > DecsQ stringNewtype name = do let typeN = mkName name let accN = mkName ("un" ++ name) stringT < [t String ] return [NewtypeD [] typeN [] (RecC typeN [(accN, NotStrict, stringT)]) [''Show]]DoesNotWork.hs
{# LANGUAGE TemplateHaskell #} module DoesNotWork where import Language.Haskell.TH stringNewtype :: String > DecsQ stringNewtype name = do [d newtype $typeN = $typeN { $accN :: String } ] where typeN = mkName name accN = mkName ("un" ++ name)Main.hs
{# LANGUAGE TemplateHaskell #} module Main where import Works  import DoesNotWork $(stringNewtype "Abc") main :: IO () main = putStrLn $ unAbc $ Abc "Hello, World!"The code works with the Works module, but with the DoesNotWork module it refuses to compile:
DoesNotWork.hs:9:33: parse error on input ‘$accN’Why does that happen?
submitted by lamefun[link] [3 comments]
Bug in Template Haskell?
Works.hs
{# LANGUAGE TemplateHaskell #} module Works where import Language.Haskell.TH stringNewtype :: String > DecsQ stringNewtype name = do let typeN = mkName name let accN = mkName ("un" ++ name) stringT < [t String ] return [NewtypeD [] typeN [] (RecC typeN [(accN, NotStrict, stringT)]) [''Show]]DoesNotWork.hs
{# LANGUAGE TemplateHaskell #} module DoesNotWork where import Language.Haskell.TH stringNewtype :: String > DecsQ stringNewtype name = do [d newtype $typeN = $typeN { $accN :: String } ] where typeN = mkName name accN = mkName ("un" ++ name)Main.hs
{# LANGUAGE TemplateHaskell #} module Main where import Works  import DoesNotWork $(stringNewtype "Abc") main :: IO () main = putStrLn $ unAbc $ Abc "Hello, World!"The code works with the Works module, but with the DoesNotWork module it refuses to compile:
DoesNotWork.hs:9:33: parse error on input ‘$accN’Why does that happen?
submitted by lamefun[link] [3 comments]
Proposal: Syntax for explicitly marking impossible cases in pattern matches
Proposal: Syntax for explicitly marking impossible cases in pattern matches
ANNOUNCE: brick 0.1 released (deprecates vtyui)
Dominic Steinitz: Stochastic Integration
Suppose we wish to model a process described by a differential equation and initial condition
But we wish to do this in the presence of noise. It’s not clear how do to this but maybe we can model the process discretely, add noise and somehow take limits.
Let be a partition of then we can discretise the above, allow the state to be random and add in some noise which we model as samples of Brownian motion at the selected times multiplied by so that we can vary the amount noise depending on the state. We change the notation from to to indicate that the variable is now random over some probability space.
We can suppress explicit mention of and use subscripts to avoid clutter.
We can make this depend continuously on time specifying that
and then telescoping to obtain
In the limit, the second term on the right looks like an ordinary integral with respect to time albeit the integrand is stochastic but what are we to make of the the third term? We know that Brownian motion is nowhere differentiable so it would seem the task is impossible. However, let us see what progress we can make with socalled simple proceses.
Simple ProcessesLet
where is measurable. We call such a process simple. We can then define
So if we can produce a sequence of simple processes, that converge in some norm to then we can define
Of course we need to put some conditions of the particular class of stochastic processes for which this is possible and check that the limit exists and is unique.
We consider the , the space of square integrable functions with respect to the product measure where is Lesbegue measure on and is some given probability measure. We further restrict ourselves to progressively measurable functions. More explicitly, we consider the latter class of stochastic processes such that
Less Simple Processes Bounded, Almost Surely Continuous and Progressively Adapted
Let be a bounded, almost surely continuous and progressively measurable process which is (almost surely) for for some positive constant . Define
These processes are cleary progressively measurable and by bounded convergence ( is bounded by hypothesis and is uniformly bounded by the same bound).
Bounded and Progressively Measurable
Let be a bounded and progressively measurable process which is (almost surely) for for some positive constant . Define
Then is bounded, continuous and progressively measurable and it is well known that as . Again by bounded convergence
Progressively Measurable
Firstly, let be a progressively measurable process which is (almost surely) for for some positive constant . Define . Then is bounded and by dominated convergence
Finally let be a progressively measurable process. Define
Clearly
The Itô Isometry
Let be a simple process such that
then
Now suppose that is a Cauchy sequence of progressively measurable simple functions in then since the difference of two simple processes is again a simple process we can apply the Itô Isometry to deduce that
In other words, is also Cauchy in and since this is complete, we can conclude that
exists (in ). Uniqueness follows using the triangle inequality and the Itô isometry.
Notes
We defer proving the definition also makes sense almost surely to another blog post.

This approach seems fairly standard see for example Handel (2007) and Mörters et al. (2010).

Rogers and Williams (2000) takes a more general approach.

Protter (2004) takes a different approach by defining stochastic processes which are good integrators, a more abstract motivation than the one we give here.

The requirement of progressive measurability can be relaxed.
Handel, Ramon von. 2007. “Stochastic Calculus, Filtering, and Stochastic Control (Lecture Notes).”
Mörters, P, Y Peres, O Schramm, and W Werner. 2010. Brownian motion. Cambridge Series on Statistical and Probabilistic Mathematics. Cambridge University Press. http://books.google.co.uk/books?id=eTbAdSrzYC.
Protter, P.E. 2004. Stochastic Integration and Differential Equations: Version 2.1. Applications of Mathematics. Springer. http://books.google.co.uk/books?id=mJkFuqwr5xgC.
Rogers, L.C.G., and D. Williams. 2000. Diffusions, Markov Processes and Martingales: Volume 2, Itô Calculus. Cambridge Mathematical Library. Cambridge University Press. https://books.google.co.uk/books?id=bDQyzoHWfcC.
Final call for papers for IFL 2015
Final call for papers for IFL 2015
Guide/Tutorial for Template Haskell?
Type level programming and Template Haskell seem like the magickal realms of Haskell. Type level programming is starting to get more and more blog posts and tutorials for, but I haven't really seen anything that details how to use Template Haskell or when it's a great idea to use. Could anyone point to some guides, tutorials, or other learning resources for this?
submitted by ephrion[link] [5 comments]
Guide/Tutorial for Template Haskell?
Type level programming and Template Haskell seem like the magickal realms of Haskell. Type level programming is starting to get more and more blog posts and tutorials for, but I haven't really seen anything that details how to use Template Haskell or when it's a great idea to use. Could anyone point to some guides, tutorials, or other learning resources for this?
submitted by ephrion[link] [5 comments]
[PADL 2016] First call for papers
New gtk2hs 0.12.4 release
Thanks to John Lato and Duncan Coutts for the latest bugfix release! The latest packages should be buildable on GHC 7.6, and the cairo package should behave a bit nicer in ghci on Windows. Thanks to all!
~d