jump to navigation

Musimatics and Fibonacci! December 20, 2009

Posted by Ragesh G R in Physics and Maths, Uncategorized.

Music and Maths! these two have always enamoured me, and more so when both of them are inter-linked.

One can write an epic on the mathematical fundamentals of music! But I want to focus on some of the interesting patterns in music.

For the benefit of people who don’t know let me touch upon the basics.

The Basics:

Let us take the 12 notes in the musical scale. If you play all twelve one after the other on the Piano, does n’t it “feel” like they are arranged like a stair-case, with equal intervals between steps? Yes, that’s exactly how your ear perceives it, “as if” it is an Arithmetic progression. But the truth is ou ears auditory response is logarithmic. Hence to give you a linear feel, their logs have to be in A.P. Hence actually, these notes are in Geometric Progression. That is, the ratio between each note is the same. What is this ratio?

Let’s look at 13 notes (inclduding the start of the next octave), say

C2, C2#, D2, D2#, E2, F2, F2#, G2, G2#, A2, A2#, B2, [C3… ] OR

Sa, Ri1, Ri2/Ga1, Ri3/Ga2, Ga3, Ma1, Ma2, Pa, Da1, Da2/Ni1, Da3/Ni2, Ni3, [Sa^…]

The 12 notes are arranged in octaves, in way that, the same note in the next octave is twice its frequency. So C3 is twice the frequency of C2, OR Sa^ is the twice the frequency of Sa. Hence all the corresponding notes in the next octave is in phase with the notes in the current octave, because the notes in the next octave are overtones of the current octave tones.

Therefore, when two people sing Sa and Sa^ together, you won’t feel much difference, because every second cycle, the wavelengths synchronise.

Now we have 12 notes in GP and Freq(Sa^) = 2*Freq(Sa).

Therefore each notes is separated by (12th root of 2) or Antilog((1/12 )* log2) = 1.0594 ~~ 1.06

So every note is 1.06 times the previous note, and so (1.06)^12 = 2.

The Patterns:

Now, I told you all these because, there are many interesting patterns based on it.

If you see, Sa and Pa are stable , that is they dont have any derivative frequencies, we can call them the base. That is why most musicians sing Sa, Pa, Sa^ before commencing the concert, so as to set the reference. But the beauty is still to come.

If you take the octave as flanked by the 13 notes from Sa to Sa^, Pa comes as the 8th note. Hmm, 13 and 8 ? does it ring a bell? yes our Fibonacci. 8 and 13 are both consecutive Fibonacci numbers.

One more!, typically not all 12 frequencies are used in a Scale,  only 7 are used, that is  chosing only one Ri, one Ga etc. So then our Octave becomes 8 notes in length. Now here Pa is the 5th note. 5 and 8 ? does it ring a bell? Oh yes, again consecutive Fibonacci numbers.

So POSITION Wise, Pa divides the Octave in the Golden Ratio, (5:3 Or 8:5)

What about frequency?

Since Pa is the 8th frequency in an Octave. So if the frequency of Sa is say X.

Pa is (1.06)^7 = 1.5 !

So, Sa, Pa, Sa^ has a frequency of X, 1.5X, and 2X respectively.

Notice anything? Yes! they are in Aithmetic Progression! So Pa divides the Octave in the Golden ratio position wise, and divides the frequency in to an Arithmetic Progression!

I can over-ambitious and say that even Frequency-wise Pa divides the Octave ALMOST in Golden Ratio (1.5 ~ 1.6). LOL! But I don’t want to :-p.

See, how many beautiful patterns emerge, even from a simple and basic analysis!

Disclaimer: If you are a music connoisseur, you might have known this already.

Easiest/Laziest formula for Nth Fibonacci number December 12, 2009

Posted by Ragesh G R in Physics and Maths, Uncategorized.

There are many formulae for finding the Nth Fibonacci number, from recursive to non-recursive. Let me try to find the easiest laziest formula.

We know that most of the Fibonacci numbers ( from the 7th )  are in the Golden ratio. Let Golden Ratio (1.618…) be Phi.

Then F(n) = F(n-1)*Phi = F(n-2)*Phi^2 and so on.

So generally F(n) = F(n-x)*Phi^x

But we can’t write F(n) = F(1)*Phi^(n-1), because this will give you inaccurate results , because the 1st 7 numbers do not follow the Golden Ratio.

So the highest value x can take for a fairly accurate determination is n-7.

So our formula becomes F(n) = F(n-(n-7))*Ph^(n-7)

Therefore F(n) = F(7)*Phi^(n-7)

Fibonacci series goes as 1,1,2,3,5,8,13

So F(n) = 13*Phi^(n-7).

This will give a you a fairly accurate value for Nth Fibonacci.

You can get even lazier and say F(n) = 3*Phi^(n-4)

But this will magnify the error for 3 non compliant numbers and give you inaccurate resulsts, but if only it was accurate, this would be better  from a laziness perspective if you are programming, because there are only 4 special cases. Of course we can argue that computation of Phi^(n-4) will take fractionally more time than computation of Phi^(n-7), but we can neglect that 🙂

Disclaimer : I am sure this already in some literature, but I got this idea when I was in the restoom (a link to my previous post LOL! ), so its mine , he he ! and I could not find similar text by “lazy” googling

The amazing quartet! June 2, 2009

Posted by Ragesh G R in Physics and Maths, Uncategorized.

Long ago, in school, when I was solving an arithmetic problem, I observed that 6^3 = 5^3 + 4^3 + 3^3.  Interesting enough, I thought, we have atleast one set of such 4 integers x,y,z,w such that w^3 = z^3 + y^3 + x^3.

Now they were all adjacent/contiguous integers. Great! I thought.

Now if that was not interesting enough, the triplet on the right hand side of the equation is a pythagorean triplet! Wow! Great!

So we have a  set of quartets {x,y,z,w} which are even more exclusive than the Pythagorean triplets, such that w^3 = z^3 + y^3 + x^3 AND z^2 = y^2 + x^2 (That is to say x,y,z are Pythagorean triplets). Beautiful is n’t it?

To put it simply, we have some perfect cubes which can be expressed as the sum of the cubes of a pythagorean triplet.

Well how frequent are these kind of quartets ? Well an easy answer would be {30, 40, 50, 60}.

But the speciality with {3,4,5,6} is that all 4 are adjecent integers. So they are unique, because, all other quartets will spread out and won’t be contiguous integers.!

Disclaimer: Some of you may have known/observed this already.

Making your Automatic car dance to your tune October 27, 2007

Posted by Ragesh G R in Physics and Maths, Uncategorized.
Tags: , , , , ,

The most common complaint and comment about an Automatic tranmission car, is that “You have less control over it, there is less involvement, compared to a manual transmission car”. Agreed, you can’t dictate the car to change to any gear that you please when you have an automatic transmission, but from my experience, I can tell you, if you know your know your car well enough, and if you are able to feel what it is doing, you can make even an automatic transmission car do whatever you please (well almost!).

First of all it’s possible due to the fact that most engine management system of today’s cars are intelligent and are based on a feedback system. The car does n’t just do pre-programmed actions irrespective of anything anymore, but on the contrary, listens to the driver input, tries to gauge the intention of the driver and tries to act accordingly, producing wonderful results almost always.

Next is your talent, how much you know your car and can undestand what it’s trying to tell you.

Downshifting in an Automatic car

Apart from the obvious manual change to”L” or “2”, the modern day cars downshift when you floor the throttle (full(open) throttle), provided the current revs of the engine can accomodate a higher rev as a result of a downshift. Imagine, you are cruising along at a rather relaxing speed of 70 km/hr in Overdrive(highest gear), when you need to pass a lorry in front of you, and an intersection is approaching, so it’s a case of now or never. But since you are in Overdrive, obviously you may not have enough acceleration to complete the overtaking manoeuvre before the intersection. No probs! You just floor the throttle, the car immediately shifts down to the previous(lower) gear, u get a jolt of acceleration, the next thing you know is you have passed the lorry at a speed of 90 km/hr. No more waiting for the speed to build up and no more nervous times during a pass

Warning: Do not ease the throttle(i.e., always keep it in full throttle) in the middle of the overtaking manoeuvre or else the car will upshift and lose acceleration and phew! you don’t want that to happen. So keep it floored till you have completed the overtaking.

Upshifting in an Automatic car

Now it’s not as straightforward as the downshift because here you have got to do all the work. The secret lies in judging if the rev (engine speed) is appropriate for an upshift and playing with the throttle. Generally, an automatic car upshifts to a higher gear in the start-middle of the rev band appropriate to the next higher gear. But sometimes we need power. So to prevent an upshift untill all the revs (max revs) at the current gear is utilised and you get maximum acceleration, floor the throttle and don’t ease it until it upshifts. But sometimes at higher speeds, not letting the car upshift will sometimes keep you in a low speed gear when you want speed and not torque. For that, just ease the throttle when you want an upshift. The engine management system(EMS) senses that since you are no longer in full throttle, you don’t the need the acceleration and torque and can upshift. Once it has shifted up, you can get back on the throttle (but not full throttle, else it might downshift again), and drive away. The beauty here is you can upshift almosy whenever you want to (i.e., at whatever rev you want to) by easing the throttle. But there is a limit to it. You can use this easing the throttle to upshift only when you are in the right rev band. If you ease the throttle too early (before the rev band of the next higher gear), the car will not upshift and you will just slow down, and if you don’t ease the throttle at all, it might not shift untill it hits the red line which might be unnecessary sometimes. It’s a delecate balance between speed and torque, and it’s a wonderful feeling when you get it just right.

When the driver sensitive EMS of the car, and your feel for the car work in tandom, you can make it dance to your tunes. It’s sometimes more challenging than a manual car because, there are no explicit levers to do anything, you are just overriding the car by thinking from it’s perspective.

Binary Clock! Ting Tong!:) February 1, 2007

Posted by Ragesh G R in Physics and Maths, Uncategorized.
Tags: , , , ,

No!, this is NOT a simple clock that has the numbers written on it in binary. This is different! When I was in my hometown, hearing the usual clock that strikes x times when the time is x hours, I got really annoyed. The reason is that at say 12 o clock The clock struck 12 times! That was both annoying to hear and hard to count.

This left me thinking. You see, the usual clock strikes in Unary system (just like a Turing machine!). It has only one symbol(sound), so it strikes “x” times to represent “x”. Just like we would mark 4 vertical lines on the board to represent say 4 points in a quiz.

So, if we use a binary system for the clock, the number of strikes could be limited to just 4 (2^4 = 16 >12). Here is how it will work. There will be two sounds, one to represent 0, and another, to represent 1. So with only 4 strikes, it can represent all the numbers in a 12 hour clock (and only 5 strikes even in a 24 hour clock). For instance, let’s assign the sound “Ting” to 0, and “Tong” to 1. So at 5 0’clock, the clock will strike “Ting Tong Ting Tong” (0101), and at 12 o’clock, it will strike “Tong Tong Ting Ting” (1100).

In a 12 hour period, the usual unary clock strikes 78 times (1+2+..+12) . But our Binary clock strikes only 48 times (12*4). Hence from 5 o’clock onwards, the binary clock strikes less than the usual unary clock.

The advantage of the Binary clock over other bases like, say 3, 4 etc is that, since only 2 sounds (not more) are used, its easy to remember them, and calculating the time is also easier. For example, if we use a decimal system, we need to remember 10 different sounds. If we use Base-3 for example, not only one needs to remember 3 sounds, the calculation of time, too are not straight forward ( ex: 201 (Base-3) = 2*9+1 = 19). So I think, Binary is compact and elegant.

But, many people (I mean people who do not know about Base systems), may find it difficult to compute the time. I just think its a novel idea! :).. I ll try implementing it soon.

The physics behind the pandemonium of driving cars November 13, 2006

Posted by Ragesh G R in Physics and Maths, Uncategorized.
Tags: , , , , , , , , , , , ,

You watch a Grand Prix on a Sunday evening, and your mother exclaims, “What pleasure could you possibly derive from watching the same cars go round and round the same track for 2 hours?”.

But there are plenty of things to learn as we watch the cars go by. In fact even without watching it, just a little contemplation on your side is enough to understand the nuances of the dynamics of a vehicle as it goes through sweeping corners at break-neck speeds.

What you see in Grand Prix can be applied in real-life situations. Contrary to popular belief, Grand Prix races do not encourage perilous driving styles. In fact they encourage you to drive safer, better and more efficiently, being cogniscent of what your vehicle is doing.

The secret of the tyres

The silken smooth tyres of the Grand Prix cars and bikes might give an impression that they are very slippery but it’s not so. The friction produced between the tyre and the road is directly proportional to the area of contact, hence the smoother and flatter the tyre, the better the grip. This is because when two very smooth surfaces come into contact, the distance between them is so small that it is comparable to atomic distances and hence nuclear strong forces take over (The same reason you feel grip when you run your finger on a marble floor).

This theory has an exception though, during rains. Then if you use a slick (smooth) tyre, the water that is trapped between the tyre and the tarmac does not have any place to go and formes a layer of accumulated water between the tyre and the road, causing a phenomenon called “Aquaplaning” or “Hydroplaning”, in which the grip reduces drastically and you feel as if your car is skating on ice. Hence during rainy days, it is advisable to change to a tyre that has deep treads that have channels to push away the accumulated water through sides.

Going around corners

Ever thought why the Grand Prix cars seem to be weaving around the track, changing lanes, sticking to a specific line every time? There is a beautiful science behind it. In fact it is very useful in day today life. I use it often. But you must stay within your lane. Every corner has a specific line which will provide you the fastest way around it, called the “Groove” or the “Racing line”.

The simple theory behind it is the less steering input you give, the faster your vehicle can travel, and the more stable it will be. That is because when you turn the wheels, especially the back wheels are not exactly pointing in the direction the car actually goes. Hence every moment the back wheels point along the line of the tangent to the curve that you are describing. Hence there is a constant force or acceleration applied to the vehicle. A component of the force produced by the wheels is expended in over coming the frictional force. Hence the lesser force you have along the direction of the motion of the car.

So the best way to approach a corner is : Enter from the outside, cut through the inside (apex) of the corner and exit through the outside of the corner, as shown in the picture. Our aim is to describe an arc that has the least curvature or most radius of curvature and the least circumference as possible. Also this method puts less stress on your tyres, and less g – force on you, hence, longer life for the tyres and smoother ride for you.

Cutting the apex of the corner

If you follow the inside line through out, then you have to brake and reduce the speed, hence you use more time.

If you follow the outside line, still the curvature is high and the circumference too is high, hence reduced speed, longer distance, hence more time wasted.

The secret is not to perceive the road as a whole and blindly trying to go parallel to the edges of the road. The secret lies in being able to see the straightest path between two points. The curves in the road need not bother you. Why go in a zig-zag way around a series of corners if you can find the straightest path between them.

As the followig diagram depicts, though the road seems to be winding in a zig-zag way, there is a fairly straight path through the series of curves.

Driving Line

The slip-stream

Now, why do Grand Prix cars pull up behind the car in front and sling shot their way past to over take? It is not any ambushing strategy. But it the exploitation of a beautiful phenomenon in fluid dynamics.

When a vehicle moves at speed, it creates turbulence in the air. And the turbulent air tends to stick to the vehicle more. The less aerodynamic the vehicle, the more the turbulence. Now due to this air behind a vehicle is moving and hence when you drive behind it, the relative velocity of the air in front of you w.r.t to you is less. Also since the vehicle in front drags some air with it, there is a low pressure created in its wake. Hence, for you the effect is low drag, and low drag means lesser energy to cut through the air. Hence with the same amount of energy, you can travel faster, travel at the same speed with less amount of energy. Hence you drive more economically. Now this a strategy I use in the high ways. But again be careful, do not go too close to the vehicle in front.

Thus with the help of physics, we can exploit the most out of our cars’ performance. Nature hides many secrets for us to exploit. It is up to science to find it out and explain it and it is up to us to use them to our benefit. I have tried to be as simple and basic as possible. Happy Driving!!

Note: I should clear some things out. When I say cut the corner, I mean in a one way highway with medians (like Old Mahabalipuram road), when u apply the same technique to a two way road like the E.C.R, read road as “lane”. Anyway the techniques are going to be the same, only that you are going to stick to your lane.

So the 2 figures will now look like this :

and this:
Just a little bit of adaptation :).