Showing posts with label MathJax. Show all posts
Showing posts with label MathJax. Show all posts

Monday, 21 April 2025

Quadruple Seven

There has been an uncharacteristic hiatus in my posts during April. My last post was on April 3rd on the occasion of my 76th birthday, and I've been ill ever since. However, today is a very special day and marks the appearance of four sevens in the number associated with my diurnal age. The number is \( \textbf{27777} \).


This number has some interesting properties. Firstly, it is the last so-called \( \textbf{iban} \) number till 40000. The definition follows:

A number is called iban if its name (in English) does not contain the letter "i". Assuming that the name of every power of 10 greater than \(10^5\) ends in "-illion" (like million, billion, trillion, etc.), then the iban numbers are finite. Counting 0 (zero) there are 30276 of them, the largest being 777777. Iban numbers belong to the same family as aban numbers, eban numbers, oban numbers, and uban numbers. See my blog post Iban Numbers.

So whether we write "twenty seven thousand seven hundred seventy seven" (American style) or "twenty seven thousand seven hundred and seventy seven" (British style", the iban property is unaffected.

A second, related property of the number is that it is a member of OEIS A002810 with \(n=16\).


 A002810: smallest number containing \(n\) syllables in UK English.

The associated sequence in American English is OEIS A045736 where the "and" is omitted and thus the number of syllables required is one less. There is an interesting paradox associated with this OEIS sequence that goes like this (to quote from the OEIS comments) and involves one of its members (1117777):

a(19) = 111777 is precisely the number used for Berry's paradox. In UK English the name of the number 111777 requires 19 syllables -- "one hundred and eleven thousand seven hundred and seventy-seven" -- and it's exactly the smallest number containing 19 syllables in UK English.

The paradox occurs when we consider that this integer is "the least integer not nameable in fewer than nineteen syllables" yet 111777 has just now been defined in eighteen syllables with this last sentence. So there is a contradiction, because the smallest integer expressible in no fewer than nineteen syllables can be expressed in eighteen syllables. This contradiction is Berry's paradox.

It can be noted that 27777, though not prime itself, contains only prime digits (2 and 7). Interestingly we have:$$ \sqrt{27777}  \approx 166.66 \dots $$Thus there is a run of four sixes in the decimal expression of the square root.

While composing this post I ran into a problem with getting the vertical bar to cover the number. This was part of a broader problem with my LaTeX displaying properly on my Macbook Air when using Chrome. For example, mathematical variables would not display in italics but remained upright. These were just two of several other minor glitches and so I got Gemini to examine my HTML code and suggest a solution. It did and the fix worked just fine.

However, another problem soon emerged in that the new line command wasn't working and was being ignored in my updated MathJax code. Again, Gemini was quick to offer a solution.

Using \\ outside a Multi-Line Environment: 

If you're just putting \\ inside $ ... $ or $$...$$ without an environment, MathJax will likely ignore it because those delimiters are meant for single mathematical expressions, even if they span multiple lines of code.

Solution: 
You need to wrap your multi-line math content in an appropriate environment. Common ones supported by MathJax are (see Figure 1):
  • align: For aligning equations at a specific point (e.g., the equals sign).
  • gather: For centering multiple equations without alignment.
  • array: For creating arrays or matrices, where \\ separates rows. 


Figure 1

Again very helpful and just another example of the usefulness of AI. I'm hoping that soon I'll be able to use Gemini to organize, in various ways, the hundreds of posts that I've made in this Mathematics blog over the years. On a humorous note it was instructive to discover my ignorace about Blogger's user interface despite having used it for so many years.

You've hit upon a common point of confusion with website editors like Blogger. The composing window where you write your posts is part of Blogger's administrative interface. The styles (like fonts, sizes, and sometimes even line spacing) you see while typing in that editor are controlled by Blogger's own styling for the editor itself, not by the theme you apply to your public blog.

Think of it like writing a document in a word processor (the Blogger editor) versus how that document looks when you save it as a PDF or print it (your live blog). The word processor might use a default font for typing, but the final output uses the fonts you've specified in the document's formatting.

Therefore, you cannot directly change the font used within the Blogger post composing window by editing your blog's theme HTML or CSS. That part of the interface is controlled by Blogger's platform and is not customizable by individual users.

The good news is that this is purely a visual difference while you're working. Even though the text might not appear in Ubuntu while you're typing or editing, it will display correctly in Ubuntu 12px (or whatever styles you've set in your theme) when you save or publish the post and view it on your actual blog.

So, you don't need to worry that the editor font is different; it won't affect how your readers see your posts.

Wednesday, 31 May 2017

Oz Lotto


Last night for $1.30, I bought a single game in Oz Lotto. The winning numbers were 1, 4, 13, 19, 26, 31, 35 and the numbers in bold were the matching numbers that I had in my game. I got three out of the seven numbers which didn't win me a prize but it was impressive nonetheless I thought. What were the odds of this happening?

The number of ways that seven numbers can be selected from 45 numbers, disregarding order, is given by \( ^{45}C_7  = 45,379,620 \). Thus there is only one chance in 45,379,620 that the combination 1, 4, 13, 19, 26, 31, 35 will appear. Given those seven numbers, in how many ways can three of them be chosen? Clearly, in \( ^7C_3 \) = 35 ways.

This means that the number of ways in which three winning numbers can occur out of seven numbers is  \( \text{35 x }  ^{38}C_4 \). This is because none of the remaining four numbers can contain a winning number, thus it is a choice of any four of the remaining 38 non-winning numbers. The probability of choosing three winning numbers in a single game is thus: \[ \text{35 x } \frac{^{38}C_4}{^{45}C_7} = \frac{172235}{3025308} \approx 0.05693 \]Thus the figure as a percentage is about 5.7%. I dithered around trying to work this out but I'm fairly certain that this is the correct approach. For the sake of completeness, I'll work out the probability of getting four, five and six numbers:

For four numbers, chances are: \[ \text{35 x } \frac{^{38}C_3}{^{45}C_7} = \frac{4921}{756327} \approx 0.0065 \]For five numbers, chances are: \[ \text{21 x } \frac{^{38}C_2}{^{45}C_7} = \frac{4921}{15126540} \approx 0.0003 \]For six numbers, chances are:\[ \text{7 x } \frac{^{38}C_1}{^{45}C_7} = \frac{133}{22689810} \text{  or a very small chance!} \]Working on this post, I noticed that Blogger's rendering of LaTeX code has changed. Before, use of the $ sign at the beginning and end of a mathematical expression meant that MathJax was used to create the inline expression:
MathJax is an open-source JavaScript display engine for LaTeX, MathML, and AsciiMath notation that works in all modern browsers ... MathJax uses web-based fonts (in those browsers that support it) to produce high-quality typesetting that scales and prints at full resolution (unlike mathematics included as images) source
Now however, use of the dollar sign creates an inline image of the mathematical expression and it is only by use of the curved brackets and backslash that MathJax is invoked. The double dollar sign to create display expressions remains unchanged however, and there is no need yet to use backslash and open and closed square brackets. As before, in Android, nothing seems to work.

Tuesday, 7 February 2017

Android, LaTeX, Termial and Surreal Numbers

Donald Ervin Knuth
January 10, 1938 (age 79)
Milwaukee, Wisconsin, U.S.
It was with great surprise that I discovered my LaTeX-based equations in the two previous posts were not displaying using the Chrome browser on my Android phone. I checked using the default Internet browser and the result was the same. I checked on my iPad, using both Chrome and Safari, and all was well. On Ubuntu (under VirtualBox), using Firefox, and in Windows (under VirtualBox), using Microsoft Edge and Chrome, there was again no problem.

It was only Android, at least version 5 which I'm using on my Note 3. Maybe there is support for LaTeX in the 6 and 7 versions of Android. However, there's surprisingly little information about this problem and certainly no open admission anywhere that LaTeX isn't supported by Android.

This leads on to the term termial. I stumbled across it as I researched LaTeX because its creator, Donald Knuth, invented the term in his The Art of Computer Programming. It was devised as an analogy of the factorial, so as to illustrate the extension of the latter to the real numbers. It's defined as follows:

Let n \(\in\) ℤ > 0 (that is a positive integer) then n? = \(\sum_{k=1}^{n} k \)

Let n \(\in\) ℝ (that is a real number) then n? = \(\frac{n(n+1)}{2}\)

So 4? = 4 + 3 + 2 + 1 = 10 and \(\frac{1}{2}\)? = \(\frac{3}{8}\)

The second formula works for integers because 4? = 4 x 5 ÷ 2 = 10.

Donald Knuth is certainly an interesting character. This is a link to his biography on Wikipedia. He wrote a book called Surreal Numbers and below is a video in which he discusses the inspiration behind the idea of surreal numbers and how he actually set about writing the book in six days.



The book is freely available on the Internet and I've downloaded a copy and added it to my library.