FsLab Journal


Fork me on GitHub

100 FSharp exercises

This is FSharp version of 100 numpy exercises

Latest version of 100 numpy excercises are available at this repository.

The source of this document is available at https://github.com/teramonagi/fsharp-100-exercises . And your pull request is always welcome!!!

In this document, F# core library and Math.NET Numerics are used.

Neophyte

1. Import the numpy package under the name np

We use Math.NET Numerics libraries instead of numpy.

1: 
2: 
3: 
4: 
open MathNet.Numerics.LinearAlgebra
open MathNet.Numerics.LinearAlgebra.Double
open MathNet.Numerics.Statistics
open MathNet.Numerics.Data.Text;

2. Print the Fsharp version and the configuration.

1: 
printfn "%A" (System.Reflection.Assembly.GetExecutingAssembly().ImageRuntimeVersion)
"v4.0.30319"

3. Create a null vector of size 10

F# Core Library

1: 
2: 
let Z = Array.zeroCreate<float>(10)
printfn "%A" Z
[|0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0|]

Math.NET Numerics

1: 
2: 
let Z = DenseVector.zero<float>(10)
printfn "%A" (Z.ToArray())
[|0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0|]

4. Create a null vector of size 10 but the fifth value which is 1

F# Core Library

1: 
2: 
3: 
let Z = Array.zeroCreate<float>(10)
Z.[4] <- 1.0
printfn "%A" Z
[|0.0; 0.0; 0.0; 0.0; 1.0; 0.0; 0.0; 0.0; 0.0; 0.0|]

Math.NET Numerics

1: 
2: 
3: 
let Z = DenseVector.zero<float>(10)
Z.[4] <- 1.0
printfn "%A" (Z.ToArray())
[|0.0; 0.0; 0.0; 0.0; 1.0; 0.0; 0.0; 0.0; 0.0; 0.0|]

5. Create a vector with values ranging from 10 to 49

F# Core Library

1: 
2: 
let Z = (Array.init 40 (fun index -> index+10))
printfn "%A" Z
[|10; 11; 12; 13; 14; 15; 16; 17; 18; 19; 20; 21; 22; 23; 24; 25; 26; 27; 28; 29;
  30; 31; 32; 33; 34; 35; 36; 37; 38; 39; 40; 41; 42; 43; 44; 45; 46; 47; 48; 49|]

Math.NET Numerics

1: 
2: 
let Z = DenseVector.range 10 1 49
printfn "%A" (Z.ToArray())
[|10.0; 11.0; 12.0; 13.0; 14.0; 15.0; 16.0; 17.0; 18.0; 19.0; 20.0; 21.0; 22.0;
  23.0; 24.0; 25.0; 26.0; 27.0; 28.0; 29.0; 30.0; 31.0; 32.0; 33.0; 34.0; 35.0;
  36.0; 37.0; 38.0; 39.0; 40.0; 41.0; 42.0; 43.0; 44.0; 45.0; 46.0; 47.0; 48.0;
  49.0|]

6. Create a 3x3 matrix with values ranging from 0 to 8

F# Core Library

1: 
2: 
let Z = Array2D.init 3 3 (fun i j -> 3*i + j)
printfn "%A" Z
[[0; 1; 2]
 [3; 4; 5]
 [6; 7; 8]]

Math.NET Numerics

1: 
2: 
let Z = DenseMatrix.init 3 3 (fun i j -> float i * 3.0 + float j)
printfn "%A" (Z.ToArray())
[[0.0; 1.0; 2.0]
 [3.0; 4.0; 5.0]
 [6.0; 7.0; 8.0]]

7. Find indices of non-zero elements from [1,2,0,0,4,0]

F# Core Library

1: 
2: 
let Z = [|1; 2; 0; 0; 4; 0|] |> Array.mapi (fun i x -> (x<>0, i)) |> Array.filter fst |> Array.map snd
printfn "%A" Z
[|0; 1; 4|]

...Or, you can write as the following:

1: 
2: 
let Z = [|1; 2; 0; 0; 4; 0|] |> Array.mapi (fun i x -> (x<>0, i)) |> Array.choose (fun x -> if fst x then Some(snd x) else None)
printfn "%A" Z
[|0; 1; 4|]

Math.NET Numerics

You can use "Find" method implemented in Vector class directly if you can use MathNet.Numerics.FSharp 3.6.0. (My current MathNet.Numerics(.FSharp) is 3.5.0...)

1: 
2: 
3: 
let Z = vector [1.; 2.; 0.; 0.; 4.; 0.] |> 
    Vector.foldi (fun i x y -> if y <> 0.0 then Array.append x [|y|] else x) [||]
printfn "%A" Z
[|1.0; 2.0; 4.0|]

8. Create a 3x3 identity matrix

F# Core Library

1: 
2: 
let Z = Array2D.init 3 3 (fun i j -> if i=j then 1 else 0)
printfn "%A" Z
[[1; 0; 0]
 [0; 1; 0]
 [0; 0; 1]]

Math.NET Numerics

1: 
2: 
let Z = DenseMatrix.identity<float> 3
printfn "%A" Z
DenseMatrix 3x3-Double
1  0  0
0  1  0
0  0  1

9. Create a 5x5 matrix with values 1,2,3,4 just below the diagonal

F# Core Library

1: 
2: 
let Z = Array2D.init 5 5 (fun i j -> if (i=j+1) then i else 0)
printfn "%A" Z
[[0; 0; 0; 0; 0]
 [1; 0; 0; 0; 0]
 [0; 2; 0; 0; 0]
 [0; 0; 3; 0; 0]
 [0; 0; 0; 4; 0]]

Math.NET Numerics

1: 
2: 
let Z = DenseMatrix.init 5 5 (fun i j -> if (i=j+1) then float i else 0.0)
printfn "%A" Z
DenseMatrix 5x5-Double
0  0  0  0  0
1  0  0  0  0
0  2  0  0  0
0  0  3  0  0
0  0  0  4  0

10. Create a 3x3x3 array with random values

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
let rand = System.Random()
let Z = Array3D.init<float> 3 3 3 (fun _ _ _ -> rand.NextDouble())
for z in [0..2] do
    printfn "component: %d" z
    for y in [0..2] do
        for x in [0..2] do
            printf "%f" Z.[x, y, z]
        printfn ""
component: 0
0.8181430.4474620.099110
0.3723330.9536810.809327
0.4354480.8846420.773630
component: 1
0.6074840.6881920.674324
0.2126340.7712950.278699
0.6970820.5304860.810881
component: 2
0.7068160.4481470.434154
0.5871330.8825510.245825
0.5041890.6672840.912041

...or, since there is no strong support for Array3D class in F#, you may write the following :

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let Z = Array.init 3 (fun z -> Array2D.init<float> 3 3 (fun _ _ -> rand.NextDouble()))
for z in [0..2] do
    printfn "component: %d" z
    printfn "%A" Z.[z]
component: 0
[[0.3721322982; 0.3981586324; 0.559251156]
 [0.404150692; 0.4324637667; 0.6603301361]
 [0.494113141; 0.276249332; 0.318874017]]
component: 1
[[0.7787638394; 0.3145267006; 0.141725963]
 [0.2638802786; 0.2232922596; 0.7812286554]
 [0.2371239165; 0.2873621612; 0.8072521411]]
component: 2
[[0.3714186369; 0.8729534582; 0.6790689717]
 [0.3401521143; 0.2219345869; 0.665081383]
 [0.3798986307; 0.04048253039; 0.320993832]]

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
6: 
//I used the type "Array of DenseMatix" here because there is no 3D Vector in core Math.NET.
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = Array.init 3 (fun _ -> DenseMatrix.random<float> 3 3 rand)
for z in [0..2] do
    printfn "component: %d" z
    printfn "%A" Z.[z]
component: 0
DenseMatrix 3x3-Double
0.0407447   0.120073  0.693983
 0.311115   0.999568  0.317177
 0.809852  0.0448716  0.739624

component: 1
DenseMatrix 3x3-Double
  0.646609  0.0135653   0.133847
0.00646932   0.762651   0.147916
  0.956857   0.460275  0.0572422

component: 2
DenseMatrix 3x3-Double
 0.681326  0.872346  0.926097
 0.657112  0.872243  0.880209
0.0589799  0.829869  0.370419

Novice

1. Create a 8x8 matrix and fill it with a checkerboard pattern

F# Core Library

1: 
2: 
let Z = Array2D.init 8 8 (fun i j -> (i+j)%2)
printfn "%A" Z
[[0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]]

Math.NET Numerics

1: 
2: 
let Z = DenseMatrix.init 8 8 (fun i j -> float ((i+j)%2))
printfn "%A" Z
DenseMatrix 8x8-Double
0  1  0  1  0  1  0  1
1  0  1  0  1  0  1  0
0  1  0  1  0  1  0  1
1  0  1  0  1  0  1  0
0  1  0  1  0  1  0  1
1  0  1  0  1  0  1  0
0  1  0  1  0  1  0  1
1  0  1  0  1  0  1  0

2. Create a 10x10 array with random values and find the minimum and maximum values

F# Core Library

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let Z = Array2D.init 10 10 (fun i j -> rand.NextDouble())
let Zmin = Z |> Seq.cast<float> |> Seq.min
let Zmax = Z |> Seq.cast<float> |> Seq.max
printfn "%f, %f" Zmin Zmax
0.008262, 0.984671

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseMatrix.random<float> 10 10 rand
let Zmin = Matrix.reduce min Z  
let Zmax = Matrix.reduce max Z  
printfn "%f, %f" Zmin Zmax
0.024464, 0.985200

3. Create a checkerboard 8x8 matrix using the tile function

There is no numpy's tile equivalent function in F# and Math.NET. These are another solutions for Novice 1.

F# Core Library

1: 
2: 
let Z = Array.init 8 (fun i -> Array.init 8 (fun j -> (i+j)%2)) |> array2D
printfn "%A" Z
[[0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]
 [0; 1; 0; 1; 0; 1; 0; 1]
 [1; 0; 1; 0; 1; 0; 1; 0]]

Math.NET Numerics

1: 
2: 
3: 
let seq01 = Seq.initInfinite (fun i -> float(i%2))
let Z = DenseMatrix.initColumns 8 (fun i -> seq01 |> Seq.skip i |> Seq.take 8 |> DenseVector.ofSeq)
printfn "%A" Z
[|0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0; 0.0|]

4. Normalize a 5x5 random matrix (between 0 and 1)

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
let rand = System.Random()
let Z = Array2D.init 5 5 (fun i j -> rand.NextDouble())
let Zmin = Z |> Seq.cast<float> |> Seq.min
let Zmax = Z |> Seq.cast<float> |> Seq.max
let Z2 = Z |> Array2D.map (fun z -> (z-Zmin)/(Zmax-Zmin))
printfn "%A" Z2
[[0.3529709872; 0.4871104231; 0.7390661804; 0.594939187; 0.1334376429]
 [1.0; 0.05022067239; 0.3122416548; 0.5155899408; 0.9007523024]
 [0.0; 0.29116167; 0.2120741521; 0.88277239; 0.5641707357]
 [0.9633352815; 0.5937481143; 0.6954447466; 0.2440494057; 0.484364771]
 [0.5925360851; 0.421958456; 0.6892933246; 0.6635511131; 0.5341030878]]

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
6: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseMatrix.random<float> 5 5 rand
let Zmin = Matrix.reduce min Z  
let Zmax = Matrix.reduce max Z  
let Z2 = Matrix.map (fun z -> (z-Zmin)/(Zmax-Zmin) ) Z
printfn "%A" Z2
DenseMatrix 5x5-Double
0.991354  0.896427  0.392518  0.0923308  0.705818
0.193545   0.69344   0.88298   0.608356  0.307777
0.041891  0.718034         1    0.34067  0.485015
0.672707  0.610634  0.190861   0.559424  0.561157
0.532118         0  0.594558   0.595541  0.551953

5. Multiply a 5x3 matrix by a 3x2 matrix (real matrix product)

F# Core Library

1: 
2: 
3: 
4: 
5: 
let x = Array2D.create 5 3 1.0
let y = Array2D.create 3 2 1.0
let inner_product x y = Array.fold2 (fun s x y -> s+x*y) 0.0 x y
let Z = Array2D.init 5 2 (fun i j -> inner_product x.[i,*] y.[*,j] )
printfn "%A" Z
[[3.0; 3.0]
 [3.0; 3.0]
 [3.0; 3.0]
 [3.0; 3.0]
 [3.0; 3.0]]

Math.NET Numerics

1: 
2: 
let Z = (DenseMatrix.create 5 3 1.0) * (DenseMatrix.create 3 2 1.0)
printfn "%A" Z
DenseMatrix 5x2-Double
3  3
3  3
3  3
3  3
3  3

6. Create a 5x5 matrix with row values ranging from 0 to 4

F# Core Library

1: 
2: 
let Z = Array2D.init 5 5 (fun i j -> j)
printfn "%A" Z
[[0; 1; 2; 3; 4]
 [0; 1; 2; 3; 4]
 [0; 1; 2; 3; 4]
 [0; 1; 2; 3; 4]
 [0; 1; 2; 3; 4]]

Math.NET Numerics

1: 
2: 
let Z = DenseMatrix.init 5 5 (fun i j -> float j)
printfn "%A" Z
DenseMatrix 5x5-Double
0  1  2  3  4
0  1  2  3  4
0  1  2  3  4
0  1  2  3  4
0  1  2  3  4

7. Create a vector of size 10 with values ranging from 0 to 1, both excluded

It it little bit different from numpy's answer because there is no equivalent method with numpy's linspace in F#/Math.NET.

F# Core Library

1: 
2: 
3: 
let Z = Array.init 12 (fun i -> 1.0/11.0*(float i)) 
let Z2 = Array.sub Z 1 10
printfn "%A" Z2
[|0.09090909091; 0.1818181818; 0.2727272727; 0.3636363636; 0.4545454545;
  0.5454545455; 0.6363636364; 0.7272727273; 0.8181818182; 0.9090909091|]

Math.NET Numerics

1: 
2: 
let Z = (DenseVector.rangef 0.0 (1.0/11.0) 1.0).SubVector(1, 10)
printfn "%A" Z
seq [0.09090909091; 0.1818181818; 0.2727272727; 0.3636363636; ...]

8. Create a random vector of size 10 and sort it

F# Core Library

1: 
2: 
3: 
let rand = System.Random()
let Z = Array.init 10 (fun _ -> rand.NextDouble()) |> Array.sort 
printfn "%A" Z
[|0.06741350147; 0.1207639548; 0.132379477; 0.2175480808; 0.2470006255;
  0.3752000147; 0.6097498995; 0.6707792923; 0.6979412128; 0.7204493194|]

Math.NET Numerics

1: 
2: 
3: 
4: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseVector.random<float> 10 rand
MathNet.Numerics.Sorting.Sort(Z)
printfn "%A" Z
seq [0.07778542166; 0.3342726321; 0.4844895324; 0.5086863756; ...]

9. Consider two random array A anb B, check if they are equal.

F# Core Library

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let A = Array.init 5 (fun _ -> rand.Next(2))
let B = Array.init 5 (fun _ -> rand.Next(2))
let equal = Array.forall2 (=) A B
printfn "%A" equal
false

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
let rand = new MathNet.Numerics.Distributions.DiscreteUniform(0, 1)
let A = rand.Samples() |> Seq.take 5 |> Seq.map float |> DenseVector.ofSeq
let B = rand.Samples() |> Seq.take 5 |> Seq.map float |> DenseVector.ofSeq
let equal = A=B
printfn "%A" equal
false

10. Create a random vector of size 30 and find the mean value

F# Core Library

1: 
2: 
3: 
4: 
let rand = System.Random()
let Z = Array.init 30 (fun _ -> rand.NextDouble())
let m = Z |> Array.average
printfn "%f" m
0.521047

Math.NET Numerics

1: 
2: 
3: 
4: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseVector.random<float> 30 rand
let m = Z |> Statistics.Mean
printfn "%f" m
0.503866

Apprentice

1. Make an array immutable (read-only)

F# Core Library

1: 
2: 
3: 
4: 
//List is immutable in F# but it does not allow us to do random access.
let Z = List.init 10 (fun _ -> 0)
//It does not work.
//Z.[0] <- 1

Math.NET Numerics

1: 
//There is no way to make an array immutable.

2. Consider a random 10x2 matrix representing cartesian coordinates, convert them to polar coordinates

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let rand = System.Random()
let Z = Array2D.init 10 2 (fun _ _ -> rand.NextDouble())
let X, Y = Z.[*,0], Z.[*,1]
let R = Array.map2 (fun x y -> sqrt(x*x+y*y)) X Y
let T = Array.map2 (fun x y -> System.Math.Atan2(y, x)) X Y
printfn "%A" R
printfn "%A" T
[|0.6358613206; 0.2241523931; 0.4772972823; 0.5626806615; 0.7503892053;
  0.4744589629; 0.9780254347; 0.9169400938; 0.7344512088; 0.5728584853|]
[|1.229586763; 0.4000843415; 0.5545630015; 0.3513114868; 0.6525798344;
  0.7963433431; 0.3175930114; 1.425786203; 1.075201954; 1.104927083|]

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseMatrix.random<float> 10 2 rand
let X, Y = Z.[*,0], Z.[*,1]
let R = X.*X + Y.*Y |> Vector.map sqrt
let T = Y./X |> Vector.map System.Math.Atan
printfn "%A" R
printfn "%A" T
seq [0.9811709949; 0.709722243; 0.9811314768; 0.9260660666; ...]
seq [1.164909639; 0.4762100481; 1.564431315; 1.445461331; ...]

3. Create random vector of size 10 and replace the maximum value by 0

F# Core Library

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let Z = Array.init 10 (fun _ -> rand.NextDouble())
let Zmax = Array.max Z
Z.[Array.findIndex ((=) Zmax) Z] <- 0.
printfn "%A" Z
[|0.9063102272; 0.4684857877; 0.0; 0.001134485473; 0.8335983766; 0.67022116;
  0.3149158132; 0.008618333847; 0.7312221116; 0.4121202149|]

Math.NET Numerics

1: 
2: 
3: 
4: 
let rand = MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseVector.random<float> 10 rand
Z.[Vector.maxIndex Z] <- 0.
printfn "%A" Z
seq [0.3064510935; 0.5007114529; 0.0; 0.3219453247; ...]

4. Create a structured array with x and y coordinates covering the [0,1]x[0,1] area.

There is no way to assign name to Array2D/Matrix. We might should use Deedle in this situation.

F# Core Library

1: 
2: 
3: 
let element = Array.init 10 (fun i -> 1.0/9.0*(float i)) 
let Z = Array2D.init 10 10 (fun i j -> (element.[j], element.[i]))
printfn "%A" Z
[[(0.0, 0.0); (0.1111111111, 0.0); (0.2222222222, 0.0); (0.3333333333, 0.0);
  (0.4444444444, 0.0); (0.5555555556, 0.0); (0.6666666667, 0.0);
  (0.7777777778, 0.0); (0.8888888889, 0.0); (1.0, 0.0)]
 [(0.0, 0.1111111111); (0.1111111111, 0.1111111111);
  (0.2222222222, 0.1111111111); (0.3333333333, 0.1111111111);
  (0.4444444444, 0.1111111111); (0.5555555556, 0.1111111111);
  (0.6666666667, 0.1111111111); (0.7777777778, 0.1111111111);
  (0.8888888889, 0.1111111111); (1.0, 0.1111111111)]
 [(0.0, 0.2222222222); (0.1111111111, 0.2222222222);
  (0.2222222222, 0.2222222222); (0.3333333333, 0.2222222222);
  (0.4444444444, 0.2222222222); (0.5555555556, 0.2222222222);
  (0.6666666667, 0.2222222222); (0.7777777778, 0.2222222222);
  (0.8888888889, 0.2222222222); (1.0, 0.2222222222)]
 [(0.0, 0.3333333333); (0.1111111111, 0.3333333333);
  (0.2222222222, 0.3333333333); (0.3333333333, 0.3333333333);
  (0.4444444444, 0.3333333333); (0.5555555556, 0.3333333333);
  (0.6666666667, 0.3333333333); (0.7777777778, 0.3333333333);
  (0.8888888889, 0.3333333333); (1.0, 0.3333333333)]
 [(0.0, 0.4444444444); (0.1111111111, 0.4444444444);
  (0.2222222222, 0.4444444444); (0.3333333333, 0.4444444444);
  (0.4444444444, 0.4444444444); (0.5555555556, 0.4444444444);
  (0.6666666667, 0.4444444444); (0.7777777778, 0.4444444444);
  (0.8888888889, 0.4444444444); (1.0, 0.4444444444)]
 [(0.0, 0.5555555556); (0.1111111111, 0.5555555556);
  (0.2222222222, 0.5555555556); (0.3333333333, 0.5555555556);
  (0.4444444444, 0.5555555556); (0.5555555556, 0.5555555556);
  (0.6666666667, 0.5555555556); (0.7777777778, 0.5555555556);
  (0.8888888889, 0.5555555556); (1.0, 0.5555555556)]
 [(0.0, 0.6666666667); (0.1111111111, 0.6666666667);
  (0.2222222222, 0.6666666667); (0.3333333333, 0.6666666667);
  (0.4444444444, 0.6666666667); (0.5555555556, 0.6666666667);
  (0.6666666667, 0.6666666667); (0.7777777778, 0.6666666667);
  (0.8888888889, 0.6666666667); (1.0, 0.6666666667)]
 [(0.0, 0.7777777778); (0.1111111111, 0.7777777778);
  (0.2222222222, 0.7777777778); (0.3333333333, 0.7777777778);
  (0.4444444444, 0.7777777778); (0.5555555556, 0.7777777778);
  (0.6666666667, 0.7777777778); (0.7777777778, 0.7777777778);
  (0.8888888889, 0.7777777778); (1.0, 0.7777777778)]
 [(0.0, 0.8888888889); (0.1111111111, 0.8888888889);
  (0.2222222222, 0.8888888889); (0.3333333333, 0.8888888889);
  (0.4444444444, 0.8888888889); (0.5555555556, 0.8888888889);
  (0.6666666667, 0.8888888889); (0.7777777778, 0.8888888889);
  (0.8888888889, 0.8888888889); (1.0, 0.8888888889)]
 [(0.0, 1.0); (0.1111111111, 1.0); (0.2222222222, 1.0); (0.3333333333, 1.0);
  (0.4444444444, 1.0); (0.5555555556, 1.0); (0.6666666667, 1.0);
  (0.7777777778, 1.0); (0.8888888889, 1.0); (1.0, 1.0)]]

Math.NET Numerics

1: 
2: 
3: 
4: 
//We can not use the type Matrix<(float, float)> type as a output.
let element = DenseVector.rangef 0.0 (1.0/9.0) 1.0
let Z = Array2D.init 10 10 (fun i j -> (element.[j], element.[i]))
printfn "%A" Z
[[(0.0, 0.0); (0.1111111111, 0.0); (0.2222222222, 0.0); (0.3333333333, 0.0);
  (0.4444444444, 0.0); (0.5555555556, 0.0); (0.6666666667, 0.0);
  (0.7777777778, 0.0); (0.8888888889, 0.0); (1.0, 0.0)]
 [(0.0, 0.1111111111); (0.1111111111, 0.1111111111);
  (0.2222222222, 0.1111111111); (0.3333333333, 0.1111111111);
  (0.4444444444, 0.1111111111); (0.5555555556, 0.1111111111);
  (0.6666666667, 0.1111111111); (0.7777777778, 0.1111111111);
  (0.8888888889, 0.1111111111); (1.0, 0.1111111111)]
 [(0.0, 0.2222222222); (0.1111111111, 0.2222222222);
  (0.2222222222, 0.2222222222); (0.3333333333, 0.2222222222);
  (0.4444444444, 0.2222222222); (0.5555555556, 0.2222222222);
  (0.6666666667, 0.2222222222); (0.7777777778, 0.2222222222);
  (0.8888888889, 0.2222222222); (1.0, 0.2222222222)]
 [(0.0, 0.3333333333); (0.1111111111, 0.3333333333);
  (0.2222222222, 0.3333333333); (0.3333333333, 0.3333333333);
  (0.4444444444, 0.3333333333); (0.5555555556, 0.3333333333);
  (0.6666666667, 0.3333333333); (0.7777777778, 0.3333333333);
  (0.8888888889, 0.3333333333); (1.0, 0.3333333333)]
 [(0.0, 0.4444444444); (0.1111111111, 0.4444444444);
  (0.2222222222, 0.4444444444); (0.3333333333, 0.4444444444);
  (0.4444444444, 0.4444444444); (0.5555555556, 0.4444444444);
  (0.6666666667, 0.4444444444); (0.7777777778, 0.4444444444);
  (0.8888888889, 0.4444444444); (1.0, 0.4444444444)]
 [(0.0, 0.5555555556); (0.1111111111, 0.5555555556);
  (0.2222222222, 0.5555555556); (0.3333333333, 0.5555555556);
  (0.4444444444, 0.5555555556); (0.5555555556, 0.5555555556);
  (0.6666666667, 0.5555555556); (0.7777777778, 0.5555555556);
  (0.8888888889, 0.5555555556); (1.0, 0.5555555556)]
 [(0.0, 0.6666666667); (0.1111111111, 0.6666666667);
  (0.2222222222, 0.6666666667); (0.3333333333, 0.6666666667);
  (0.4444444444, 0.6666666667); (0.5555555556, 0.6666666667);
  (0.6666666667, 0.6666666667); (0.7777777778, 0.6666666667);
  (0.8888888889, 0.6666666667); (1.0, 0.6666666667)]
 [(0.0, 0.7777777778); (0.1111111111, 0.7777777778);
  (0.2222222222, 0.7777777778); (0.3333333333, 0.7777777778);
  (0.4444444444, 0.7777777778); (0.5555555556, 0.7777777778);
  (0.6666666667, 0.7777777778); (0.7777777778, 0.7777777778);
  (0.8888888889, 0.7777777778); (1.0, 0.7777777778)]
 [(0.0, 0.8888888889); (0.1111111111, 0.8888888889);
  (0.2222222222, 0.8888888889); (0.3333333333, 0.8888888889);
  (0.4444444444, 0.8888888889); (0.5555555556, 0.8888888889);
  (0.6666666667, 0.8888888889); (0.7777777778, 0.8888888889);
  (0.8888888889, 0.8888888889); (1.0, 0.8888888889)]
 [(0.0, 1.0); (0.1111111111, 1.0); (0.2222222222, 1.0); (0.3333333333, 1.0);
  (0.4444444444, 1.0); (0.5555555556, 1.0); (0.6666666667, 1.0);
  (0.7777777778, 1.0); (0.8888888889, 1.0); (1.0, 1.0)]]

5. Print the minimum and maximum representable value for each numpy scalar type

These are not types but functions for type conversion like int8, float32 in the below codes. I used these functions to get its type with Reflection.

1: 
2: 
3: 
4: 
[int8.GetType(); int32.GetType(); int64.GetType()] |> 
    List.iter (fun x -> 
        printfn "%A" (x.BaseType.GenericTypeArguments.[1].GetField("MinValue").GetValue())
        printfn "%A" (x.BaseType.GenericTypeArguments.[1].GetField("MaxValue").GetValue()))        
-128y
127y
-2147483648
2147483647
-9223372036854775808L
9223372036854775807L
1: 
2: 
3: 
4: 
5: 
[float32.GetType(); float.GetType()] |> 
    List.iter (fun x -> 
        printfn "%A" (x.BaseType.GenericTypeArguments.[1].GetField("MinValue").GetValue())
        printfn "%A" (x.BaseType.GenericTypeArguments.[1].GetField("MaxValue").GetValue())        
        printfn "%A" (x.BaseType.GenericTypeArguments.[1].GetField("Epsilon").GetValue()))
-3.40282347e+38f
3.40282347e+38f
1.40129846e-45f
-1.797693135e+308
1.797693135e+308
4.940656458e-324

6. Create a structured array representing a position (x,y) and a color (r,g,b)

There is no way to assign name to Array2D/Matrix. We might should use Deedle in this situation. The code I showed below is not so looks good to me...

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
type NamedSequence<'T> = System.Collections.Generic.IDictionary<string, 'T>
let Z = Array.init 10 (fun i -> 
    dict[
        "position", dict["x", 0.0; "y", 0.0]; 
        "color", dict["r", 0.0; "g", 0.0; "b", 0.0]
    ]
)
printfn "%A" (Array.map (fun (z:NamedSequence<NamedSequence<float>>) -> z.["color"]) Z)
[|seq [[r, 0]; [g, 0]; [b, 0]]; seq [[r, 0]; [g, 0]; [b, 0]];
  seq [[r, 0]; [g, 0]; [b, 0]]; seq [[r, 0]; [g, 0]; [b, 0]];
  seq [[r, 0]; [g, 0]; [b, 0]]; seq [[r, 0]; [g, 0]; [b, 0]];
  seq [[r, 0]; [g, 0]; [b, 0]]; seq [[r, 0]; [g, 0]; [b, 0]];
  seq [[r, 0]; [g, 0]; [b, 0]]; seq [[r, 0]; [g, 0]; [b, 0]]|]

7. Consider a random vector with shape (100,2) representing coordinates, find point by point distances

We use 10 row cases to reduce the output.

F# Core Library

 1: 
 2: 
 3: 
 4: 
 5: 
 6: 
 7: 
 8: 
 9: 
10: 
11: 
12: 
let rand = System.Random()
let product xs ys = [| for x in xs do for y in ys  -> (x, y)|]
let distance (x: float*float) (y: float*float) = 
    let dx = fst x - snd x
    let dy = fst y - snd y
    sqrt(dx*dx+dy*dy)
let Z = Array2D.init 10 2 (fun _ _ -> rand.NextDouble())
let X, Y = Z.[*,0], Z.[*,1]
let xs = (product X X)
let ys = (product Y Y)
let D = Array.map2 distance xs ys 
printfn "%A"  (Array2D.init 10 10 (fun i j -> D.[i + j*10]))
[[0.0; 0.5018595449; 0.441438811; 0.5825669151; 0.5716026538; 0.1603965189;
  0.453201734; 0.4690261062; 0.504450041; 0.3824011123]
 [0.5018595449; 0.0; 0.2286847089; 0.4181345273; 0.6519918529; 0.4924190676;
  0.4954238683; 0.5729974405; 0.9977196053; 0.6847717332]
 [0.441438811; 0.2286847089; 0.0; 0.6104760286; 0.7892516547; 0.3607525997;
  0.6290595613; 0.6943565415; 0.9406291836; 0.7400756068]
 [0.5825669151; 0.4181345273; 0.6104760286; 0.0; 0.2978466351; 0.6812674093;
  0.203996086; 0.2744803349; 0.9441949939; 0.486554684]
 [0.5716026538; 0.6519918529; 0.7892516547; 0.2978466351; 0.0; 0.7170666037;
  0.1605689795; 0.1045403494; 0.7658878168; 0.2838072437]
 [0.1603965189; 0.4924190676; 0.3607525997; 0.6812674093; 0.7170666037; 0.0;
  0.5847377745; 0.6128259918; 0.5959212459; 0.5427311578]
 [0.453201734; 0.4954238683; 0.6290595613; 0.203996086; 0.1605689795;
  0.5847377745; 0.0; 0.08191627388; 0.7489397124; 0.2827102777]
 [0.4690261062; 0.5729974405; 0.6943565415; 0.2744803349; 0.1045403494;
  0.6128259918; 0.08191627388; 0.0; 0.7051931575; 0.2249972903]
 [0.504450041; 0.9977196053; 0.9406291836; 0.9441949939; 0.7658878168;
  0.5959212459; 0.7489397124; 0.7051931575; 0.0; 0.4836359103]
 [0.3824011123; 0.6847717332; 0.7400756068; 0.486554684; 0.2838072437;
  0.5427311578; 0.2827102777; 0.2249972903; 0.4836359103; 0.0]]

Math.NET Numerics

1: 
2: 
3: 
4: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseMatrix.random<float> 10 2 rand
let X, Y = Z.[*,0], Z.[*,1]
printfn "%A" (DenseMatrix.Create(10, 10, (fun i j -> sqrt((X.[i]-X.[j])**2.0 + (Y.[i]-Y.[j])**2.0))))
[[0.0; 0.5018595449; 0.441438811; 0.5825669151; 0.5716026538; 0.1603965189;
  0.453201734; 0.4690261062; 0.504450041; 0.3824011123]
 [0.5018595449; 0.0; 0.2286847089; 0.4181345273; 0.6519918529; 0.4924190676;
  0.4954238683; 0.5729974405; 0.9977196053; 0.6847717332]
 [0.441438811; 0.2286847089; 0.0; 0.6104760286; 0.7892516547; 0.3607525997;
  0.6290595613; 0.6943565415; 0.9406291836; 0.7400756068]
 [0.5825669151; 0.4181345273; 0.6104760286; 0.0; 0.2978466351; 0.6812674093;
  0.203996086; 0.2744803349; 0.9441949939; 0.486554684]
 [0.5716026538; 0.6519918529; 0.7892516547; 0.2978466351; 0.0; 0.7170666037;
  0.1605689795; 0.1045403494; 0.7658878168; 0.2838072437]
 [0.1603965189; 0.4924190676; 0.3607525997; 0.6812674093; 0.7170666037; 0.0;
  0.5847377745; 0.6128259918; 0.5959212459; 0.5427311578]
 [0.453201734; 0.4954238683; 0.6290595613; 0.203996086; 0.1605689795;
  0.5847377745; 0.0; 0.08191627388; 0.7489397124; 0.2827102777]
 [0.4690261062; 0.5729974405; 0.6943565415; 0.2744803349; 0.1045403494;
  0.6128259918; 0.08191627388; 0.0; 0.7051931575; 0.2249972903]
 [0.504450041; 0.9977196053; 0.9406291836; 0.9441949939; 0.7658878168;
  0.5959212459; 0.7489397124; 0.7051931575; 0.0; 0.4836359103]
 [0.3824011123; 0.6847717332; 0.7400756068; 0.486554684; 0.2838072437;
  0.5427311578; 0.2827102777; 0.2249972903; 0.4836359103; 0.0]]

8. Generate a generic 2D Gaussian-like array

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
let element = Array.init 10 (fun i -> -1.0 + 1.0/4.5*(float i)) 
let Z = Array2D.init 10 10 (fun i j -> (element.[j], element.[i])) |> Seq.cast<float*float> |> Array.ofSeq
let D = Array.map (fun z -> sqrt( (fst z)**2.0 + (snd z)**2.0 )) Z
let sigma, mu = 1.0, 0.0
let G = Array.map (fun d -> exp((d-mu)**2.0/(-2.0*sigma**2.0))) D
printfn "%A" G
[|0.3678794412; 0.4482208785; 0.5197948899; 0.5737534207; 0.6027981752;
  0.6027981752; 0.5737534207; 0.5197948899; 0.4482208785; 0.3678794412;
  0.4482208785; 0.546108136; 0.6333132437; 0.6990558142; 0.7344436719;
  0.7344436719; 0.6990558142; 0.6333132437; 0.546108136; 0.4482208785;
  0.5197948899; 0.6333132437; 0.7344436719; 0.8106843243; 0.8517230811;
  0.8517230811; 0.8106843243; 0.7344436719; 0.6333132437; 0.5197948899;
  0.5737534207; 0.6990558142; 0.8106843243; 0.8948393168; 0.9401381983;
  0.9401381983; 0.8948393168; 0.8106843243; 0.6990558142; 0.5737534207;
  0.6027981752; 0.7344436719; 0.8517230811; 0.9401381983; 0.9877302162;
  0.9877302162; 0.9401381983; 0.8517230811; 0.7344436719; 0.6027981752;
  0.6027981752; 0.7344436719; 0.8517230811; 0.9401381983; 0.9877302162;
  0.9877302162; 0.9401381983; 0.8517230811; 0.7344436719; 0.6027981752;
  0.5737534207; 0.6990558142; 0.8106843243; 0.8948393168; 0.9401381983;
  0.9401381983; 0.8948393168; 0.8106843243; 0.6990558142; 0.5737534207;
  0.5197948899; 0.6333132437; 0.7344436719; 0.8106843243; 0.8517230811;
  0.8517230811; 0.8106843243; 0.7344436719; 0.6333132437; 0.5197948899;
  0.4482208785; 0.546108136; 0.6333132437; 0.6990558142; 0.7344436719;
  0.7344436719; 0.6990558142; 0.6333132437; 0.546108136; 0.4482208785;
  0.3678794412; 0.4482208785; 0.5197948899; 0.5737534207; 0.6027981752;
  0.6027981752; 0.5737534207; 0.5197948899; 0.4482208785; 0.3678794412|]

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
let element = Array.init 10 (fun i -> -1.0 + 1.0/4.5*(float i)) 
let Z = Array2D.init 10 10 (fun i j -> (element.[j], element.[i])) |> Seq.cast<float*float> |> Array.ofSeq
let D = DenseVector.init 100 (fun i -> sqrt( (fst Z.[i])**2.0 + (snd Z.[i])**2.0 ))
let sigma, mu = 1.0, 0.0
let G = D.Subtract(mu).PointwisePower(2.0).Divide(-2.0*sigma**2.0).PointwiseExp()
//... Or more simply
//let G = Vector.map (fun d -> exp((d-mu)**2.0/(-2.0*sigma**2.0))) D 
printfn "%A" G
seq [0.3678794412; 0.4482208785; 0.5197948899; 0.5737534207; ...]

9. How to tell if a given 2D array has null columns ?

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
7: 
8: 
//First, We extend Array2D module to add foldByColumn
module Array2D =
    let foldByColumn folder state array = 
        let size = Array2D.length2 array - 1
        [|for col in [0..size] -> array.[*, col] |> Array.fold folder state|]
//Sample data
let Z = array2D [|[|1.0; nan; nan; nan; 2.0;|]; [|1.0; 2.0; 3.0; 4.0; 5.0|]|]
printfn "%A" (Z |> Array2D.foldByColumn (fun x y -> x || System.Double.IsNaN(y)) false)
[|false; true; true; true; false|]

Math.NET Numerics

1: 
2: 
3: 
4: 
5: 
6: 
let Z = matrix [[1.0; nan; nan; nan; 2.0;]; [1.0; 2.0; 3.0; 4.0; 5.0]]
printfn "%A" (Z |> 
    Matrix.foldByCol(fun x y -> x + System.Convert.ToDouble(System.Double.IsNaN(y))) 0.0 |>
    Seq.cast<float> |> 
    Seq.toArray |> 
    Array.map (fun x -> System.Convert.ToBoolean(x)))
[|false; true; true; true; false|]

10. Find the nearest value from a given value in an array

F# Core Library

1: 
2: 
3: 
4: 
let rand = System.Random()
let Z = Array.init<float> 10(fun _ -> rand.NextDouble())
let z = 0.5
Seq.minBy (fun x -> abs (x-z)) Z |> printfn "%A" 
0.5076313729

Math.NET Numerics

1: 
2: 
3: 
let rand = new MathNet.Numerics.Distributions.ContinuousUniform()
let Z = DenseVector.random<float> 10 rand
Z.[Vector.minAbsIndex(Z - z)] |> printfn "%A"
0.3297233672

Journeyman

1. Consider the following file:

1: 
2: 
3: 
1,2,3,4,5
6,,,7,8
,,9,10,11

How to read it ?

I used build-in functions(System.IO etc) and Math.Net Numerics Data Text here. It is a good idea to use F# Data: CSV Type Provider instead of these strategies.

F# Core Library

1: 
2: 
3: 
let Z = System.IO.File.ReadAllLines "missing.dat" |> 
    Array.map (fun z -> z.Split ',') 
printfn "%A" Z
[|[|"1"; "2"; "3"; "4"; "5"|]; [|"6"; ""; ""; "7"; "8"|];
  [|""; ""; "9"; "10"; "11"|]|]

Math.NET Numerics

1: 
2: 
let Z = DelimitedReader.Read<double>( "missing.dat", false, ",", false);
printfn "%A" Z
DenseMatrix 3x5-Double
        1          2          3   4   5
        6  NaN (非数値)  NaN (非数値)   7   8
NaN (非数値)  NaN (非数値)          9  10  11

2. Consider a generator function that generates 10 integers and use it to build an array

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
7: 
let generate() = seq { 0..10 }
//or 
//let generate() = seq { for i in 0..9 do yield i}
//or
//let generate() = seq { for i in 0..9 -> i}
let Z = generate() |> Array.ofSeq
printfn "%A" Z
[|0; 1; 2; 3; 4; 5; 6; 7; 8; 9; 10|]

Math.NET Numerics

1: 
2: 
3: 
let generate() = seq { for i in 0..9 -> float i}
let Z = generate() |> DenseVector.ofSeq
printfn "%A" Z
seq [0.0; 1.0; 2.0; 3.0; ...]

3. Consider a given vector, how to add 1 to each element indexed by a second vector (be careful with repeated indices) ?

F# Core Library

(Not so good code...)

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let Z = Array.create 10 1
let I = Array.init 20 (fun _ -> rand.Next(Array.length Z))
I |> Seq.countBy id |> Seq.iter (fun i -> Z.[fst i] <- Z.[fst i] + snd i)
printfn "%A" Z
[|3; 2; 3; 4; 2; 3; 2; 5; 4; 2|]

Math.NET Numerics

It is difficult to write with Math.NET for me...

4. How to accumulate elements of a vector (X) to an array (F) based on an index list (I) ?

F# Core Library

1: 
2: 
3: 
4: 
5: 
let X = [|1; 2; 3; 4; 5; 6|]
let I = [|1; 3; 9; 3; 4; 1|]
let F = Array.zeroCreate<int> (Array.max I + 1)
Array.zip I X |> Array.iter (fun x -> F.[fst x] <- F.[fst x] + snd x)
printfn "%A" F
[|0; 7; 0; 6; 5; 0; 0; 0; 0; 3|]

Math.NET Numerics

It is difficult to write with Math.NET for me...

5. Considering a (w,h,3) image of (dtype=ubyte), compute the number of unique colors

F# Core Library

1: 
2: 
3: 
4: 
5: 
6: 
let rand = System.Random()
let w, h = 16, 16
let I = Array.init 3 (fun _ -> Array2D.init w h (fun _ _ -> rand.Next(2)))
let F = I |> Array.mapi (fun i x -> Array2D.map ((*) (int (256.0**(float i)))) x)
let n = (F |> Array.map  (fun x -> x |> Seq.cast<int> |> Seq.distinct |> Set.ofSeq) |> Array.reduce Set.union) |> Set.count
printfn "%A" (I |> Array.map  (fun x -> x |> Seq.cast<int> |> Seq.distinct |> Set.ofSeq) |> Array.reduce Set.intersect)
set [0; 1]

Math.NET Numerics

6. Considering a four dimensions array, how to get sum over the last two axis at once ?

F# Core Library

1: 
2: 
3: 
4: 
let rand = System.Random()
let A = Array.init 3 (fun _ -> Array.init 4 (fun _ -> Array2D.init 3 4 (fun _ _ -> rand.Next(10))))
let sum = A |> Array.map (fun a -> Array.map (Seq.cast<int> >> Seq.sum) a)
printfn "%A" sum
[|[|37; 60; 46; 40|]; [|74; 52; 43; 60|]; [|37; 54; 71; 58|]|]

Math.NET Numerics

7. Considering a one-dimensional vector D, how to compute means of subsets of D using a vector S of same size describing subset indices ?

F# Core Library

1: 
2: 
3: 
4: 
5: 
let rand = System.Random()
let D = Array.init 100 (fun _ -> rand.NextDouble())
let S = Array.init 100 (fun _ -> rand.Next(10))
let D_means = Seq.zip S D |> Seq.groupBy (fun pair -> fst pair) |> Seq.map (fun (key, value) -> Seq.averageBy snd value )
printfn "%A" D_means
seq [0.6309287825; 0.5461800725; 0.7479628748; 0.5069600422; ...]

... To be continued.

namespace System
type Environment =
  static member CommandLine : string
  static member CurrentDirectory : string with get, set
  static member Exit : exitCode:int -> unit
  static member ExitCode : int with get, set
  static member ExpandEnvironmentVariables : name:string -> string
  static member FailFast : message:string -> unit + 1 overload
  static member GetCommandLineArgs : unit -> string[]
  static member GetEnvironmentVariable : variable:string -> string + 1 overload
  static member GetEnvironmentVariables : unit -> IDictionary + 1 overload
  static member GetFolderPath : folder:SpecialFolder -> string + 1 overload
  ...
  nested type SpecialFolder
  nested type SpecialFolderOption

Full name: System.Environment
property System.Environment.CurrentDirectory: string
namespace MathNet
namespace MathNet.Numerics
namespace MathNet.Numerics.LinearAlgebra
namespace MathNet.Numerics.LinearAlgebra.Double
namespace MathNet.Numerics.Statistics
namespace MathNet.Numerics.Data
namespace MathNet.Numerics.Data.Text
val printfn : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printfn
namespace System.Reflection
type Assembly =
  member CodeBase : string
  member CreateInstance : typeName:string -> obj + 2 overloads
  member EntryPoint : MethodInfo
  member Equals : o:obj -> bool
  member EscapedCodeBase : string
  member Evidence : Evidence
  member FullName : string
  member GetCustomAttributes : inherit:bool -> obj[] + 1 overload
  member GetCustomAttributesData : unit -> IList<CustomAttributeData>
  member GetExportedTypes : unit -> Type[]
  ...

Full name: System.Reflection.Assembly
System.Reflection.Assembly.GetExecutingAssembly() : System.Reflection.Assembly
val Z : float []

Full name: Fsharp-100-exercises.Z
module Array

from Microsoft.FSharp.Collections
val zeroCreate : count:int -> 'T []

Full name: Microsoft.FSharp.Collections.Array.zeroCreate
Multiple items
val float : value:'T -> float (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.float

--------------------
type float = System.Double

Full name: Microsoft.FSharp.Core.float

--------------------
type float<'Measure> = float

Full name: Microsoft.FSharp.Core.float<_>
val Z : Vector<float>

Full name: Fsharp-100-exercises.Z
Multiple items
type DenseVector =
  inherit Vector
  new : storage:DenseVectorStorage<float> -> DenseVector + 2 overloads
  member AbsoluteMaximum : unit -> float
  member AbsoluteMaximumIndex : unit -> int
  member AbsoluteMinimum : unit -> float
  member AbsoluteMinimumIndex : unit -> int
  member InfinityNorm : unit -> float
  member L1Norm : unit -> float
  member L2Norm : unit -> float
  member MaximumIndex : unit -> int
  member MinimumIndex : unit -> int
  ...

Full name: MathNet.Numerics.LinearAlgebra.Double.DenseVector

--------------------
DenseVector(storage: Storage.DenseVectorStorage<float>) : unit
DenseVector(length: int) : unit
DenseVector(storage: float []) : unit
val zero : n:int -> Vector<'T> (requires value type and 'T :> System.ValueType and default constructor and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.zero
Vector.ToArray() : float []
val Z : int []

Full name: Fsharp-100-exercises.Z
val init : count:int -> initializer:(int -> 'T) -> 'T []

Full name: Microsoft.FSharp.Collections.Array.init
val index : int
val range : start:int -> step:int -> stop:int -> Vector<float>

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.range
val Z : int [,]

Full name: Fsharp-100-exercises.Z
module Array2D

from Microsoft.FSharp.Collections
val init : length1:int -> length2:int -> initializer:(int -> int -> 'T) -> 'T [,]

Full name: Microsoft.FSharp.Collections.Array2D.init
val i : int
val j : int
val Z : Matrix<float>

Full name: Fsharp-100-exercises.Z
Multiple items
type DenseMatrix =
  inherit Matrix
  new : storage:DenseColumnMajorMatrixStorage<float> -> DenseMatrix + 3 overloads
  member Cholesky : unit -> Cholesky<float>
  member Evd : ?symmetricity:Symmetricity -> Evd<float>
  member FrobeniusNorm : unit -> float
  member GramSchmidt : unit -> GramSchmidt<float>
  member InfinityNorm : unit -> float
  member IsSymmetric : unit -> bool
  member L1Norm : unit -> float
  member LU : unit -> LU<float>
  member QR : ?method:QRMethod -> QR<float>
  ...

Full name: MathNet.Numerics.LinearAlgebra.Double.DenseMatrix

--------------------
DenseMatrix(storage: Storage.DenseColumnMajorMatrixStorage<float>) : unit
DenseMatrix(order: int) : unit
DenseMatrix(rows: int, columns: int) : unit
DenseMatrix(rows: int, columns: int, storage: float []) : unit
val init : rows:int -> cols:int -> f:(int -> int -> 'T) -> Matrix<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseMatrix.init
Matrix.ToArray() : float [,]
val mapi : mapping:(int -> 'T -> 'U) -> array:'T [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.mapi
val x : int
val filter : predicate:('T -> bool) -> array:'T [] -> 'T []

Full name: Microsoft.FSharp.Collections.Array.filter
val fst : tuple:('T1 * 'T2) -> 'T1

Full name: Microsoft.FSharp.Core.Operators.fst
val map : mapping:('T -> 'U) -> array:'T [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.map
val snd : tuple:('T1 * 'T2) -> 'T2

Full name: Microsoft.FSharp.Core.Operators.snd
val choose : chooser:('T -> 'U option) -> array:'T [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.choose
val x : bool * int
union case Option.Some: Value: 'T -> Option<'T>
union case Option.None: Option<'T>
val vector : lst:'T list -> Vector<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.VectorExtensions.vector
Multiple items
type Vector =
  inherit Vector<float>
  member AbsoluteMaximum : unit -> float
  member AbsoluteMaximumIndex : unit -> int
  member AbsoluteMinimum : unit -> float
  member AbsoluteMinimumIndex : unit -> int
  member CoerceZero : threshold:float -> unit
  member InfinityNorm : unit -> float
  member L1Norm : unit -> float
  member L2Norm : unit -> float
  member MaximumIndex : unit -> int
  member MinimumIndex : unit -> int
  ...

Full name: MathNet.Numerics.LinearAlgebra.Double.Vector

--------------------
type Vector<'T (requires default constructor and value type and 'T :> ValueType and 'T :> IEquatable<'T> and 'T :> IFormattable)> =
  member AbsoluteMaximum : unit -> 'T
  member AbsoluteMaximumIndex : unit -> int
  member AbsoluteMinimum : unit -> 'T
  member AbsoluteMinimumIndex : unit -> int
  member Add : scalar:'T -> Vector<'T> + 3 overloads
  member At : index:int -> 'T + 1 overload
  member Clear : unit -> unit
  member ClearSubVector : index:int * count:int -> unit
  member Clone : unit -> Vector<'T>
  member CoerceZero : threshold:float -> unit + 1 overload
  ...

Full name: MathNet.Numerics.LinearAlgebra.Vector<_>
val foldi : f:(int -> 'a -> 'b -> 'a) -> state:'a -> v:#Vector<'b> -> 'a (requires default constructor and value type and 'b :> System.ValueType and 'b :> System.IEquatable<'b> and 'b :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Vector.foldi
val x : float []
val y : float
val append : array1:'T [] -> array2:'T [] -> 'T []

Full name: Microsoft.FSharp.Collections.Array.append
val identity : order:int -> Matrix<'T> (requires value type and 'T :> System.ValueType and default constructor and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseMatrix.identity
val rand : System.Random

Full name: Fsharp-100-exercises.rand
Multiple items
type Random =
  new : unit -> Random + 1 overload
  member Next : unit -> int + 2 overloads
  member NextBytes : buffer:byte[] -> unit
  member NextDouble : unit -> float

Full name: System.Random

--------------------
System.Random() : unit
System.Random(Seed: int) : unit
val Z : float [,,]

Full name: Fsharp-100-exercises.Z
module Array3D

from Microsoft.FSharp.Collections
val init : length1:int -> length2:int -> length3:int -> initializer:(int -> int -> int -> 'T) -> 'T [,,]

Full name: Microsoft.FSharp.Collections.Array3D.init
System.Random.NextDouble() : float
val z : int
val y : int
val printf : format:Printf.TextWriterFormat<'T> -> 'T

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.printf
val Z : float [,] []

Full name: Fsharp-100-exercises.Z
val rand : MathNet.Numerics.Distributions.ContinuousUniform

Full name: Fsharp-100-exercises.rand
namespace MathNet.Numerics.Distributions
Multiple items
type ContinuousUniform =
  new : unit -> ContinuousUniform + 2 overloads
  member CumulativeDistribution : x:float -> float
  member Density : x:float -> float
  member DensityLn : x:float -> float
  member Entropy : float
  member InverseCumulativeDistribution : p:float -> float
  member LowerBound : float
  member Maximum : float
  member Mean : float
  member Median : float
  ...

Full name: MathNet.Numerics.Distributions.ContinuousUniform

--------------------
MathNet.Numerics.Distributions.ContinuousUniform() : unit
MathNet.Numerics.Distributions.ContinuousUniform(lower: float, upper: float) : unit
MathNet.Numerics.Distributions.ContinuousUniform(lower: float, upper: float, randomSource: System.Random) : unit
val Z : Matrix<float> []

Full name: Fsharp-100-exercises.Z
val random : rows:int -> cols:int -> dist:MathNet.Numerics.Distributions.IContinuousDistribution -> Matrix<'T> (requires value type and 'T :> System.ValueType and default constructor and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseMatrix.random
val Z : float [,]

Full name: Fsharp-100-exercises.Z
val Zmin : float

Full name: Fsharp-100-exercises.Zmin
module Seq

from Microsoft.FSharp.Collections
val cast : source:System.Collections.IEnumerable -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.cast
val min : source:seq<'T> -> 'T (requires comparison)

Full name: Microsoft.FSharp.Collections.Seq.min
val Zmax : float

Full name: Fsharp-100-exercises.Zmax
val max : source:seq<'T> -> 'T (requires comparison)

Full name: Microsoft.FSharp.Collections.Seq.max
Multiple items
type Matrix =
  inherit Matrix<float>
  member Cholesky : unit -> Cholesky<float>
  member CoerceZero : threshold:float -> unit
  member ColumnAbsoluteSums : unit -> Vector<float>
  member ColumnNorms : norm:float -> Vector<float>
  member ColumnSums : unit -> Vector<float>
  member ConjugateTranspose : unit -> Matrix<float>
  member Evd : ?symmetricity:Symmetricity -> Evd<float>
  member FrobeniusNorm : unit -> float
  member GramSchmidt : unit -> GramSchmidt<float>
  member InfinityNorm : unit -> float
  ...

Full name: MathNet.Numerics.LinearAlgebra.Double.Matrix

--------------------
type Matrix<'T (requires default constructor and value type and 'T :> ValueType and 'T :> IEquatable<'T> and 'T :> IFormattable)> =
  member Add : scalar:'T -> Matrix<'T> + 3 overloads
  member Append : right:Matrix<'T> -> Matrix<'T> + 1 overload
  member At : row:int * column:int -> 'T + 1 overload
  member Cholesky : unit -> Cholesky<'T>
  member Clear : unit -> unit
  member ClearColumn : columnIndex:int -> unit
  member ClearColumns : params columnIndices:int[] -> unit
  member ClearRow : rowIndex:int -> unit
  member ClearRows : params rowIndices:int[] -> unit
  member ClearSubMatrix : rowIndex:int * rowCount:int * columnIndex:int * columnCount:int -> unit
  ...

Full name: MathNet.Numerics.LinearAlgebra.Matrix<_>
val reduce : f:('a -> 'a -> 'a) -> m:#Matrix<'a> -> 'a (requires default constructor and value type and 'a :> System.ValueType and 'a :> System.IEquatable<'a> and 'a :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Matrix.reduce
val min : e1:'T -> e2:'T -> 'T (requires comparison)

Full name: Microsoft.FSharp.Core.Operators.min
val max : e1:'T -> e2:'T -> 'T (requires comparison)

Full name: Microsoft.FSharp.Core.Operators.max
val array2D : rows:seq<#seq<'T>> -> 'T [,]

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.array2D
val seq01 : seq<float>

Full name: Fsharp-100-exercises.seq01
val initInfinite : initializer:(int -> 'T) -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.initInfinite
val initColumns : cols:int -> f:(int -> Vector<'T>) -> Matrix<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseMatrix.initColumns
val skip : count:int -> source:seq<'T> -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.skip
val take : count:int -> source:seq<'T> -> seq<'T>

Full name: Microsoft.FSharp.Collections.Seq.take
val ofSeq : fs:#seq<'T> -> Vector<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.ofSeq
val Z2 : float [,]

Full name: Fsharp-100-exercises.Z2
val map : mapping:('T -> 'U) -> array:'T [,] -> 'U [,]

Full name: Microsoft.FSharp.Collections.Array2D.map
val z : float
val Z2 : Matrix<float>

Full name: Fsharp-100-exercises.Z2
val map : f:('a -> 'b) -> A:#Matrix<'a> -> Matrix<'b> (requires default constructor and value type and 'a :> System.ValueType and 'a :> System.IEquatable<'a> and 'a :> System.IFormattable and default constructor and value type and 'b :> System.ValueType and 'b :> System.IEquatable<'b> and 'b :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Matrix.map
val x : float [,]

Full name: Fsharp-100-exercises.x
val create : length1:int -> length2:int -> value:'T -> 'T [,]

Full name: Microsoft.FSharp.Collections.Array2D.create
val y : float [,]

Full name: Fsharp-100-exercises.y
val inner_product : x:float [] -> y:float [] -> float

Full name: Fsharp-100-exercises.inner_product
val y : float []
val fold2 : folder:('State -> 'T1 -> 'T2 -> 'State) -> state:'State -> array1:'T1 [] -> array2:'T2 [] -> 'State

Full name: Microsoft.FSharp.Collections.Array.fold2
val s : float
val x : float
val create : rows:int -> cols:int -> x:'T -> Matrix<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseMatrix.create
val Z2 : float []

Full name: Fsharp-100-exercises.Z2
val sub : array:'T [] -> startIndex:int -> count:int -> 'T []

Full name: Microsoft.FSharp.Collections.Array.sub
val rangef : start:float -> step:float -> stop:float -> Vector<float>

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.rangef
val sort : array:'T [] -> 'T [] (requires comparison)

Full name: Microsoft.FSharp.Collections.Array.sort
val random : n:int -> dist:MathNet.Numerics.Distributions.IContinuousDistribution -> Vector<'T> (requires value type and 'T :> System.ValueType and default constructor and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.random
type Sorting =
  static member Sort<'T> : keys:IList<'T> * ?comparer:IComparer<'T> -> unit + 5 overloads
  static member SortAll<'T1, 'T2> : primary:IList<'T1> * secondary:IList<'T2> * ?primaryComparer:IComparer<'T1> * ?secondaryComparer:IComparer<'T2> -> unit

Full name: MathNet.Numerics.Sorting
MathNet.Numerics.Sorting.Sort<'T>(keys: System.Collections.Generic.IList<'T>, ?comparer: System.Collections.Generic.IComparer<'T>) : unit
MathNet.Numerics.Sorting.Sort<'TKey,'TItem>(keys: System.Collections.Generic.IList<'TKey>, items: System.Collections.Generic.IList<'TItem>, ?comparer: System.Collections.Generic.IComparer<'TKey>) : unit
MathNet.Numerics.Sorting.Sort<'T>(keys: System.Collections.Generic.IList<'T>, index: int, count: int, ?comparer: System.Collections.Generic.IComparer<'T>) : unit
MathNet.Numerics.Sorting.Sort<'TKey,'TItem1,'TItem2>(keys: System.Collections.Generic.IList<'TKey>, items1: System.Collections.Generic.IList<'TItem1>, items2: System.Collections.Generic.IList<'TItem2>, ?comparer: System.Collections.Generic.IComparer<'TKey>) : unit
MathNet.Numerics.Sorting.Sort<'TKey,'TItem>(keys: System.Collections.Generic.IList<'TKey>, items: System.Collections.Generic.IList<'TItem>, index: int, count: int, ?comparer: System.Collections.Generic.IComparer<'TKey>) : unit
MathNet.Numerics.Sorting.Sort<'TKey,'TItem1,'TItem2>(keys: System.Collections.Generic.IList<'TKey>, items1: System.Collections.Generic.IList<'TItem1>, items2: System.Collections.Generic.IList<'TItem2>, index: int, count: int, ?comparer: System.Collections.Generic.IComparer<'TKey>) : unit
val A : int []

Full name: Fsharp-100-exercises.A
System.Random.Next() : int
System.Random.Next(maxValue: int) : int
System.Random.Next(minValue: int, maxValue: int) : int
val B : int []

Full name: Fsharp-100-exercises.B
val equal : bool

Full name: Fsharp-100-exercises.equal
val forall2 : predicate:('T1 -> 'T2 -> bool) -> array1:'T1 [] -> array2:'T2 [] -> bool

Full name: Microsoft.FSharp.Collections.Array.forall2
val rand : MathNet.Numerics.Distributions.DiscreteUniform

Full name: Fsharp-100-exercises.rand
Multiple items
type DiscreteUniform =
  new : lower:int * upper:int -> DiscreteUniform + 1 overload
  member CumulativeDistribution : x:float -> float
  member Entropy : float
  member LowerBound : int
  member Maximum : int
  member Mean : float
  member Median : float
  member Minimum : int
  member Mode : int
  member Probability : k:int -> float
  ...

Full name: MathNet.Numerics.Distributions.DiscreteUniform

--------------------
MathNet.Numerics.Distributions.DiscreteUniform(lower: int, upper: int) : unit
MathNet.Numerics.Distributions.DiscreteUniform(lower: int, upper: int, randomSource: System.Random) : unit
val A : Vector<float>

Full name: Fsharp-100-exercises.A
MathNet.Numerics.Distributions.DiscreteUniform.Samples() : System.Collections.Generic.IEnumerable<int>
MathNet.Numerics.Distributions.DiscreteUniform.Samples(values: int []) : unit
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>

Full name: Microsoft.FSharp.Collections.Seq.map
val B : Vector<float>

Full name: Fsharp-100-exercises.B
val m : float

Full name: Fsharp-100-exercises.m
val average : array:'T [] -> 'T (requires member ( + ) and member DivideByInt and member get_Zero)

Full name: Microsoft.FSharp.Collections.Array.average
type Statistics =
  static member Covariance : samples1:IEnumerable<float> * samples2:IEnumerable<float> -> float + 1 overload
  static member EmpiricalCDF : data:IEnumerable<float> * x:float -> float + 1 overload
  static member EmpiricalCDFFunc : data:IEnumerable<float> -> Func<float, float> + 1 overload
  static member EmpiricalInvCDF : data:IEnumerable<float> * tau:float -> float + 1 overload
  static member EmpiricalInvCDFFunc : data:IEnumerable<float> -> Func<float, float> + 1 overload
  static member Entropy : data:IEnumerable<float> -> float + 1 overload
  static member FiveNumberSummary : data:IEnumerable<float> -> float[] + 1 overload
  static member InterquartileRange : data:IEnumerable<float> -> float + 1 overload
  static member Kurtosis : samples:IEnumerable<float> -> float + 1 overload
  static member LowerQuartile : data:IEnumerable<float> -> float + 1 overload
  ...

Full name: MathNet.Numerics.Statistics.Statistics
Statistics.Mean(data: System.Collections.Generic.IEnumerable<System.Nullable<float>>) : float
Statistics.Mean(data: System.Collections.Generic.IEnumerable<float>) : float
val Z : int list

Full name: Fsharp-100-exercises.Z
Multiple items
module List

from Microsoft.FSharp.Collections

--------------------
type List<'T> =
  | ( [] )
  | ( :: ) of Head: 'T * Tail: 'T list
  interface IEnumerable
  interface IEnumerable<'T>
  member Head : 'T
  member IsEmpty : bool
  member Item : index:int -> 'T with get
  member Length : int
  member Tail : 'T list
  static member Cons : head:'T * tail:'T list -> 'T list
  static member Empty : 'T list

Full name: Microsoft.FSharp.Collections.List<_>
val init : length:int -> initializer:(int -> 'T) -> 'T list

Full name: Microsoft.FSharp.Collections.List.init
val X : float []

Full name: Fsharp-100-exercises.X
val Y : float []

Full name: Fsharp-100-exercises.Y
val R : float []

Full name: Fsharp-100-exercises.R
val map2 : mapping:('T1 -> 'T2 -> 'U) -> array1:'T1 [] -> array2:'T2 [] -> 'U []

Full name: Microsoft.FSharp.Collections.Array.map2
val sqrt : value:'T -> 'U (requires member Sqrt)

Full name: Microsoft.FSharp.Core.Operators.sqrt
val T : float []

Full name: Fsharp-100-exercises.T
type Math =
  static val PI : float
  static val E : float
  static member Abs : value:sbyte -> sbyte + 6 overloads
  static member Acos : d:float -> float
  static member Asin : d:float -> float
  static member Atan : d:float -> float
  static member Atan2 : y:float * x:float -> float
  static member BigMul : a:int * b:int -> int64
  static member Ceiling : d:decimal -> decimal + 1 overload
  static member Cos : d:float -> float
  ...

Full name: System.Math
System.Math.Atan2(y: float, x: float) : float
val X : Vector<float>

Full name: Fsharp-100-exercises.X
val Y : Vector<float>

Full name: Fsharp-100-exercises.Y
val R : Vector<float>

Full name: Fsharp-100-exercises.R
val map : f:('a -> 'b) -> v:#Vector<'a> -> Vector<'b> (requires default constructor and value type and 'a :> System.ValueType and 'a :> System.IEquatable<'a> and 'a :> System.IFormattable and default constructor and value type and 'b :> System.ValueType and 'b :> System.IEquatable<'b> and 'b :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Vector.map
val T : Vector<float>

Full name: Fsharp-100-exercises.T
System.Math.Atan(d: float) : float
val max : array:'T [] -> 'T (requires comparison)

Full name: Microsoft.FSharp.Collections.Array.max
val findIndex : predicate:('T -> bool) -> array:'T [] -> int

Full name: Microsoft.FSharp.Collections.Array.findIndex
val maxIndex : A:#Vector<'b> -> int (requires default constructor and value type and 'b :> System.ValueType and 'b :> System.IEquatable<'b> and 'b :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Vector.maxIndex
val element : float []

Full name: Fsharp-100-exercises.element
val Z : (float * float) [,]

Full name: Fsharp-100-exercises.Z
val element : Vector<float>

Full name: Fsharp-100-exercises.element
Multiple items
val int8 : value:'T -> sbyte (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.int8

--------------------
type int8 = System.SByte

Full name: Microsoft.FSharp.Core.int8
Multiple items
val int32 : value:'T -> int32 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int32

--------------------
type int32 = System.Int32

Full name: Microsoft.FSharp.Core.int32
Multiple items
val int64 : value:'T -> int64 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int64

--------------------
type int64 = System.Int64

Full name: Microsoft.FSharp.Core.int64

--------------------
type int64<'Measure> = int64

Full name: Microsoft.FSharp.Core.int64<_>
val iter : action:('T -> unit) -> list:'T list -> unit

Full name: Microsoft.FSharp.Collections.List.iter
val x : System.Type
property System.Type.BaseType: System.Type
Multiple items
val float32 : value:'T -> float32 (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.float32

--------------------
type float32 = System.Single

Full name: Microsoft.FSharp.Core.float32

--------------------
type float32<'Measure> = float32

Full name: Microsoft.FSharp.Core.float32<_>
type NamedSequence<'T> = System.Collections.Generic.IDictionary<string,'T>

Full name: Fsharp-100-exercises.NamedSequence<_>
namespace System.Collections
namespace System.Collections.Generic
type IDictionary<'TKey,'TValue> =
  member Add : key:'TKey * value:'TValue -> unit
  member ContainsKey : key:'TKey -> bool
  member Item : 'TKey -> 'TValue with get, set
  member Keys : ICollection<'TKey>
  member Remove : key:'TKey -> bool
  member TryGetValue : key:'TKey * value:'TValue -> bool
  member Values : ICollection<'TValue>

Full name: System.Collections.Generic.IDictionary<_,_>
Multiple items
val string : value:'T -> string

Full name: Microsoft.FSharp.Core.Operators.string

--------------------
type string = System.String

Full name: Microsoft.FSharp.Core.string
val Z : System.Collections.Generic.IDictionary<string,System.Collections.Generic.IDictionary<string,float>> []

Full name: Fsharp-100-exercises.Z
val dict : keyValuePairs:seq<'Key * 'Value> -> System.Collections.Generic.IDictionary<'Key,'Value> (requires equality)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.dict
val z : NamedSequence<NamedSequence<float>>
val product : xs:seq<'a> -> ys:seq<'b> -> ('a * 'b) []

Full name: Fsharp-100-exercises.product
val xs : seq<'a>
val ys : seq<'b>
val x : 'a
val y : 'b
val distance : float * float -> float * float -> float

Full name: Fsharp-100-exercises.distance
val x : float * float
val y : float * float
val dx : float
val dy : float
val xs : (float * float) []

Full name: Fsharp-100-exercises.xs
val ys : (float * float) []

Full name: Fsharp-100-exercises.ys
val D : float []

Full name: Fsharp-100-exercises.D
DenseMatrix.Create(rows: int, columns: int, init: System.Func<int,int,float>) : DenseMatrix
DenseMatrix.Create(rows: int, columns: int, value: float) : DenseMatrix
val Z : (float * float) []

Full name: Fsharp-100-exercises.Z
val ofSeq : source:seq<'T> -> 'T []

Full name: Microsoft.FSharp.Collections.Array.ofSeq
val z : float * float
val sigma : float

Full name: Fsharp-100-exercises.sigma
val mu : float

Full name: Fsharp-100-exercises.mu
val G : float []

Full name: Fsharp-100-exercises.G
val d : float
val exp : value:'T -> 'T (requires member Exp)

Full name: Microsoft.FSharp.Core.Operators.exp
val D : Vector<float>

Full name: Fsharp-100-exercises.D
val init : n:int -> f:(int -> 'T) -> Vector<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.DenseVector.init
val G : Vector<float>

Full name: Fsharp-100-exercises.G
Vector.Subtract(other: Vector<float>) : Vector<float>
Vector.Subtract(scalar: float) : Vector<float>
Vector.Subtract(other: Vector<float>, result: Vector<float>) : unit
Vector.Subtract(scalar: float, result: Vector<float>) : unit
val foldByColumn : folder:('a -> 'b -> 'a) -> state:'a -> array:'b [,] -> 'a []

Full name: Fsharp-100-exercises.Array2D.foldByColumn
val folder : ('a -> 'b -> 'a)
val state : 'a
Multiple items
val array : 'b [,]

--------------------
type 'T array = 'T []

Full name: Microsoft.FSharp.Core.array<_>
val size : int
val length2 : array:'T [,] -> int

Full name: Microsoft.FSharp.Collections.Array2D.length2
val col : int
val fold : folder:('State -> 'T -> 'State) -> state:'State -> array:'T [] -> 'State

Full name: Microsoft.FSharp.Collections.Array.fold
val nan : float

Full name: Microsoft.FSharp.Core.Operators.nan
Multiple items
module Array2D

from Fsharp-100-exercises

--------------------
module Array2D

from Microsoft.FSharp.Collections
val x : bool
type Double =
  struct
    member CompareTo : value:obj -> int + 1 overload
    member Equals : obj:obj -> bool + 1 overload
    member GetHashCode : unit -> int
    member GetTypeCode : unit -> TypeCode
    member ToString : unit -> string + 3 overloads
    static val MinValue : float
    static val MaxValue : float
    static val Epsilon : float
    static val NegativeInfinity : float
    static val PositiveInfinity : float
    ...
  end

Full name: System.Double
System.Double.IsNaN(d: float) : bool
val matrix : lst:'T list list -> Matrix<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.MatrixExtensions.matrix
val foldByCol : f:('T -> 'T -> 'T) -> acc:'T -> A:#Matrix<'T> -> Vector<'T> (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Matrix.foldByCol
type Convert =
  static val DBNull : obj
  static member ChangeType : value:obj * typeCode:TypeCode -> obj + 3 overloads
  static member FromBase64CharArray : inArray:char[] * offset:int * length:int -> byte[]
  static member FromBase64String : s:string -> byte[]
  static member GetTypeCode : value:obj -> TypeCode
  static member IsDBNull : value:obj -> bool
  static member ToBase64CharArray : inArray:byte[] * offsetIn:int * length:int * outArray:char[] * offsetOut:int -> int + 1 overload
  static member ToBase64String : inArray:byte[] -> string + 3 overloads
  static member ToBoolean : value:obj -> bool + 17 overloads
  static member ToByte : value:obj -> byte + 18 overloads
  ...

Full name: System.Convert
System.Convert.ToDouble(value: System.DateTime) : float
   (+0 other overloads)
System.Convert.ToDouble(value: bool) : float
   (+0 other overloads)
System.Convert.ToDouble(value: string) : float
   (+0 other overloads)
System.Convert.ToDouble(value: decimal) : float
   (+0 other overloads)
System.Convert.ToDouble(value: float) : float
   (+0 other overloads)
System.Convert.ToDouble(value: float32) : float
   (+0 other overloads)
System.Convert.ToDouble(value: uint64) : float
   (+0 other overloads)
System.Convert.ToDouble(value: int64) : float
   (+0 other overloads)
System.Convert.ToDouble(value: uint32) : float
   (+0 other overloads)
System.Convert.ToDouble(value: int) : float
   (+0 other overloads)
val toArray : source:seq<'T> -> 'T []

Full name: Microsoft.FSharp.Collections.Seq.toArray
System.Convert.ToBoolean(value: System.DateTime) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: decimal) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: float) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: float32) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: string) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: uint64) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: int64) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: uint32) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: int) : bool
   (+0 other overloads)
System.Convert.ToBoolean(value: uint16) : bool
   (+0 other overloads)
val z : float

Full name: Fsharp-100-exercises.z
val minBy : projection:('T -> 'U) -> source:seq<'T> -> 'T (requires comparison)

Full name: Microsoft.FSharp.Collections.Seq.minBy
val abs : value:'T -> 'T (requires member Abs)

Full name: Microsoft.FSharp.Core.Operators.abs
val minAbsIndex : A:#Vector<'b> -> int (requires default constructor and value type and 'b :> System.ValueType and 'b :> System.IEquatable<'b> and 'b :> System.IFormattable)

Full name: MathNet.Numerics.LinearAlgebra.Vector.minAbsIndex
val Z : string [] []

Full name: Fsharp-100-exercises.Z
namespace System.IO
type File =
  static member AppendAllLines : path:string * contents:IEnumerable<string> -> unit + 1 overload
  static member AppendAllText : path:string * contents:string -> unit + 1 overload
  static member AppendText : path:string -> StreamWriter
  static member Copy : sourceFileName:string * destFileName:string -> unit + 1 overload
  static member Create : path:string -> FileStream + 3 overloads
  static member CreateText : path:string -> StreamWriter
  static member Decrypt : path:string -> unit
  static member Delete : path:string -> unit
  static member Encrypt : path:string -> unit
  static member Exists : path:string -> bool
  ...

Full name: System.IO.File
System.IO.File.ReadAllLines(path: string) : string []
System.IO.File.ReadAllLines(path: string, encoding: System.Text.Encoding) : string []
val z : string
System.String.Split(params separator: char []) : string []
System.String.Split(separator: string [], options: System.StringSplitOptions) : string []
System.String.Split(separator: char [], options: System.StringSplitOptions) : string []
System.String.Split(separator: char [], count: int) : string []
System.String.Split(separator: string [], count: int, options: System.StringSplitOptions) : string []
System.String.Split(separator: char [], count: int, options: System.StringSplitOptions) : string []
val Z : Matrix<double>

Full name: Fsharp-100-exercises.Z
type DelimitedReader =
  static member Read<'T> : reader:TextReader * ?sparse:bool * ?delimiter:string * ?hasHeaders:bool * ?formatProvider:IFormatProvider * ?missingValue:Nullable<'T> -> Matrix<'T> + 2 overloads

Full name: MathNet.Numerics.Data.Text.DelimitedReader
DelimitedReader.Read<'T (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)>(stream: System.IO.Stream, ?sparse: bool, ?delimiter: string, ?hasHeaders: bool, ?formatProvider: System.IFormatProvider, ?missingValue: System.Nullable<'T>) : Matrix<'T>
DelimitedReader.Read<'T (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)>(filePath: string, ?sparse: bool, ?delimiter: string, ?hasHeaders: bool, ?formatProvider: System.IFormatProvider, ?missingValue: System.Nullable<'T>) : Matrix<'T>
DelimitedReader.Read<'T (requires default constructor and value type and 'T :> System.ValueType and 'T :> System.IEquatable<'T> and 'T :> System.IFormattable)>(reader: System.IO.TextReader, ?sparse: bool, ?delimiter: string, ?hasHeaders: bool, ?formatProvider: System.IFormatProvider, ?missingValue: System.Nullable<'T>) : Matrix<'T>
Multiple items
val double : value:'T -> float (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.double

--------------------
type double = System.Double

Full name: Microsoft.FSharp.Core.double
val generate : unit -> seq<int>

Full name: Fsharp-100-exercises.generate
Multiple items
val seq : sequence:seq<'T> -> seq<'T>

Full name: Microsoft.FSharp.Core.Operators.seq

--------------------
type seq<'T> = System.Collections.Generic.IEnumerable<'T>

Full name: Microsoft.FSharp.Collections.seq<_>
val generate : unit -> seq<float>

Full name: Fsharp-100-exercises.generate
val create : count:int -> value:'T -> 'T []

Full name: Microsoft.FSharp.Collections.Array.create
val I : int []

Full name: Fsharp-100-exercises.I
val length : array:'T [] -> int

Full name: Microsoft.FSharp.Collections.Array.length
val countBy : projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * int> (requires equality)

Full name: Microsoft.FSharp.Collections.Seq.countBy
val id : x:'T -> 'T

Full name: Microsoft.FSharp.Core.Operators.id
val iter : action:('T -> unit) -> source:seq<'T> -> unit

Full name: Microsoft.FSharp.Collections.Seq.iter
val i : int * int
val X : int []

Full name: Fsharp-100-exercises.X
val F : int []

Full name: Fsharp-100-exercises.F
Multiple items
val int : value:'T -> int (requires member op_Explicit)

Full name: Microsoft.FSharp.Core.Operators.int

--------------------
type int = int32

Full name: Microsoft.FSharp.Core.int

--------------------
type int<'Measure> = int

Full name: Microsoft.FSharp.Core.int<_>
val zip : array1:'T1 [] -> array2:'T2 [] -> ('T1 * 'T2) []

Full name: Microsoft.FSharp.Collections.Array.zip
val iter : action:('T -> unit) -> array:'T [] -> unit

Full name: Microsoft.FSharp.Collections.Array.iter
val x : int * int
val w : int

Full name: Fsharp-100-exercises.w
val h : int

Full name: Fsharp-100-exercises.h
val I : int [,] []

Full name: Fsharp-100-exercises.I
val F : int [,] []

Full name: Fsharp-100-exercises.F
val x : int [,]
val n : int

Full name: Fsharp-100-exercises.n
val distinct : source:seq<'T> -> seq<'T> (requires equality)

Full name: Microsoft.FSharp.Collections.Seq.distinct
Multiple items
module Set

from Microsoft.FSharp.Collections

--------------------
type Set<'T (requires comparison)> =
  interface IComparable
  interface IEnumerable
  interface IEnumerable<'T>
  interface ICollection<'T>
  new : elements:seq<'T> -> Set<'T>
  member Add : value:'T -> Set<'T>
  member Contains : value:'T -> bool
  override Equals : obj -> bool
  member IsProperSubsetOf : otherSet:Set<'T> -> bool
  member IsProperSupersetOf : otherSet:Set<'T> -> bool
  ...

Full name: Microsoft.FSharp.Collections.Set<_>

--------------------
new : elements:seq<'T> -> Set<'T>
val ofSeq : elements:seq<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.ofSeq
val reduce : reduction:('T -> 'T -> 'T) -> array:'T [] -> 'T

Full name: Microsoft.FSharp.Collections.Array.reduce
val union : set1:Set<'T> -> set2:Set<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.union
val count : set:Set<'T> -> int (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.count
val intersect : set1:Set<'T> -> set2:Set<'T> -> Set<'T> (requires comparison)

Full name: Microsoft.FSharp.Collections.Set.intersect
val A : int [,] [] []

Full name: Fsharp-100-exercises.A
val sum : int [] []

Full name: Fsharp-100-exercises.sum
val a : int [,] []
val sum : source:seq<'T> -> 'T (requires member ( + ) and member get_Zero)

Full name: Microsoft.FSharp.Collections.Seq.sum
val S : int []

Full name: Fsharp-100-exercises.S
val D_means : seq<float>

Full name: Fsharp-100-exercises.D_means
val zip : source1:seq<'T1> -> source2:seq<'T2> -> seq<'T1 * 'T2>

Full name: Microsoft.FSharp.Collections.Seq.zip
val groupBy : projection:('T -> 'Key) -> source:seq<'T> -> seq<'Key * seq<'T>> (requires equality)

Full name: Microsoft.FSharp.Collections.Seq.groupBy
val pair : int * float
val key : int
val value : seq<int * float>
val averageBy : projection:('T -> 'U) -> source:seq<'T> -> 'U (requires member ( + ) and member DivideByInt and member get_Zero)

Full name: Microsoft.FSharp.Collections.Seq.averageBy