for(int k=0;k <= odds.GetLength(-1);k++)
The above line of code is supposed to iterate through a two dimensional array of type Double but keeps
GetLength is zero-based. Try calling GetLength(0).
GetLength
GetLength(0)