Monthly Archives: February 2015

Immutability Through Interfaces in C#

In C#, immutability is a useful concept. It is easy to image a collection that, under some circumstances, should act as an immutable type – take for example a custom method that is designed to print collection’s values after some … Continue reading

Posted in C# Programming | Tagged

Object.Equals

I have been reading a chapter on C# canonical forms in “Accelerated C# 2008” by Trey Nash when I came across a piece of code that puzzled me. The book is an excellent resource on the language and I can … Continue reading

Posted in C# Programming | Tagged

Random Numbers Generator

At the heart of any Monte Carlo method are two fundamental building blocks. The first is the generation of uniform random variables. The second is the transformation of the generated uniform distribution to whichever is the required distribution for the … Continue reading

Posted in Monte Carlo | Tagged ,

Comparing Numerical Integration Methods

In this post I will re-introduce and compare four well-known numerical integration techniques for approximating definite integrals of single-variable functions (e.g. polynomials). The compared techniques, in the order of least to the most accurate, are: Rectangle rule; Mid-point rule; Trapezoid … Continue reading

Posted in Numerical Analysis | Tagged ,

A Better Way to Define Generic Collections

Greetings to my blog readers! Today I am feeling greedy. I want to create a collection class and I want it to do many-many things, including dancing and singing. I want it all! I want to be able to add … Continue reading

Posted in C# Programming | Tagged