The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

Hi experts,

What is the application of logarithm and where to use it and give an example of a problem which we can solve using basic arithmatic(addition,mul,sub,etc...) and solving same problem using logarithm.I am not too skill in maths.Please help me with a good example for logarithm.

Regards,

Vimal.

What is the application of logarithm and where to use it and give an example of a problem which we can solve using basic arithmatic(addition,mul,su

Regards,

Vimal.

It's not quite what you are after, but a great example of logarithms is in the news right now - earthquakes are measured on a log scale.

Although the official measurement of quakes is done on the Moment magnitude Scale, ( http://en.wikipedia.org/wiki/Moment_magnitude_scale ), the media still like to report using the old Richter magnitude scale ( http://en.wikipedia.org/wiki/Richter_magnitude_scale ) - probably because more people have heard of it.

The energy released by an earthquake, which closely correlates to its destructive power, scales with the power of 1.5 of the shaking amplitude. A difference in magnitude of 1.0 is equivalent to a factor of 31.6 in the energy released; a difference in magnitude of 2.0 is equivalent to a factor of 1000 in the energy released.

So the difference between the 8.9 size quake in Japan and the recent 6.3 size quake in New Zealand is 8.9-6.3=2.6, so the difference in destructive power is (inverse log 2.6) to the power of 1.5 - which gives an answer of nearly 8000x the destructive force in the recent Japan quake!

By the way, inverse log of x = 10 to the power of x.

Example:

65536 teams

/2 = 32768

/2 = 16384

/2 = 8192

/2 = 4096

/2 = 2048

/2 = 1024

/2 = 512

/2 = 256

/2 = 128

/2 = 64

/2 = 32

/2 = 16

/2 = 8

/2 = 4

/2 = 2

/2 = 1

=16 rounds

log2(65536) = 16. Done!

as mentioned shortly above, logarithms can play role wherever exponential functions are used.

It's application could be useful when solving some population-related problems.

Consider a single-cell organism, which replicates itself every minute. To solve the question of how many cells will there be after t = 100 minutes you can use following formula: 2^t = 2^100.

To solve an inverse problem: determine the time needed to reaching the number of 1.000.000 cells. Here's where the logarithm will be the way to go:

2^t = 1.000.000 where the variable t is unknown. following formula solves this: t = log2(1.000.000) = ln(1.000.000)/ln(2)

I am a C++ programmer we have direct functions in c++ for finding logarithms. From the above comments I understand that when ever we are dealing with exponential operations we can use logarithm. But I think we have solve the exponential operations with out log also.For example

as TommySzalapski's example we can solve the same problem by doing LCM. I want to know the complexity of the TommySzalapski's example or the other examples mentioned above all comments which will take less time for do the job. How internally logarithm solves this problems what type of algorithm they are using. Since I am a programmer while designing a program i need to choose a less complexity method.

Thanks & Regards,

Vimal.

Wikipedia has one version (you can make it a bit faster by hard coding more).

http://en.wikipedia.org/wiki/Binary_logarithm

Since logs can be converted easily (log10(x) = log2(x)/log2(10)) then you can do any logarithm by using log 2 and then dividing by a constant. So all logarithms have a complexity of O(lg(lg(n))).

Thanks for your precious reply.See in c++ by calling a single api log() we can achieve

the doubling the frequency or exponential operations but what my doubt is what is the internal concept of logarithm what type of maths operation they are using (+,-,/,*,etc). Why i am asking is in c++ application especially signal processing as you said performance is the main factor so before choosing a method we need to know its details. Now i am developing a software dealing with dsp. I think you can guide me for this doubt.

Thanks & regards,

Vimal

I am satisfied with both your comments. One more question in school days i have used a logarithm table now I forget every thing about logarithm table.Because I am remembering we were used log table for solving log based problems with out using scientific calculator.Is CPU using any log tables for solving logarithms.

thanks & Regards,

Vimal.

You both has solved my doubt. Thanks Very much. I have some doubts in other maths topics I will post that by 2-3 days.

Thanks & regards,

Vimal.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

I know nothing about how it is done in any specific compiler, but can offer a couple of comments here.

As far as the algorithm goes, there are a number of them out there. Try Googling "algorithm for logarithm".

As far as speed goes, I'm skeptical. At least in the Intel world, ever since the 8087 chip (a coprocessor option for the original IBM PC), there has been hardware support for logarithms in the CPU available to most computers. Since the first Pentium, I believe it has been a standard part of the CPU. I would be surprised if external code could run faster than internal microcode for calculating logarithms, except in special cases.

One special case would be if you don't need the precision that the CPU offers. That might make for a faster calculation.

This is all speculation, of course, and would welcome anyone who has better information to comment on it.