Showing posts with label mathematics. Show all posts
Showing posts with label mathematics. Show all posts

Wednesday, May 25, 2011

Approximating π

The ancient fraction for estimating π, 22/7, is only accurate to two decimal places! Terrible, right? Well, that's about 0.04% too big. The common estimate of π to 5 digits (3.14159) is about 99.9999% of the true value. The fraction 355/113 is 0.0000085% too big. How terrible is that?

If you're trying to estimate the number of square feet in a circle with a radius of 100 feet, the fraction 22/7 adds 12.6 square feet to the true total of about 31,416 square feet. Using π to five digits to approximate the area is less than four square inches short of the true total. Using the ratio 355/113 instead of π to approximate the area overestimates the area by little more than a third of a square inch.

Say you're trying to cut a length of rope to go around a sphere the size of the Earth, and you know that the mean radius of the Earth is 6,371 km. If you use the ratio 355/113 to estimate π, then the 20,015-kilometer rope that you cut will be about a meter and a half too long. Measuring a length of rope that long is probably a bigger problem than the error in 355/113 as an approximation of π.

Wikipedia says:
...the decimal representation of π truncated to 11 decimal places is good enough to estimate the circumference of any circle that fits inside the Earth with an error of less than one millimetre, and the decimal representation of π truncated to 39 decimal places is sufficient to estimate the circumference of any circle that fits in the observable universe with precision comparable to the radius of a hydrogen atom.

Monday, August 9, 2010

An extensible number system

Earlier this year, I pointed to John Nystrom's 1862 proposal for a tonal (hexadecimal) number and measurement system to replace that of English in lieu of the metric system, and speculated that a system similar to Nystrom's could be used to generate a flexible number system that can be extended to describe any base. I've been noodling around with the idea since then, and here's what I've come up with.

Each of the numbers from 1 to 20 has a simple word that represents its basic identity. These words are simple consonant-vowel syllables; these should be generally accessible to speakers of numerous widespread languages, and contrast in place and manner of articulation as much as possible.

A table of the numbers and their names is below. The numbers are named as follows: "Ye" is 1; "bi" is 2; "sa" is 3; "te" is 4; "fu" is 5; "go" is 6; "mi" is 7; "pa" is 8; "ze" is 9; "du" is 10; "vo" is 11; "ki" is 12; "hu" is 13; "be" is 14; "su" is 15; "to" is 16; "fi" is 17; "ga" is 18; "me" is 19; and "pu" is 20.

The consonants are pronounced roughly as in English, and the vowels are pronounced as in Spanish or Japanese. A different orthography might be appropriate for English speakers: the word for 2 rhymes with "bumblebee", and the words for both 14 and 19 rhyme with "meh", but the words for 2 and 14 have different vowels. It'd probably be almost impossible to get English speakers to pronounce everything properly, though ;)

Each of these numbers can be used as the basis for a number system. To indicate that a number is the base, append "-n" to that number's name. For example, the word "du" represents the idea of 10. Thus, "dun" represents 10 within the context of the decimal (base-10) system. Effectively, appending "-n" to "du" means "10 raised to the 1st power".

This may not seem terribly useful. But the system can regularly extrapolate a word for any position in the number system as an exponent of the base. The decimal word for 100, for example, means literally "10 raised to the 2nd power". To do this, append "-l" to the word for the base, and follow it with the word for 2 ("bi") appended by "-n". So the word for a hundred is "dulbin". The word for 1,000 is "dulsan".

Overall, the system is strict place-value notation, similar to East Asian numbers. Numbers larger than the base are said as they are written in positional notation, multiplying and adding as necessary. Within the context of decimal math, "dun ye" (literally, "ten and one") is 11. "Bi dulbin dun bi" (literally, "two hundreds, ten, and two") is 212. "Sa dulsan ye dulbin bi dun sa" (literally, "three thousands, one hundred, two tens, and three") is 3,123. Since "dun" is the word for 10 in a base-10 context, the decimal system is internally known as the "dunal system".

This system's main feature is that it can predictably extend any base up to 20. The octal, or base-8, system, is the "panal system", since "pan" is the word for 8 in a base-8 context. "Te pan fu" (literally, "four 8s and five") is decimal 37. "Mi palbin fu pan sa" (literally, "seven 64s, five 8s, and three") is decimal 491. In hexadecimal, "te tolbin" (literally, "four 256s") is decimal 1,024.

This is more limited than scientific notation, of course. But without resorting to scientific notation, in vigesimal, the system can count to more than decimal 2 octillion. In decimal, the highest it can count is one short of one sextillion.

For convenience and clarity, binary can be handled in a somewhat different manner, the short binal system. In short binal, 1 is "ye", 2 is "bin", and 4 is "tel". Subsequent numbers are created by appending "-b" to the name of the power of 2. For example, "sab" is 8 (rather than "bilsan"), and "teb" is 16 (rather than "bilten"). Thus, "teb sab tel ye" is decimal 29.

One clear drawback is the high level of rhyming. These words are more similar than the same words in English; the example of decimal 212 above adequately demonstrates how repeating the same sounds could be confusing. Of course, explicitly repeating the base might make it easier to break the number up. And the difference in scale between "dulsan", "dulgon", and "dulzen" might be more readily apparent than between "thousand", "million", and "billion", given that people often fail to easily conceptualize the difference in degree. Certainly, this is a limited system deficient for the purposes that John Nystrom envisioned (replacing the number system of a natural language); but it may be useful within the scope of its intent.



















































































































































































































































































































































































































































































































































































































































































































NumberNameDecimalHexadecimalVigesimalShort Binal
1 Ye ye ye ye ye
2 Bi bi bi bi bin
3 Sa sasasabin ye
4 Te tetetetel
5 Fu fufufutel ye
6 Go gogogotel bin
7 Mi mi mi mi tel bin ye
8 Pa pa pa pa sab
9 Ze ze ze ze sab ye
10 Du ye dun du du sab bin
11 Vo ye dun ye vo vo sab bin ye
12 Ki ye dun bi ki ki sab tel
13 Hu ye dun sa hu hu sab tel ye
14 Be ye dun te be be sab tel bin
15 Su ye dun fu su su sab tel bin ye
16 To ye dun go ye ton to teb
17 Fi ye dun mi ye ton ye fi teb ye
18 Ga ye dun pa ye ton bi ga teb bin
19 Me ye dun ze ye ton sa me teb bin ye
20 Pu bi dun ye ton te ye pun teb tel
21 bi dun ye ye ton fu ye pun ye teb tel ye
22 bi dun bi ye ton go ye pun bi teb tel bin
23 bi dun sa ye ton mi ye pun sa teb tel bin ye
24 bi dun te ye ton pa ye pun te teb sab
25 bi dun fu ye ton ze ye pun fu teb sab ye
100 ye dulbin go ton te fu pun gob fub tel
256 bi dulbin fu dun go ye tolbin ki pun to pab
400 te dulbin ye tolbin ze ton ye pulbin pab mib teb





Saturday, January 16, 2010

Nystrom's hexadecimal numeral system, and others

Google Books is so cool. They have John Nystrom's 1862 proposal for a hexadecimal numeral system. Nystrom called it the "tonal system", because "ton" is the word for 16.

It's a pretty well-thought out system, with new numerals and base-16 addition and multiplication tables. Nystrom's ambition is pretty remarkable, and clearly a reason for the system's failure to gain traction. He proposes an entirely new system of words to replace the English number words, although perhaps there's more the replacing English's number words than he discusses. However, the number words he proposes as a system are actually pretty good. The words for numbers are generally simple CV syllables, and the words for the powers of 16 (16, 256, 4096...) are closed with a nasal consonant. The numeral system in general is similar to East Asian numbers, and the simple syllable structure prevents complex consonant clusters. "Vy" is the word for eleven, and "vytonvy" ("eleven 16s and eleven") is 187.

In general, this framework seems very elegant, and seems to point towards a framework easily extended to represent other bases. By adding a nasal consonant to the end of a CV numeral, you could establish that number as a base, as long as you developed words for the powers of that number. For example, "vyn" would be the basis for a base-11 "vynal system". There are problems with this system; Nystrom breaks the CV structure with the word for "one" and allows an initial nasal consonant, and the pronunciation he intends is somewhat unclear to me. I also suspect that the designs for the digits Nystrom chooses might be confusing (tho of course, that perception might simply reflect my inexperience with them). Adding some numbers for 17 to 20 could extend the system to cover vigesimal, allowing it to represent nearly any human numeral system.

I'm somewhat sympathetic, at least with mathematical thinking, to an weak inversion of the Sapir-Whorf hypothesis: that rather than an absence of words limiting the possibilities of human thought, the presence of words for counterintuitive concepts can be a "cognitive technology" that makes thinking in terms of those concepts easier. There's probably a much broader field of research on this than I'm aware of, but some relevant papers are "Number as a cognitive technology: Evidence from Pirahã language and cognition" and "Notation as a tool of thought".

Hex Headquarters has a system of English-inspired hexadecimal number words; Nystom's "vytonvy" (hexadecimal BB) would be "levtek eleven". Base42 is another hex system.

Tuesday, June 23, 2009

The Cubit

The Egyptian ordinary cubit was divided into 24 fingers, and the Egyptian foot was 16 fingers, or 2/3 of a cubit. The cubit was the length from the tip of the finger to the elbow; thus it was essentially half a yard. Many ancient terms for this unit mean "elbow".

Surviving Egyptian rulers use the royal cubit which was an ordinary cubit plus four fingers, and this royal cubit was the basis of ancient Egyptian architecture and other measurements. A natural cubit is 6/7 of the royal cubit. The Greeks and Romans took up the natural cubit, while other ancient and Mesopotamian cultures continued the use of the royal cubit for sacred architecture.

Given the imprecision of ancient meauring tools, it's possible to only imprecisely compare ancient Egyptian measures to contemporary ones. The surviving royal cubit rulers are 526 mm, plus or minus 3 mm, so an ordinary cubit would be 450.8 mm. The customary American foot is 457 mm. If metric inch (25 mm) was used instead of the international inch (25.4 mm), the ancient Egyptian ordinary cubit would be exactly 18 metric inches.

This is a coincidence. The ancient Egyptian system of measurement was the basis of the Greek system of measurement, which was the basis of the Roman system of measurement, which was the basis for contemporary customary measurement. But the system shifted over time. The Romans emphasized the inch ("uncia") as a unit of measure, and the Roman inch and the Roman cubit were a few miliimeters shorter than the contemporary American standard. The word "cubit" itself comes from the Roman word for the unit, "cubitus."

Effectively, a cubit is a measure of 18 inches, a foot and a half, or half a yard, which in ancient times was closer to 450 mm.

Sunday, June 21, 2009

The Mesoamerican Calendar & Vigesimal

Many people know that the Maya calendar "predicted" a "catastrophe" in 2012. But the Maya calendar was strange and interesting. Rather than solar years, the Maya Long Count calendar counted the number of days from the beginning of their mythological epoch thousands of years earlier.

Counting the number of days in 4,000 years is somewhat unwieldy in our numeral system—it nearly a million and a half days. Rather than our decimal (base-10) system, the Mayans used a vigesimal (base-20) system of numbers. In vigesimal, each position in the numeral is worth more: rather than 1s, 10s, 100s, and 1000s, each position denotes 1s, 20s, 400s, and 8000s. Rather than count a million and a half days in the seven digits it would take in decimal numbers, they counted it in just five digits. The Long Count calendar was not a pure vigesimal count; the Mayans modified it so the first two digits would count a period of 360 days rather than 400 days, which was close enough to a solar year to be convenient for their purposes.

Imagine we used a system of counting days, and we only used five digits to do so. The day 13,765 would be the 250th day of the 37th Julian year. The day 99,999 would be the 285th day of the 273rd year. On the next day, the count would reset to zero, because we aren't using a sixth digit for the hundred thousandth day. In a decimal count, this would happen about every 273 years. In the Maya's modified vigesimal count, it would have happened every 2,880,039 days, or roughly every 7,885 years.

If, using our decimal system, we began counting the number of days since April 27, 1821, then December 20, 2012, would be the 69,999th day. The next day (December 21) would be the 70,000th day. Something analogous happens on that day in the Mayan calendar. Obviously, it's a great chance for someone to get rich selling stuff to New Agers.

A couple of months ago, I was working on a fictional puzzle that would use a vigesimal day-count calendar, which is an unfamiliar and confusing concept for most people, and was monkeying around with base-20 math and how to represent it graphically. One of the problems with thinking about numbers in other bases is that they're very difficult to conceptualize for a number of reasons. One is that we don't have many words to describe these numbers. Another is that we don't have adequate glyphs to represent them: there are only ten Arabic numerals.

Most of us have been trained for years in base-10 math, and find it very intuitive, easy to talk about, and easy to think in. The English language has remnants of alternative systems: base-12 or dozenal (dozens, grosses, and great grosses), and base-20 or vigesimal ("Four score and seven years ago..."). These systems are pretty common in the world's cutures, because they are easier to divide. While ten is evenly divisible only by two and five, twenty is divisible by 2, 4, 5, and 10, and twelve is divisible by 2, 3, 4, and 6. The base-60 or sexagesimal system of the Sumerians and Babylonians consisted of six base-10 units, and survives in measurements of time and geometry.

Computer scientists have been using octal and hexadecimal, base-8 and base-16, for decades because they are convenient ways to handle binary, base-2, numbers. But computer scientists don't have numerals to represent them, instead borrowing the letters of the alphabet to stand in for the missing digits. It can be a somewhat confusing system.

In 1968, Bruce A. Martin proposed a new series of numerals that drew out the 15 numerals according to their bit position. I tried some similar ideas, drawing out the numbers in a way somewhat similar to the Maya numerals. There is a design problem with this, though: the numerals are difficult to distinguish and sometimes rely on counting out every digit. In Martin's system, for example, the glyph for three is hard to quickly and clearly distinguish from the glyph for five. Good font design, or using an angle bracket instead of a straight line for the back, could help, but it's an inherent problem.

Working with invented alphabets and scripts, it's clear that a quick and easy way to generate glyphs for sounds is to flip or rotate existing characters. In the Latin alphabet, M, W, q, p, b, and d, are all flipped or rotated. So, I tried something similar for the Arabic numerals, and borrowed the character for 10 from kanji. It's certainly not a perfect system: 1 and 8 rotated look like other symbols, and need to be somewhat modified. Ten looks very like a plus symbol, and they would need to be clearly distinguished in a font. OTOH, for those of us accustomed to the decimal system, it's easy to remember which glyph represents seventeen.

Another reason that it's easy to think in decimals and hard in other bases is that the decimal positions all have names. Ten tens is a hundred, ten hundreds is a thousand, a thousand thousands is a million, a thousand million is a billion, a million million is a trillion. English has some words in dozenal: a dozen dozen is a gross, a dozen gross is a great gross. But what is a score score? I borrowed and twisted around some old Scottish and English words to have some vocabulary to play with.

A score scores is a dubbock; a score dubbocks is a skelling, and a score skellings is a skell. In decimal, a score is 20, a dubbock is 400, a skelling is 8,000, and a skell is 160,000. Thus, two skelling, twelve dubbock, nine score and sixteen is equivalent to (in decimal) twenty thousand, nine hundred, and ninety-six. Somewhere after a skell is a villion, the vigesimal million.