Archive for the ‘Code’ Category

Solving equations of upper triangular matrices

Upper triangular matrices

Suppose you have an equation like with and . and are given and you want to solve for . Example With , the problem could look like this: This is only a shorthand for: First step: Solve for First you see that . So you divide by the current row. Don’t divide through 0. When [...]

Solving equations of lower unitriangular matrices

Unipotent lower triangular matrix

Suppose you have an equation like with and . and are given and you want to solve for . Example With , the problem could look like this: This is only a shorthand for: This is easy to solve, isn’t it? First step: Solve for First you see that . Now you replace every occurence [...]

k-nearest-neighbor clustering – an interactive example

k-means interesting setting - thumbnail

Click to create new green dots. Ctrl+Click to create new blue dots. When the circle has exactly the same number of blue / green dots in it, it will be green. See also Voronoi diagram K-nearset neighbor k-means clustering

The Collatz sequence

Collatz sequence - Thumbnail

The goal of this post is to show you some tools that allow you to visualize data. And I also want to analyze some basic characteristics of the Collatz sequence. The Collatz sequences of a number is defined like this: So the sequence is defined as: You can define a directed graph like this: I [...]

Maps in C++

C++ thumb CPP

Maps are one of the most useful datastructures in C++ and there is no excuse for not knowing it. Here is a basic example that shows how you can use it: See also C++ Reference: general information and example Map is ordered collection (source)

Google Code Jam – Round 1C 2013

Google Code Jam Logo Thumbnail

Problem A (Consonants): Small Set: 4305/4834 users (89%) Large Set: 1551/3778 users (41%) Problem B (Pogo): Small Set: 2537/3129 users (81%) Large Set: 121/638 users (19%) Problem C (The Great Wall): Small Set: 934/1260 users (74%) Large Set: 74/330 users (22%) More information is on go-hero.net. Consonants A solution from nip: Pogo This is a [...]

How do hash functions work?

Connect Four - Thumbnail

Everybody who has written a noticeable amount of Java code should know the method hashCode(). But most beginners have difficulties to understand the significance of this little method. The following article gives you one small example with some impressions how much hash functions influence execution time. Connect four Connect Four [...] is a two-player game [...]