Showing posts with label scales. Show all posts
Showing posts with label scales. Show all posts

Monday, 17 July 2023

Fusing Mathematics and Artificial Intelligence

Today I turned 27133 days old and one of this number's interesting properties is that it can be represented as a sum of two, three, four and five cubes and in more than one way in some cases. Specifically we can write: $$ \begin{align} 27133 &= 2744+24389\\&=14^3+29^3\\27133 &= 8+125+27000\\&=2^3+5^3+30^3\\27133&=1331+2744+3375+19683\\&=11^3+14^3+15^3+27^3\\27133&=8+8+1000+1728+24389\\&=2^3+2^3+10^3+12^3+29^3\\27133 &= 8+27+512+2197+24389\\&=2^3+3^3+8^3+13^3+29^3\\27133 &= 8+125+3375+8000+15625\\&=2^3+5^3+15^3+20^3+25^3\\27133 &= 125+4096+4913+5832+12167\\&=5^3+16^3+17^3+18^3+23^3\\27133&=216+3375+3375+8000+12167\\&=6^3+15^3+15^3+20^3+23^3 \end{align}$$This is all well and good but visually it's hardly exciting. What I'd like to be able to do is to create an octagonal balance with the eight cubes sitting at the ends of the eight arms. This would have some visual impact I'm sure.


Figure 1



Figure 2

Figures 1 and 2 are a start but how are the twin arms of the traditional scales in Figure 1 transformed into eight arms or four twin arms? How can all the cubes from \(2^3\) to \(30^3\) be represented in proportion, as is partially done in Figure2, and placed on the scales? It could be done with a lot of time and effort using traditional methods but how well will AI perform. 

Here are the directions I gave to DALL-E and Figure 3 shows the four results:

Draw a set of scales with eight arms instead of the traditional two and have cubes of various sizes placed at the ends of the arms so that they roughly balance.


Figure 3

As can be seen the results are not impressive. Here is a second prompt that I gave it and Figure 4 shows the results:

Octopus balancing cubes of various sizes at the end of each of its tentacles.

Figure 4

Again the results are unimpressive but I tried again with the following prompt and figure 5 shows the results:

A weighing machine has eight arms formed from four intersecting metal rods. There are pans at the end of each arm on which to place items to be weighed. In this case, the pans contain a variety of multicolored cubes of various sizes that roughly balance one another. 


Figure 5

Despite the very specific instructions the program wasn't up to the task. Figure 6 shows what NightCafe came up with using the same prompt as before:


Figure 6

I guess this is slightly better but it's still far short of what I want. Figure 7 is what starryai came up with:


Figure 7

Nope. DeepAI came up with the image shown in Figure 8.


Figure 8

I should refine my prompts further of course when using these tools but I was just interested in seeing what the initial outputs would be. Bard, Google's AI, now has the ability to display and import images (see my post Bard). It could not display my eight-armed scale as describe below:
Can you find an image of a scale for weighing that has eight trays instead of the traditional two, arranged evenly in a circle, so as to resemble the arms of an octopus.

There is no image of a scale for weighing that has eight trays instead of the traditional two, arranged evenly in a circle, so as to resemble the arms of an octopus.

The reason for this is that octopus scales are not designed for weighing. They are actually used for detecting motion and orientation. The eight arms of an octopus are covered in tiny suckers, and each sucker has a small sensor that can detect changes in pressure. This allows the octopus to sense the movement of its environment and to maintain its balance.

A scale that has eight trays would be very difficult to use for weighing. The trays would have to be very small, and it would be difficult to keep them evenly balanced. Additionally, the scale would be very sensitive to vibrations, which would make it difficult to get accurate readings.

So, while it is possible to imagine a scale that has eight trays, it is not practical or useful. Octopus scales are simply not designed for weighing.

However, Bard was more forthcoming with this straightforward request:

Can you find an image of an octahedron with the formula for its volume displayed. 

Sure, I found you an image of an octahedron with the formula for its volume displayed. 

The formula for the volume of an octahedron is:

Volume = (√2/3) * a^3

where a is the side length of the octahedron.

The octahedron is a three-dimensional shape with eight faces, each of which is an equilateral triangle. The volume of an octahedron is equal to one-third the volume of a regular tetrahedron with the same side length.

The site proved quite useful and so Bard can be used for finding mathematical content on the Internet, unlike ChatGPT 3.5 that does not have such access.

Thursday, 27 January 2022

The Modest Magnetism of 26596

Today's diurnal number, 26596, has the interesting property that the sums of its odd and even digits are equal. Thus we see that 5 + 9 = 14 and 2 + 6 + 6 = 14. I've written extensively about the implications of this odd-even algorithm in the following posts:

Figure 1: ring magnet

I use the term attractor to describe numbers like 26596 that are unchanged by the odd-even algorithm. They act like magnets, attracting other numbers to them as these numbers are subjected to repeated applications of the algorithm. I've applied the term "modest magnetism" to 26596 because it attracts only 10 numbers while 26569, with exactly the same digits, manages to attract 92 numbers. These captured numbers I've termed, appropriately, captives.

The captives of 26596 and their trajectories are as follows:
  • 26579 --> [26579, 26592, 26596]
  • 26585 --> [26585, 26579, 26592, 26596]
  • 26590 --> [26590, 26596]
  • 26591 --> [26591, 26598, 26596]
  • 26592 --> [26592, 26596]
  • 26594 --> [26594, 26596]
  • 26598 --> [26598, 26596]
  • 26603 --> [26603, 26592, 26596]
  • 26605 --> [26605, 26596]
  • 26613 --> [26613, 26603, 26592, 26596]
Figure 2 shows the same information in a more pictorial way. It can be seen that some numbers are only one step removed (26590, 26592, 26594, 25598, 26605), others are two steps removed (26591, 26579, 26603) and others are three steps removed (26585, 26613):


Figure 2

There are 11 attractors in the range between 26500 and 26700, representing 5.5% of the total numbers in the range. These attractors are:
  • 26503 with no captives
  • 26525 with no captives
  • 26530 with 19 captives
  • 26547 with no captives
  • 26552 with 18 captives
  • 26569 with 92 captives
  • 26574 with no captives
  • 26596 with 10 captives
  • 26659 with no captives
  • 26677 with no captives
  • 26695 with no captives
It can be seen that seven of the attractors have no captives. They might be termed inert attractors. Clearly some centuries have more attractors than others. Between 26500 and 26600, there are eight attractors but between 26600 and 26700 there are only three (and all of them inert). Anyway, the above list provides a basis for comparison between 26596 and other attractors in a range of roughly 100 on either side of it.

For some time now, I've been keeping a daily check on what numbers are attractors and what numbers are captives of attractors. Figure 3 shows the trajectory for 26595, my diurnal age yesterday:


Figure 3

Interestingly tomorrow's number, 26597, forms part of a vortex together with 26610. This vortex manages to capture 13 numbers: 26599, 26611, 26612, 26614, 26616, 26617, 26618, 26623, 26625, 26627, 26633, 26637, 26639. As can be seen, some captives are not captured by attractors but by vortices like {26597, 26610}. This is all explained in my paper that I uploaded to Academia: link.

Friday, 2 July 2021

Concrete, Laplace Resonance and Heptatonic Musical Scales

My son turned 36 today while my granddaughter is aged 18 and I'm aged 72. I couldn't help noticing that the ratio of these ages 18 : 36 : 72 reduces to 1 : 2 : 4 in its simplest form.

This set me on a course to find out what was interesting, mathematically and otherwise, about this ratio. If you search for these proportions, the first thing that pops up is, oddly enough, concrete. See Figure 1.


Figure 1: source

Yes, it turns out that 1 : 2 : 4 is the ratio of cement : sand : aggregrate, by volume, required to make M15 concrete. It is also known as PCC (Plain Cement Concrete) and can be used in construction of Levelling course, bedding for footing, concrete roads, etc. The site from which the table in Figure 1 was taken has lots of calculations for figuring out weights etc. but I'm not going to go into here as it's rather boring.

When I searched for 1 : 2 : 4 planetary motion, I came up with something more interesting: 
A Laplace resonance is a three-body resonance with a 1 : 2 : 4 orbital period ratio (equivalent to a 4 : 2 : 1 ratio of orbits). The term arose because Pierre-Simon Laplace discovered that such a resonance governed the motions of Jupiter's moons Io, Europa, and Ganymede. It is now also often applied to other 3-body resonances with the same ratios, such as that between the extrasolar planets Gliese 876 c, b, and e. Three-body resonances involving other simple integer ratios have been termed "Laplace-like" or "Laplace-type".
Figure 2 shows a simulation of the Jovian moons' Laplace resonance (source):

Figure 2: The three-body Laplace resonance exhibited
by three of Jupiter's 
Galilean moons. Conjunctions are highlighted
by brief color changes.There are two Io-Europa conjunctions
(green) and three Io-Ganymede conjunctions (grey) for each
Europa-Ganymede conjunction (magenta). This diagram is not to scale.

The Laplace resonance is a particular type of orbital resonance and the eponymous Wikipedia article has a lots of examples of this and other types of resonances.


Intrinsic to the 1 : 2 : 4 proportions is the number 7. In fact (1, 2, 4) represents one of the 15 partitions of 7. This immediately to mind heptatonic musical scales:
A heptatonic scale is a musical scale that has seven pitches, or tones, per octave. Examples include:
  • the major scale or minor scale in C major: C D E F G A B C
  • the relative minor, A minor, natural minor: A B C D E F G A 
  • the melodic minor scale, A B C D E F♯G♯A ascending, 
  • the melodic minor scale, A G F E D C B A descending 
  • the harmonic minor scale, A B C D E F G♯A 
  • the Byzantine or Hungarian, scale, C D E♭ F♯ G A♭ B C.

So any partition of 7 can be viewed in terms of such a scale. Applying this to 1 : 2 : 4, there are six possible divisions. Figure 3 shows two of these:


Figure 3

I've written about musical scales more generally in my previous post titled Equal Temperament Tuning.

Tuesday, 29 June 2021

Equal Temperament Tuning

Part 1 of Mathematics and Music

On February 2nd 2018, I made a short post titled The Mathematics of Music and this current post builds on the content that I first introduced there.

The idea of doing a series of posts on Mathematics and Music occurred to me recently and one of the first and most basic topic in this regard were the ratios involved in the Western musical scales. I found a very good resource for this topic titled Why 12 notes to the Octave and the author begins with this statement:

The Greeks realised that sounds which have frequencies in rational proportion are perceived as harmonious. For example, a doubling of frequency gives an octave. A tripling of frequency gives a perfect fifth one octave higher. They didn't know this in terms of frequencies, but in terms of lengths of vibrating strings. Pythagoras, who experimented with a monochord, noticed that subdividing a vibrating string into rational proportions produces consonant sounds. This translates into frequencies when you know that the fundamental frequency of the string is inversely proportional to its length, and that its other frequencies are just whole number multiples of the fundamental. 

The key point is that "sounds which have frequencies in rational proportion are perceived as harmonious" and the most important of these ratios is 3:2. The author continues:

The chromatic scale reflects this fact. In the 18th and 19th centuries, the chromatic scale was tuned using the idea of 3/2. In the most elegant of these, Thomas Young's tuning, several of the fifths were set exactly to 3/2, and the others were tempered slightly (to make octaves exact).

In the modern equal temperament (which came into practical use during the early part of the 20th century), all fifths are tuned to 2^(7/12)=1.49651..., slightly less than 3/2, and 12 repetitions of this ratio gets us back to where we started (after dropping down 7 octaves).

Of the various intervals, the only ones that are really well captured by tempered versions of the 3/2 scheme are: unison, 5th, major 2nd, and their reciprocals (octave, 4th, minor 7th).

The author then asks two key questions: 

  • Why 3/2? The choice of 3/2 says that, next to the octave, it should be regarded as the most important interval. 

  • Why do 12 steps work nicely? Interestingly, this can be explained in terms of simple number theory, namely continued fractions.
Ah, continued fractions! This is where the Mathematics comes in. The author remarks that it is necessary to understand when a power of 3/2 will be close to a power of 2 (because 2 represents an octave and we want a power of 2 that will be close to a power of 3/2). So we set an equation:$$\begin{align} \left ( \frac{3}{2}\right )^a &=2^b \text{ where }a \text{ and }b \text{ are natural numbers}\\\frac{3}{2} &=2^{\frac{b}{a}}\\&=2^x \text{ where }x \text{ is a real number}\\
x&=\frac{\log \left ( \frac{3}{2} \right )}{\log(2)}\\

&\approx 0.584962500721 \dots \end{align}$$There are no rational values of \(a\) and \(b\) that satisfy the equation which is why it is necessary to approximate with a real number \(x\). The continued fraction approximations to \(x\) are shown in the SageMath code in Figure 1 with permalink included:


Figure 1: permalink

We see that 7/12 gives a reasonable approximation (0.5833333... versus 0.5849625...). If we start with the octave between note A3 (220 Hz) and A4 (440 Hz) and divide it into 12 semitones according to \(220 \times 2^{k/12}\) where \(k=0 \dots 12\), we get what's shown in Figure 2.


Figure 2: link

Figure 3 shows what two different representations of the octaves:

Figure 3: link

As the author of Why 12 notes to the Octave remarks, there are other possible divisions and one of them is into 19 parts because 11/19 = 0.578947... is pretty close to 0.5849625... and this produces the situation shown in Figure 4 where octave is divided into 19 "semitones" according to  \(220 \times 2^{k/19}\) where \(k=0 \dots 19\).


Figure 4:  link

Let's remember that the above scales, and in fact nearly all modern scales, use equal temperament. As Wikipedia explains:
There are two main families of tuning systems: equal temperament and just tuning. Equal temperament scales are built by dividing an octave into intervals which are equal on a logarithmic scale, which results in perfectly evenly divided scales, but with ratios of frequencies which are irrational numbers. Just scales are built by multiplying frequencies by rational numbers, which results in simple ratios between frequencies, but with scale divisions that are uneven.

This is a big topic and I've only scratched the surface of it. More later.