Quantcast
Channel: Rod Carvalho
Browsing latest articles
Browse All 33 View Live

Image may be NSFW.
Clik here to view.

Heron’s method using integer arithmetic

Suppose we are given a positive rational number , whose square root we would like to compute. To be more precise, we would like to compute an approximation of . Let be an approximation of . Hence, we...

View Article



Image may be NSFW.
Clik here to view.

Generalizing Heron’s method

Suppose we are given a positive rational number . We would like to compute an approximation of the -th root of , which we denote by . If , we can use Heron’s method to approximate , as we saw a few...

View Article

Image may be NSFW.
Clik here to view.

Composing an endofunction with itself

Suppose we are given an endofunction . Let us introduce a new function , where , which we define recursively as follows where is the identity function on , i.e., for all . In Haskell, it is easy to...

View Article

Image may be NSFW.
Clik here to view.

Function composition via folding

Let us suppose that we are given a list of functions. We would like to compose the functions in this list (if they are composable, of course) in the order in which they are arranged in the list, i.e.,...

View Article

Image may be NSFW.
Clik here to view.

Sipser on P versus NP

On October 3, 2006 Michael Sipser was at Harvard to give the following lecture on the P versus NP problem: This talk is arguably the very best introduction to computational complexity I have ever come...

View Article


Image may be NSFW.
Clik here to view.

Generating all words over an alphabet

An alphabet is a finite set of symbols. A word of length over an alphabet is a sequence of symbols from , i.e., Alternatively, we can view a word of length over the alphabet as an -tuple (i.e., an...

View Article

Image may be NSFW.
Clik here to view.

Deterministic Finite Automata in Haskell

Consider the deterministic finite automaton [1] illustrated below [ state diagram courtesy of Michael Sipser [1] ] Henceforth, we will call this automaton . Note that has three states, labeled , , and...

View Article

Image may be NSFW.
Clik here to view.

Freeman Dyson on Wittgenstein

[ source ] Freeman Dyson on Ludwig Wittgenstein: Wittgenstein, unlike Heidegger, did not establish an ism. He wrote very little, and everything that he wrote was simple and clear. The only book that...

View Article


Image may be NSFW.
Clik here to view.

My implementation of (!!)

In Haskell we can easily create a list and then access its elements using the (!!) function, which is defined in the Prelude. Here is a very brief GHCi session: Prelude> let xs = [7,8,9] Prelude>...

View Article


Image may be NSFW.
Clik here to view.

Gell-Mann on learning

Murray Gell-Mann on why being in awe inhibits learning: I said I’d rather be poor or die than be an engineer because I would be no good at it. If I designed something it would fall down. When I was...

View Article
Browsing latest articles
Browse All 33 View Live




Latest Images