convert this (algorithm?) to computer code

37 Views Asked by At

I am trying to learn something new, and this might be the wrong place for it.

I have this: Math thing

and I have a few questions

  1. What do you call this, an algorithm?
  2. If I want to learn how to read it where should I start
  3. how would this translate in to c#, would I be right in thinking k = Math.Log(m / n) * 2; ? (I know that in .net Math.Log is ln and Math.Log10 is log.)

EDIT I am looking at Bloom Filters - https://en.wikipedia.org/wiki/Bloom_filter - this is the equation for finding the optimal number of hashes to use. K is the optimal number of hashes M is the known number of bits in the array/filter N is the known number of elements to be added to the filter

1

There are 1 best solutions below

2
On BEST ANSWER

It is a formula or an equation rather than an algorithm - an algorithm would have multiple steps.

In C# I think you would write this as

k = (m/n)*Math.Log(2)

This assumes that you have values for $m$ and $n$ and want to assign a value to $k$.