Wolfram Blog http://blog.wolfram.com News, views, and ideas from the front lines at Wolfram Research. Fri, 31 Jul 2015 18:21:17 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Over the Moon for Guinness World Records’ Diamond Anniversary http://blog.wolfram.com/2015/07/29/over-the-moon-for-guinness-world-records-diamond-anniversary/ http://blog.wolfram.com/2015/07/29/over-the-moon-for-guinness-world-records-diamond-anniversary/#comments Wed, 29 Jul 2015 19:01:38 +0000 Jenna Giuffrida http://blog.internal.wolfram.com/?p=27137 For the record, let’s start here.

First publication of Guiness World Records

Next month, Guinness World Records will officially celebrate its 60th anniversary as the leading authority on “record-breaking achievement.” A long-cherished favorite for holiday gifting and the coffee table, Guinness World Records not only provides a unique collection of knowledge but also encourages people to challenge the application of those facts. That’s not limited to the public, either; GWR itself holds the record for best-selling annual publication, a record set in 2013 that has yet to be overthrown.

As it’s their diamond anniversary, and such things should be commemorated, we wanted to join in with some unique, Wolfram|Alpha knowledge fun. We can tell you what the world’s largest cut diamond is or who currently holds the title of fastest human; we can even put some of these records to the test.

Speed of bullet vs fastest human speed

Looks like Superman will have to hold onto the record of “faster than a speeding bullet” for a little while longer.

Guinness tells us that the largest living tree is Hyperion, a redwood in California, and that the tallest living man is Sultan Kösen. How many Sultans would we need to reach the top of Hyperion?

How many Sultans to reach top of Hyperion

Ever wondered how old the longest-lived animal was? Her name was Ming, and she was a mollusc (bet you thought it would be a tortoise!).

How about something more data driven? What is the most frequent word in the longest text, the Holy Bible (KJV)?

Most frequent word in the longest text

“The”—shocking. Maybe that’s too pedestrian. In this space age when Pluto can send love across the galaxy (who knew the planet had such a big heart?), maybe we should be taking our records to the stars. What if Javier Sotomayor took his 82kg self and high jumped on the moon?

Javier Sotomayor high jump on the moon

It may be purely hypothetical, but at six times higher than the 1993 record of 2.45m, it would certainly be a giant leap for mankind! Perhaps Guinness should consider taking their 60th anniversary edition out of this world to continue inspiring all of us to dream bigger and reach higher.

]]>
http://blog.wolfram.com/2015/07/29/over-the-moon-for-guinness-world-records-diamond-anniversary/feed/ 0
Wolfram Community Featured Posts: Reddit’s 60-Second Button, Raspberry Pi, and More http://blog.wolfram.com/2015/07/21/wolfram-community-featured-posts-reddits-60-second-button-raspberry-pi-and-more/ http://blog.wolfram.com/2015/07/21/wolfram-community-featured-posts-reddits-60-second-button-raspberry-pi-and-more/#comments Tue, 21 Jul 2015 16:46:18 +0000 Emily Suess http://blog.internal.wolfram.com/?p=27022 Wolfram Community connects you with users from around the world who are doing fun, innovative, and useful things with the Wolfram Language. From game theory and connected devices to astronomy and design, here are a few posts you won’t want to miss.

Reddit 60-second button

Are you familiar with the Reddit 60-second button? The Reddit experiment was a countdown that would vanish if it ever reached zero. Clicking a button gave the countdown another 60 seconds. One Community post brings Wolfram Language visualization and analysis to Reddit’s experiment, which has sparked questions spanning game theory, community psychology, and statistics. David Gathercole started by importing a dataset from April 3 to May 20 into Mathematica and charted some interesting findings. See what he discovered and contribute your own ideas.

Frank Kampas solved a New York Times 4×4 KENKEN using the Wolfram Language, and others offered suggestions for making that code even faster. One Community member wondered if the puzzle itself could be automatically and randomly generated to make a complete Demonstrations Project app. Do you have a solution for solving 6×6 grids? You can chime in here.

RPi GSM

Alfonso Garcia-Parrado used the Wolfram Language with Raspberry Pi and the GSM module SIM908 to build a geo-location device with just a few lines of code. Check out his explanation to give it a try for yourself, or browse other topics related to Raspberry Pi and connected devices.

Flags from around the world

Inspired by the TED talk “Why City Flags May Be the Worst-Designed Thing You’ve Never Noticed,” Bernat Espigulé Pons sorted the flags of every country into similar groups, showing how simplistic designs increase the odds of duplicating flags. Browse the images for a peek at the similarities among country flags and snag the similarity graph of flags in CDF format.

Join Wolfram Community today to explore these and other topics, share the projects you’re working on, and collaborate with other Wolfram technology enthusiasts.

]]>
http://blog.wolfram.com/2015/07/21/wolfram-community-featured-posts-reddits-60-second-button-raspberry-pi-and-more/feed/ 0
New in the Wolfram Language: MailReceiverFunction http://blog.wolfram.com/2015/07/16/new-in-the-wolfram-language-mailreceiverfunction/ http://blog.wolfram.com/2015/07/16/new-in-the-wolfram-language-mailreceiverfunction/#comments Thu, 16 Jul 2015 19:15:44 +0000 Bob Sandheinrich http://blog.internal.wolfram.com/?p=27036 Despite the ever-growing list of tools I have for communication, email remains one of the most important. I depend on email to find out about all sorts of things: my ultimate Frisbee game is rained out, flights to Denver are only $80, my Dropbox account is almost full, my neighbor’s cat is missing (again). While filters are able to hide the pure junk and sort everything else into reasonable categories, reading and responding to email still requires a lot of manual interaction. The new mail receivers in the Wolfram Language finally let me automatically interact with email.

MailReceiverFunction is a Wolfram Language function that I deploy to the cloud to operate on incoming emails. When I deploy a function, I get an email address. Emails sent to that address will be processed by the function.

For example, I have a neighborhood mailing list that people use for all sorts of things like missing cats, plumber recommendations, and furniture for sale. Recently, I was in the market for a new dining room table. Here is an example of a MailReceiverFunction that checks if incoming mail mentions a table, and if so, sends a second email to my Wolfram ID:

MailReceiverFunction checking incoming mail for mention of table

Now I can subscribe to the mailing list as “receiver+5DHCTKhQ@wolframcloud.com,” and I will only receive messages about tables. But I can do better. Why not search messages for the price and create a log with the information I want? The function func below will run in my Wolfram Cloud account every time the mail receiver address receives an email:

Running func in Wolfram Cloud account every time an email is received

After some emails have been sent, I can retrieve the log by reading the log file in my Wolfram Cloud account.

Retrieving the log by reading the log file in my Wolfram Cloud account

Retrieving the data as a Dataset makes all sorts of sophisticated queries possible. Here, for example, are pictures of the tables that are under $200:

Retrieving the data as a Dataset

I’ve also had some fun using mail receivers as an address for receiving promotional emails. I made this one that creates a word cloud from incoming emails. When I come to a website that asks for an email address and I know I don’t want to be on their mailing list, I use this mail receiver instead. It’s usually not too hard to guess the source of the promotion.

Using mail receivers as an address for receiving promotional emails

Any Wolfram Language function can be used inside a mail receiver, so these examples are just a taste of what’s possible. I still spend plenty of time manually working my way through emails, but now as I read each message, I think about what a MailReceiverFunction could do with it instead.

MailReceiverFunction is supported in Version 10.2 of the Wolfram Language and Mathematica, and is rolling out soon in all other Wolfram products.


Download this post as a Computable Document Format (CDF) file.

]]>
http://blog.wolfram.com/2015/07/16/new-in-the-wolfram-language-mailreceiverfunction/feed/ 0
Wolfram Language Summer School Oxford 2015 http://blog.wolfram.com/2015/07/14/wolfram-language-summer-school-oxford-2015/ http://blog.wolfram.com/2015/07/14/wolfram-language-summer-school-oxford-2015/#comments Tue, 14 Jul 2015 07:10:45 +0000 Richard Asher http://blog.internal.wolfram.com/?p=26982 The first Wolfram Language Summer School Oxford—AKA Ecole d’été ‘Informathiques’ (click here for the French version of this blog post)—took place June 22 to July 3 at Wolfram’s European headquarters just outside the historic English university city.

Twenty-nine French students and three teachers traveled across the English Channel to attend the school, which drew scholars from the Créteil and the Nice and Versailles academies, as well as the Lycée d’Altitude de Briançon. The summer school was a result of the partnership between Wolfram, the three academies, and the INRIA Mediterranean Research Center.

Students at Wolfram Summer School Oxford

Most of the students were among the best achievers at this year’s regional Mathematics Olympiads in France, and five of the Briançon scholars were supported by the MATh.en.JEANS program.

Wolfram lent the students the top floor of its offices for the duration of the school, and on day one they discovered the power and possibility of Mathematica for scientific calculation. They spent day two getting familiar with the tool through practical exercises, learning basic syntax, how to program in it, and how to use the comprehensive online help resources.

The rest of the course focused on a scientific journey through particular themes in mathematics and computer science. These took place in groups of two or three students, under supervision by experts.

Student learning during Oxford Summer School

On the mathematical front, the students were asked to learn new concepts, understand them via practical experimentation, and then illustrate them by producing interactive teaching applications. Two-dimensional parametric curves and fractal geometric structures were among the interesting projects the students came up with.

Where computer science was concerned, students created algorithms and understood them through implementation, making them work with practical applications. Some worked on classical methods of constraint programming (such as filtering, global search, and backtracking) to solve Sudoku puzzles, while others worked on coding/decoding text or steganography techniques that allow one image to be hidden inside another.

Other groups tried out a few tricks with classic board games like Connect Four, Oware, and Hex (the late John Nash was one of its inventors), targeting machine management of the games, automation of play, and developing/implementing strategies.

Another group set about solving mathematical challenges on the Project Euler website, and conquered more than 15 of them.

The students also attended technical presentations given by Wolfram developers who discussed their daily work and projects. Alec Titterton showed the learners the Computer-Based Math (CBM) educational system, Gerli Jõgeva described how CBM lessons are made, and Abdul Dakkak spoke about image technology. Anthony Zupnik gave additional talks on cloud computing and machine learning.

There was plenty of time for fun and culture after each day’s learning was done. We took several trips to Oxford, which included a visit to university sites like Balliol College and the Bridge of Sighs, the Oxford University Museum of Natural History, and the Pitt Rivers Museum. And speaking of rivers, the students also tried a spot of punting—a traditional Oxford pastime—on the Cherwell. There was also an excursion to the historic little town of Woodstock and nearby Blenheim Palace, former residence of Winston Churchill.

Students with their certificates

Soundbites from the students’ return home with their certificates included such lines as “a super experience,” “an exciting course,” and “too short a stay.” As for the education, the warmth of the group, and the kindness of their host families, everyone had only good things to say!

The Wolfram Language Summer School Oxford was an outstanding success, and we’re already hoping to repeat it in years to come!

 

]]>
http://blog.wolfram.com/2015/07/14/wolfram-language-summer-school-oxford-2015/feed/ 4
New in the Wolfram Language: ISO Dates and More http://blog.wolfram.com/2015/07/09/new-in-the-wolfram-language-iso-dates-and-more/ http://blog.wolfram.com/2015/07/09/new-in-the-wolfram-language-iso-dates-and-more/#comments Thu, 09 Jul 2015 18:51:07 +0000 Nick Lariviere http://blog.internal.wolfram.com/?p=26950 A classic problem in numerical date notation is that various countries list year, month, and day in different orders, which was one of the motivations for the introduction of the ISO-8601 date element and interchange formats (Randall Monroe has a nice summary in this xkcd comic). In the upcoming release of the Wolfram Language, we’ve added built-in support for these ISO date formats:

DateString ISODate; DateString ISODateTime

The ISO specification also provides some alternative date representations, such as week dates (year, week of year, and day of week) and ordinal dates (year and day of year):

DateString ISOWeekDate; DateString ISOOrdinalDate

In addition to the ISO-8601 formats, we’ve added two new numerical representations of time to the Wolfram Language, UnixTime, which gives the number of seconds since January 1, 1970, 00:00:00 UTC, and JulianDate, which gives the number of days since November 24, 4714 BCE, 12:00:00 UTC:

UnixTime and JulianDate

UnixTime is a variation of AbsoluteTime, which gives the number of seconds since January 1, 1900, 00:00:00 in your local time zone; however, one important difference is that the output time zone is always in Coordinated Universal Time (UTC), which is one reason it’s frequently used for time stamps. FromUnixTime takes a UnixTime value and returns a corresponding DateObject:

FromUnixTime

JulianDate is frequently used in astronomical calculations, such as in the following approximation of SiderealTime:

SideRealTime

The Wolfram Language has a built-in (higher resolution) SiderealTime function, which I can compare with the approximation above:

UnitConvert SiderealTime

JulianDate can also be useful in representing many simple calendar systems, such as the Egyptian solar calendar, which has 365 days in every year, twelve 30-day months (plus one 5-day month), and no leap years. You can use the following function to get an Egyptian calendar date (which uses February 18, 747 BCE as its epoch date):

EgyptianCalendarDate

As a quick sanity check, I’ll put in the epoch date to verify I’m getting the correct results:

Verifying results with epoch date

And the inverse operation is simple: just add the years, months, and days to the epoch, and FromJulianDate constructs an appropriate DateObject expression:

Using FromJulianDate to construct a DateObject expression

Once again I can verify our formula by using the calendar epoch:

Verifying formula by using calendar epoch

And I can do the same with a more recent date, such as Today:

Using Today function

This works with any representation of dates in the Wolfram Language:
Representation of dates in Wolfram Language

These are just some of the uses for the new date and time features in the Wolfram Language. Once available, share your examples through Wolfram Tweet-a-Program or Wolfram Community! Stay tuned!

]]>
http://blog.wolfram.com/2015/07/09/new-in-the-wolfram-language-iso-dates-and-more/feed/ 0
New Publications Using Wolfram Technologies http://blog.wolfram.com/2015/07/02/new-wolfram-technologies-books-3/ http://blog.wolfram.com/2015/07/02/new-wolfram-technologies-books-3/#comments Thu, 02 Jul 2015 15:58:04 +0000 Jenna Giuffrida http://blog.internal.wolfram.com/?p=26925 We’re always on the lookout for new ideas and ways of using the Wolfram Language that our users produce and choose to write about in their books. In this quarter, we have applications that bridge the gap between art and geometry, and demonstrate intuitive data analysis. In addition to writing books, Wolfram welcomes authors to submit articles for publication in The Mathematica Journal, our very own in-house periodical.

A Primer of NMR Theory with Calculations Using Mathematica;  Clojure Data Analysis Cookbook, Second Edition; Geometric Design, An artful Portfolio of Mathematical Graphics; Extension of Mathematica System Functionality

A Primer of NMR Theory with Calculations in Mathematica

This text, written by Alan J. Benesi, presents the theory of NMR enhanced with Mathematica notebooks in short, focused chapters with brief explanations of well-defined topics, placing an emphasis on mathematical descriptions. Readers will find essential results from quantum mechanics that are concise and easy to use in predicting and simulating the results of NMR experiments. Mathematica notebooks implement the theory in the form of text, graphics, sound, and calculations. Based on class-tested methods developed by the author over his 25-year teaching career, these notebooks show exactly how the theory works and provide useful calculation templates for NMR researchers.

Clojure Data Analysis Cookbook, Second Edition

As data invades more and more of life and business, the need to analyze it effectively has never been greater. With Clojure and this book by Eric Rochester, you’ll soon be getting to grips with every aspect of data analysis, including working with Mathematica and R. You’ll start with practical recipes that show you how to load and clean your data, then get concise instructions to perform all the essential analysis tasks from basic statistics to sophisticated machine learning and data clustering algorithms. Get a more intuitive handle on your data through hands-on visualization techniques that allow you to provide interesting, informative, and compelling reports, and use Clojure to publish your findings to the web.

Geometric Design, An Artful Portfolio of Mathematical Graphics

Aristotle would have said that a geometer considers the shapes of things in the natural world not insofar as shapes are physical, but rather by abstracting the qualities of figure from the things themselves. In a philosophical sense, this book by Christopher Alan Arthur is thus one about geometry. Clearly for the mathematical reader at a level of study somewhat exceeding vector calculus, the book, with graphics and images produced with Mathematica, presents new possibilities of exotic shapes (by their torsion or concavity) still having desirable qualities such as differentiability, self-similarity, or compactness. Included in this book are many full-color pictures of tessellations, polyhedrons, unusual curves and surfaces, and fractals, along with their generating equations, coordinates, and diagrams.

Extension of Mathematica System Functionality

More and more, systems of computer mathematics find broader application in a number of natural, economical, and social fields. This book, by Viktor Aladjev and V. A. Vaganov, focuses on modular programming supported by Mathematica, one of the leaders in this field. Software tools presented in the book contain a number of useful and effective methods of procedural and functional programming that extend the system software and make it easier and more efficient to program the objects for various purposes. Furthermore, the book comes with freeware package AVZ_Package, which contains more than 680 procedures, functions, global variables, and other program objects.

New Symbolic Solutions of Biot’s 2D Pore Elasticity Problem

Alexander N. Papusha and Denis P. Gontarev’s article in The Mathematica Journal presents new symbolic solutions for the problem of pore elasticity and pore pressure. These techniques are based on the classic theoretical approach proposed by M. A. Biot. Both new symbolic and numerical solutions are applied to solve problems arising in offshore design technology, specifically dealing with the penetration of a gravity-based rig installed in the Arctic region of the North Sea of Russia. All symbolic approaches are based on solutions of the linear problem of the pore elasticity for homogeneous soil.

If you are interested in submitting an article to be considered for publication in The Mathematica Journal, check out our submissions page for material guidelines and more information. And for those of you who wish to be a part of the community of authors that have worked with Wolfram technologies, feel free to join the discussions taking place in our Authoring and Publishing group on Wolfram Community.

]]>
http://blog.wolfram.com/2015/06/26/ewtc-2015-celebrating-wolfram-in-europe/feed/ 2
Dates Everywhere in Pi(e)! Some Statistical and Numerological Musings about the Occurrences of Dates in the Digits of Pi http://blog.wolfram.com/2015/06/23/dates-everywhere-in-pie-some-statistical-and-numerological-musings-about-the-occurrences-of-dates-in-the-digits-of-pi/ http://blog.wolfram.com/2015/06/23/dates-everywhere-in-pie-some-statistical-and-numerological-musings-about-the-occurrences-of-dates-in-the-digits-of-pi/#comments Tue, 23 Jun 2015 18:03:09 +0000 Michael Trott http://blog.internal.wolfram.com/?p=26537 In a recent blog post, Stephen Wolfram discussed the unique position of this year’s Pi Day of the Century and gave various examples of the occurrences of dates in the (decimal) digits of pi. In this post, I’ll look at the statistics of the distribution of all possible dates/birthdays from the last 100 years within the (first ten million decimal) digits of pi. We will find that 99.998% of all digits occur in a date, and that one finds millions of dates within the first ten million digits of pi.

Here I will concentrate on dates than can be described with a maximum of six digits. This means I’ll be able to uniquely encode all dates between Saturday, March 14, 2015, and Sunday, March 15, 1915—a time range of 36,525 days.

We start with a graphical visualization of the topic at hand to set the mood.

Graphic visualization of pi

Get all dates for the last 100 years

This year’s Pi Day was, like every year, on March 14.

This year's pi day

Since the centurial Pi Day of the twentieth century, 36,525 days had passed.

Number of days between centurial pi days

We generate a list of all the 36,525 dates under consideration.

List of dates under consideration

For later use, I define a function dateNumber that for a given date returns the sequential number of the date, with the first date, Mar 15 1915, numbered 1.

Defining function dateNumber

I allow the months January to September to be written without a leading zero—9 instead of 09 for September—and similarly for days. So, for some dates, multiple digit sequences represent them. The function makeDateTuples generates all tuples of single-digit integers that represent a date. One could use slightly different conventions and minimal changes of the code and always enforce short dates or always enforce zeros. With the optional inclusion of zeros for days and months, I get more possible matches and a richer result, so I will use these in the following. (And, if you prefer a European date format of day-month-year, then some larger adjustments have to be made to the definition of makeDateTuples.)

Using makeDateTuples to generate tuples

Some examples with four, two, and one representation:

Examples of tuples with four, two, and one representation

The next plot shows which days from the last year are representable with four, five, and six digits. The first nine days of the months January to September just need four or five digits to be represented, and the last days of October, November, and December need six.

Which days from last year are representable with four, five, and six digits

For a fast (constant time), repeated recognition of a tuple as a date, I define two functions dateQ and dateOf. dateOf gives a normalized form of a date digit sequence. We start with generating pairs of tuples and their date interpretations.

Generating pairs of tuples and their data interpretations

Here are some examples.

RandomSample of tuplesAndDates

Most (77,350) tuples can be uniquely interpreted as dates; some (2,700) have two possible date interpretations.

Tuples interpreted as dates

Here are some of the digit sequences with two date interpretations.

Digit sequences with two date interpretations

Here are the two date interpretations of the sequence {1,2,1,5,4} as Jan 21 1954 or as Dec 1 1954 recovered by using the function datesOf.

Two date interpretations of the sequence 1,2,1,5,4

These are the counts for the four-, five-, and six-digit representations of dates.

Counts for the four-, five-, and six-digit representations of dates

And these are the counts for the number of definitions set up for the function datesOf.

Counts for the number of definitions set up for the function datesOf

Find all dates in the digits of pi

For all further calculations, I will use the first ten million decimal digits of pi (later I will see that ten million digits are enough to find any date). We allow for an easy substitution of pi by another constant.

Allowing for an easy substitution of pi by another constant

Instead of using the full digit sequence as a string, I will use the digit sequence split into (overlapping) tuples. Then I can independently and quickly operate onto each tuple. And I index each tuple with the index representing the digit number. For example:

Using the digit sequence split into overlapping tuples

Using the above-defined dateQ and dateOf functions, I can now quickly find all digit sequences that have a date interpretation.

Finding all digit sequences that have a date interpretation

Here are some of the date interpretations found. Each sublist is of the form {date, startingDigit, digitSequenceRepresentingTheDate}.

Sublist with the form date, startingDigit, digitSequenceRepresentingTheDate

We have found about 8.1 million dates represented as four digits, about 3.8 million dates as five digits, and about 365,000 dates represented as six digits, totaling more than 12 million dates altogether.

Dates represented at four, five, and six digits

Note that I could have used string-processing functions (especially StringPosition) to find the positions of the date sequences. And, of course, I would have obtained the same result.

Using string-processing functions to find the positions of the date sequences

While the use of StringPosition is a good approach to deal with a single date, dealing with all 35,000 sequences would have taken much longer.

Time to deal with 35,000 sequences

We pause a moment and have a look at the counts found for the 4-tuples. Out of the 10,000 possible 4-tuples, the 8,100 used appear each on average (1/10)⁴*10⁷=10⁴ times based on the randomness of the digits of pi. And approximately, I expect a standard deviation of about 100010^½≈31.6. Some quick calculations and a plot confirm these numbers.

Counts for the 4-tuples

The histogram of the counts shows the expected bell curve.

Histogram showing the expected bell curve

And the following graphic shows how often each of the 4-tuples that represent dates were found in the ten million decimal digits. We enumerate the 4-tuples by concatenating the digits; as a result, I see “empty” vertical stripes in the region where no 4-tuples are represented by dates.

4-tuples that represent dates were found in the ten million decimal digits

Now I continue to process the found date positions. We group the results into sublists of identical dates.

Grouping the results into sublists of identical dates

Every date does indeed occur in the first 10 million digits, meaning I have 36,525 different dates found. (We will see later that I did not calculate many more digits than needed.)

36,525 different dates found in the first 10 million digits

Here is what a typical member of dateGroups looks like.

What a typical member of a dateGroups look like

Statistics of all dates

Now let’s do some statistics on the found dates. Here is the number of occurrences of each date in the first ten million digits of pi. Interestingly, and in the first moment maybe unexpectedly, many dates appear hundreds of times. The periodically occurring vertical stripes result from the October-November-December month quarters.

Number of occurrences of each date in the first ten million digits of pi

The mean spacing between the occurrences also clearly shows the early occurrence of four-digit years with average spacings below 10,000, the five-digit dates with spacings around 100,000, and the six-digit dates with spacings around one million.

Mean spacing between the occurrences

For easier readability, I format the triples {date, startingPosition, dateDigitSequence} in a customized manner.

Formating triples for easier readability

The most frequent date in the first ten million digits of pi is Aug 6 1939—it occurs 1,362 times.

Most frequent date in the first ten million digits

Now let’s find the least occurring dates in the first ten million digits of pi. These three dates occur only once in the first ten million digits.

Least occurring dates in the first ten million digits

And all of these dates occur only twice in the first ten million digits.

Dates that occur only twice in the first ten million digits

Here is the distribution of the number of the date occurrences. The three peaks corresponding to the six-, five-, and four-digit date representations (from left to right) are clearly distinct. The dates that are represented by 6-tuples each occur only a very few times, and, as I have already seen above, appear on average about 1,200 times.

Distribution of the number of the date occurrences

We can also accumulate by year and display the date interpretations per year (the smaller values at the beginning and end come from the truncation of the dates to ensure uniqueness.) The distribution is nearly uniform.

Display the date interpretations per year

Let’s have a look at the dates with some “neat” date sequences and how often they occur. As the results in dateGroups are sorted by date, I can easily access a given date. When does the date 11-11-11 occur?

Dates with date sequences and how often they occur

And where does the date 1-23-45 occur?

Where does the date 1-23-45 occur

No date starts on its “own” position (meaning there is no example such as January 1, 1945 [1-1-4-5] in position 1145).

No date starts on its "own" position

But one palindromic case exists: March 3, 1985 (3.3.8.5), which occurs at palindromic position 5833.

One palindromic case exists

A very special date is January 9, 1936: 1.9.3.6 appears at the position of the 1,936th prime, 16,747.

1.9.3.6 appears at the position of the 1,936th prime

Let’s see what anniversaries happened on this day in history.

Anniversaries on January 9, 1936

While no date appeared at its “own” position, if I slightly relax this condition and search for all dates that overlap with its digits’ positions, I do find some dates.

All dates that overlap with its digits' positions

And at more than 100 positions within the first ten million digits of pi, I find the famous pi starting sequence 3,1,4,1 5 again.

Finding pi again within the first ten million digits

Within the digits of pi I do not just find birthday dates, but also physical constant days, such as the ħ-day (the reduced Planck constant day), which was celebrated as the centurial instance on October 5, 1945.

Finding physical constant days within pi

Here are the positions of the matching date sequences.

Positions of the matching date sequences using ListLogLinearPlot

And here is an attempt to visualize the appearance of all dates. In the date-digit plane, I place a point at the beginning of each date interpretation. We use a logarithmic scale for the digit position, and as a result, the number of points is much larger in the upper part of the graphic.

 Visualizing the appearance of all dates

For the dates that appear early on in the digit sequence, the finite extension of the date over the digits can be visualized too. A date extends over four to six digits in the digit sequence. The next graphic shows all digits of all dates that start within the first 10,000 digits.

All digits of all dates that start within the first 10,000 digits

After coarse-graining, the distribution is quite uniform.

Distribution is uniform using coarse-graining

So far I have taken a date and looked at where this date starts in the digit sequence of pi. Now let’s look from the reverse direction: how many dates intersect at a given digit of pi? To find the total counts of dates for each digit, I loop over the dates and accumulate the counts for each digit.

Finding the total counts of dates for each digit

A maximum of 20 dates occur at a given digit.

A maximum of 20 dates occur at a given digit.

Here are two intervals of 200 digits each. We see that most digits are used in a date interpretation.

Two intervals of 200 digits each

Above, I noted that I have about 12 million dates in the digit sequence under consideration. The digit sequence that I used was only ten million digits long, and each date needs about five digits. This means the dates need about 60 million digits. It follows that many of the ten million digits must be shared and used on average about five times. Only 2,005 out of the first ten million digits are not used in any of the date interpretations, meaning that 99.98% of all digits are used for date interpretations (not all as starting positions).

2,005 out of the first ten million digits are not used in any of the date interpretations

And here is the histogram of the distribution of the number of dates present at a certain digit. The back-of-the-envelope number of an average of six dates per digits is clearly visible.

Histogram of the distribution of the number of dates present at a certain digit

The 2,005 positions that are not used are approximately uniformly distributed among the first ten million digits.

The 2,005 positions that are not used are approximately uniformly distributed

If I display the concrete positions of the non-used digits versus their expected average position, I obtain a random walk–like graph.

Random walk-like graph

So, what are the neighboring digits around the unused digits? One hundred sixty two different five-neighborhoods exist. Looking at them immediately shows why the center digits cannot be part of a date: too many sequences of zeros before, at, or after.

Neighboring digits around the unused digits

And the largest unused block of digits that appears are the six digits between position 8,127,088 and 8,127,093.

Largest unused block of digits are the six digits between position 8,127,088 and 8,127,093

At a given digit, dates from various years overlap. The next graphic shows the range from the earliest to the latest year as a function of the digit position.

These are the unused digits together with three left- and three right-neighboring digits.

Unused digits together with three left- and three right-neighboring digits

Because the high coverage seems, in the first moment, maybe unexpected, I select a random digit position and select all dates that use this digit.

Random digit position and select all dates that use this digit

And here is a visualization of the overlap of the dates.

Code for visualization of the overlap of the dates
Visualization of the overlap of the dates

The most-used digit is the 1 at position 2,645,274: 20 possible date interpretations meet at it.

Most-used digit is the 1 at position 2,645,274: 20 possible date interpretations meet at it

Here are the digits in its neighborhood and the possible date interpretations.

Digits in its neighborhood and the possible date interpretations

If I plot the years starting at a given digit for a larger amount of digits (say the first 10,000), then I see the relatively dense coverage of date interpretations in the digits-date plane.

Plot of years starting at a given digit for a larger amount of digits

Let’s now build a graph of dates that are “connected”. We’ll consider two dates connected if the two dates share a certain digit of the digit sequence (not necessarily the starting digit of a date).

Graph of dates that are connected

Here is the same as the graph for the first 600 digits with communities emphasized.

Graph for the first 600 digits with communities emphasized

We continue with calculating the mean distance between two occurrences of the same date.

Calculating the mean distance between two occurrences of the same date

The first occurrences of dates

The first occurrences of dates are the most interesting, so let’s extract these. We will work with two versions, one sorted by the date (the list firstOccurrences) they represent, and one sorted by the starting position (the list firstOccurrencesSortedByOccurrence) in the digits of pi.

Using firstOccurrences and firstOccurrencesSortedByOccurrence

Here are the possible date interpretations that start within the first 10 digits of pi.

Possible date interpretations that start within the first 10 digits of pi

And here are the other extremes: the dates that appear deepest into the digit expansion.

Dates that appear deepest into the digit expansion

We see that Wed Nov 23 1960 starts only at position 9,982,546(=2 7 713039)—so by starting with the first ten million digits, I was a bit lucky to catch it. Here is a quick direct check of this record-setting date.

Direct check of this record-setting date

So, who are the lucky (well-known) people associated with this number through their birthday?

People associated with November 23 1960 as their birthday

And what were the Moon phases on the top dozen out-pi-landish dates?

Moon phases on the top dozen out-pi-landish dates

And while Wed Nov 23 1960 is furthest out in the decimal digit sequence, the last prime date in the list is Oct 22 1995.

The last prime date

In general, less than 10% of all first date appearances are prime.

Percentage of first date appearances being prime

Often one maps the digits of pi to a direction in the plane and forms a random walk. We do the same based on the date differences between consecutive first appearances of dates. We obtain typically looking 2D random walk images.

Date differences between consecutive first appearances of dates

Here are the first-occurring date positions for the last few years. The bursts in October, November, and December of each year are caused by the need for five or six consecutive digits, while January to September can be encoded with fewer digits if I skip the optional zeros.

First-occurring date positions for the last few years

If I include all dates, I get, of course, a much denser filled graphic.

All date positions for the last few years

A logarithmic vertical axis shows that most dates occur between the thousandth and millionth digits.

Logarithmic vertical axis shows that most dates occur between the thousandth and millionth digits

To get a more intuitive understanding of overall uniformity and local randomness in the digit sequence (and as a result in the dates), I make a Voronoi tessellation of the day-digit plane based on points at the first occurrence of a date. The decreasing density for increasing digits results from the fact that I only take first-date occurrences into account.

Voronoi tessellation of the day-digit plane based on points at the first occurrence of a date

Easter Sunday positions are a good date to visualize, as the date varies over the years.

Visualizing Easter Sunday dates

The mean first occurrence as a function of the number of digits needed to specify a date depends, of course, on the number of digits needed to encode a date.

Finding mean first occurrence

The mean occurrence is at 239,083, but due to the outliers at a few million digits, the standard deviation is much larger.

The mean occurrence is at 239,083

Here are the first occurrences of the “nice” dates that are formed by repetition of a single digit.

First occurrences of the nice dates that are formed by repetition of a single digit

The detailed distribution of the number of occurrences of first dates has the largest density within the first few 10,000 digits.

Detailed distribution of the number of occurrences of first dates

A logarithmic axis shows the distribution much better, but because of the increasing bin sizes, the maximum has to be interpreted with care.

Logarithmic axis showing the distribution

The last distribution is mostly a weighted superposition of the first occurrences of four-, five-, and six-digit sequences.

The last distribution is mostly a weighted superposition of the first occurrences of four-, five-, and six-digit sequences

And here is the cumulative distribution of the dates as a function of the digits’ positions. We see that the first 1% of the ten million digits covers already 60% of all dates.

Cumulative distribution of the dates as a function of the digits' positions

Slightly more dates start at even positions than at odd positions.

More dates start at even positions than at odd positions

We could do the same with mod 3, mod 4, … . The left image shows the deviation of each congruence class from its average value, and the right image shows the higher congruences, all considered again mod 2.

Deviation from congruences from average value and higher congruances

The actual number of first occurrences per year fluctuates around the mean value.

The number of first occurrences per year fluctuates around the mean value

The mean number of first-date interpretations sorted by month clearly shows the difference between the one-digit months and the two-digit months.

The mean number of first-date interpretations sorted by month

The mean number by day of the month (ranging from 1 to 31) is, on average, a slowly increasing function.

The mean number by day of the month

Finally, here are the mean occurrences by weekday. Most first date occurrences happen for dates that are Wednesdays.

The mean occurrences by weekday

Above I observed that most numbers participate in a possible date interpretation. Only relatively few numbers participate in a first-occurring date interpretation: 121,470.

Few numbers participate in a first-occurring date interpretation

Some of the position sequences overlap anyway, and I can form network chains of the dates with overlapping digit sequences.

Network chains of the dates with overlapping digit sequences

The next graphic shows the increasing gap sizes between consecutive dates.

Increasing gap sizes between consecutive dates

Distribution of the gap sizes:

Distribution of the gap sizes

Here are pairs of consecutively occurring date-interpretations that have the largest gap between them. The larger gaps were clearly visible in the penultimate graphic.

Pairs of consecutively occurring date-interpretations that have the largest gap between them

Dates in other expansions and in other constants

Now, the very special dates are the ones where the concatenated continued fraction (cf) expansion position agrees with the decimal expansion position. By concatenated continued fraction expansion, I mean the digits on the left at each level of the following continued fraction.

Concatenated continued fraction expansion

This gives the following cf-pi string:

Cf-pi string

And, interestingly, there is just one such date.

One date in cf-pi string

None of the calculations carried out so far were special to the digits in pi. The digits of any other irrational numbers (or even sufficiently long rational numbers) contain date interpretations. Running some overnight searches, it is straightforward to find many numeric expressions that contain the dates of this year (2015). Here they are put together in an interactive demonstration.

We now come to the end of our musings. As a last example, let’s interpret digit positions as seconds after this year’s pi-time at March 14 9:26:53. How long would I have to wait until seeing the digit sequence 3·1·4·1·5 in the decimal expansion of other constants? Can one find a (small) expression such that 3·1·4·1·5 does not occur in the first million digits? (The majority of the elements of the following list ξs are just directly written down random expressions; the last elements were found in a search for expressions that have the digit sequence 3·1·4·1·5 as far out as possible.)

Digit positions as seconds after this year's pi-time

Here are two rational numbers whose decimal expansions contain the digit sequence:

Two rational numbers whose decimal expansions contain the digit sequence

And here are two integers with the starting digit sequence of pi.

Two integers with the starting digit sequence of pi

Using the neat new function TimelinePlot that Brett Champion described in his last blog post, I can easily show how long I would have to wait.

Using TimelinePlot with pi

We encourage readers to explore the dates in the digits of pi more, or replace pi with another constant (for instance, Euler’s constant E, to justify the title of this post), and maybe even 10 by another base. The overall, qualitative structures will be the same for almost all irrational numbers. (For a change, try ChampernowneNumber[10].) Will ten million digits be enough to find every date in, say, E (where is October 21, 2014?) Which special dates are hidden in other constants? These and many more things are left to explore.

Download this post as a Computable Document Format (CDF) file.

]]>
http://blog.wolfram.com/2015/06/23/dates-everywhere-in-pie-some-statistical-and-numerological-musings-about-the-occurrences-of-dates-in-the-digits-of-pi/feed/ 5
Embrace the Maker Movement with the Raspberry Pi 2 http://blog.wolfram.com/2015/06/18/embrace-the-maker-movement-with-the-raspberry-pi-2/ http://blog.wolfram.com/2015/06/18/embrace-the-maker-movement-with-the-raspberry-pi-2/#comments Thu, 18 Jun 2015 19:07:23 +0000 Bernat Espigulé-Pons http://blog.internal.wolfram.com/?p=26461 “All of us are makers. We’re born makers. We have this ability to make things, to grasp things with our hands. We use words like ‘grasp’ metaphorically to also think about understanding things. We don’t just live, but we make. We create things.”
—Dale Dougherty

I joined the maker movement last year, first by making simple things like a home alarm system, then by becoming a mentor in local hackathons and founding a Wolfram Meetup group in Barcelona. There is likely an open community of makers that you can join close to where you live; if not, the virtual community is open to everyone. So what are you waiting for? With the Raspberry Pi 2 combined with the Wolfram Language, you really have an amazing tool set you can use to make, tinker, and explore.

Raspberry Pi 2 and Wolfram Technologies

If there was one general complaint about the Raspberry Pi, it was about its overall performance when running desktop applications like Mathematica. The Raspberry Pi Foundation addressed this performance issue early this year by releasing the Raspberry Pi 2 with a quad-core processor and 1 GB of RAM, which has greatly improved the experience of interacting with the device via the Wolfram Language user interface.

Here are 10 different ways to write a “Hello, World!” program for your Pi.

1) Enter a string:

Hello, World! string

2) Create a panel:

Hello, World! panel

3) Post “Hello, World!” in its own window:

Hello, World! in its own window

4) Create a button that prints “Hello, World!”:

Button that prints Hello, World!
Hello, World!

5) Make your Raspberry Pi speak “Hello, World!”:

Speak Hello, World!

6) Deploy “Hello, World!” to the Wolfram Cloud:

Deploy Hello, World! in the Wolfram Cloud

7) Send a “Hello, World!” tweet:

Send Hello, World Tweet

8) Display “Hello!” over the world map and submit it to Wolfram Tweet-a-Program:

Hello, World! Tweet-a-Program

9) Program your Pi to say “Hello, World” in Morse code by blinking an LED:

Hello, World! in Morse code

Notice that the GPIO interface requires root privilege to control the LED, so you must start Mathematica as root from the Raspberry Pi terminal by typing sudo mathematica in the command line.

Morse code video input for Hello, World

10) Apply sound to the “Hello, World” Morse code:

Applying sound to Hello World morse code
Wolfram Language morse player

This list could go on and on—it’s limited only by your imagination. If you want to send more “Hello, World” Morse code, you can make an optical telegraph. The Community post Raspberry Pi goes to school, by Adriana O’Brien, shows you how.

Adriana's Raspberry Pi setup
This image was created with Fritzing.

One of the most useful things about using the Wolfram Language on the Pi is that it works seamlessly with the new Wolfram Data Drop open service. This allows you to make an activity tracker in just a few minutes. For example, using Data Drop and a PIR (Passive InfraRed) motion sensor, I kept track of all human movements in my home hallway for several months.

Raspberry Pi connected to sensor
This image was created with Fritzing.

Every 20 minutes, the total number of counts was added to a databin, so I could monitor my hallway in real time from anywhere with Wolfram|Alpha. And if I wanted to, I could also analyze the data and create advanced visualizations like in this DateListPlot that distinguishes business days from weekends:

Using databin

The Wolfram Data Drop also accepts images from the Raspberry Pi camera module, so you can easily make a remote motion trigger with a PIR sensor.

Raspberry Pi with PIR sensor

Or you can take several snapshots and make a time lapse, like in this tutorial on turning my animated plant into a moving animal:

Plant animation

The Wolfram Language has all sorts of image processing algorithms built in. But for some applications, the image that comes out with DeviceRead["RaspiCam"] is just too small. To take the most out of your 5 MP camera module, use Import with the following specifications:

Using Import to enlarge a RaspiCam photo

Yes, this is the view from my office window. There is a lot of detail that can be processed in many different ways:

Processing details in different ways

The Wolfram Language on Raspberry Pi 2 is also great for rapid prototyping and 3D printing. It knows how to import and export hundreds of data formats and subformats. For example, here’s how to turn the skeletal polyhedron (specifically, a rhombicuboctahedron) drawn by Leonardo da Vinci into an object file that can be 3D printed:

Leonardo Da Vinci rhombicuboctahedron sketch into 3D printed

Finally, let me invite you to join Wolfram Community and show off your own Raspberry Pi projects, discover new ideas to use as starting points in your future creations, or take advantage of the many helpful tutorials that have been posted by fellow users.

Download this post as a Computable Document Format (CDF) file.

]]>
http://blog.wolfram.com/2015/06/18/embrace-the-maker-movement-with-the-raspberry-pi-2/feed/ 0