The basic general strategy is: Replace a difficult problem with an easier one that has the same solution (or closely related solution). In other words, transform the representation of your difficult problem into a different representation that is easier to solve and producing solution that is a solution to your original problem.
As a simple example, how would you compute 2^3? Simple. You only have to do this: 2*2*2 (multiply three 2s). In general, for a^b, you just have to multiply a, b times. Here you just have to compute it straight away as this is a simple problem. No need to change the representation. But now what about 2000^(1/3)? (Remember, don't use library such as System.Math.Pow - the point here is for you to be able to create such library)
The solution to 2000^(1/3) is actually to find x such that x^3 = 2000. So, you got a Polynomial x^3-2000 = 0 (A different representation of the original problem, but the solution is the solution to the original problem). To solve it you just simply write code to implement the Bisection, Newton or Secant Method. Numerical Methods in Rootfinding Problem. You change a Power Problem into Root Finding Problem which is easier to solve. Numerical Methods for this problem has been established. Writing codes of Bisection, Newton or Secant Method is trivial.
Another example, solution to a linear systems Ax = B (here A & B are matrices), where you want to find the vector x. What you need to do is to change the matrix A into triangular form using Gaussian Elimination, then solving a linear system with A that is triangular matrix is simple. You can simply use Backward Substitution. Here you change the matrix A into a triangular matrix.
Here are more Examples (got it from Michael T. Heath):
-
Replacing infinite processes with finite processes, such as replacing integrals or infinite series with finite sums, or derivatives with finitie different quotients
-
Replacing general matrices with matrices having a simpler form (like the example above)
-
Replacing complicated functions with simple functions, such as polynomials
-
Replacing nonlinear problems with linear problems
-
Replacing differential equations with algebraic equations
-
Replacing high-order systems with low-order systems
-
Replacing infinite-dimensional spaces with finite-dimensional spaces
This general strategy is actually an algorithm design technique called Transform and Conquer. Another design techniques thay you may have heard are: Brute Force, Divide and Conquer, Decrease and Conquer, Greedy Technique and Dynamic Programming. Anany Levitin has a good book on this algorithm design techniques. If you want to be a serious software developer, you should live and breath these algorithm design techniques. The using C#, .NET Framework, Visual Studio is the easiest part! You need to master the more important thing: Algorithms.
PS: You cannot see the implementation of Syste.Math.Pow. When you ILDASM or use Reflector you will get that the body of the method is actually a function call to nternal method, that is method that exists within the CLR! Yes, folks, a method in the CLR, not in the Framework Library. So, you cannot see it.
. It also means that this internal method is so important that is has to be in the CLR. It also means it was built using C++.