In this article, the Hamming code is first built with seven coins and without a computer and tested practically. You will learn how test bits can detect errors in a transferred bit sequence and determine the faulty position. The procedure is then programmed in a Jupyter notebook with Python.
(more…).algorithms
This is all about algorithms! Discover various algorithms, how they work, and example applications that help you understand the topic better.
-

Compressing Data with Smart (Part 2) – Converting Huffman Code in Python
In the first part, the example of KAFFEPAUSE was shown how the Huffman algorithm uses character frequency to create a binary tree and extract space-saving, unique codes from it. The basics are explained in detail in Teil 1 on ffritze.de.
In this second part, the Huffman algorithm is implemented in Python and gradually traced in a Jupyter Notebook. The focus is not only on the finished program. The individual data structures and processing steps are made visible so that the construction of the Huffman tree and the generation of the codes can be tried out directly.
(more…) -

Compressing Data with Smarts (Part 1) – The Huffman Algorithm Explained Simply
Conventional computer codes give each letter the same storage space - the common 'E' consumes as much as the rare 'K'.
The Huffman algorithm chooses a smarter way: frequent characters get very short codes, rare a little longer. Thus, the amount of data shrinks without any loss of information.
How to create an elegant Huffman tree from character frequencies step by step, let's look directly at the example word: KAFFEPAUSE.
(more…) -

The Travelling Salesman Problem – A challenge for Scratch-Tinker
Imagine that you are planning a trip through several cities and want to find the shortest route to visit each city exactly once. What at first sounds like a simple task is actually one of the most famous puzzles in computer science: the Travelling Salesman Problem.
But don't worry, you don't have to be a math genius to face this legendary challenge. On the contrary! We grab our colorful blocks in Scratch and show how to solve this complex problem in a playful and creative way.
In this article, we take on the Challenge and tinker together on a solution. Are you ready to show the traveler the most efficient way and dive deep into the world of algorithms? Then let's get started
(more…) -

K-means-clustering – development with Scratch
K-Means Clustering is a popular algorithm in the field of unsupervised learning, which is used to divide data into groups or clusters. This approach makes it possible to identify patterns in data without requiring prior labels. For an introduction to the topic and a fun board game to illustrate the concepts of unsupervised learning, you can find information on this page. There you will find materials that help you better understand the basics of K-Means Clustering and apply them in practice.
(more…) -

Button Navigator - Dijkstra unplugged
The Dijkstra algorithm is an efficient method for determining the shortest path in a graph. It is widely used in networks, route planners, and many applications in computer science. Due to its ability to find optimal solutions, it plays a central role in graph theory and data analysis.
(more…) -

Q-Learning – Development with Scratch
In this article we outline the development of the QField with Scratch. We start by drawing the playing field and implementing the random movement of Scratch. In the next step, we introduce the Q table, which serves as the basis for reinforcing learning. Finally, we visualize Scratch's decisions through drawn arrows that represent his path on the playing field.
(more…) -

Q-Learning – unplugged
The QField serves to recreate the process of reinforcement learning with a piece of paper and a pen. This is about learning a way by using the unplugged algorithm. Unlike other algorithms that aim for optimal solutions, this approach focuses on learning through trial and feedback.
(more…) -

Reversi as an example of the Minimax algorithm (in Swift Playground)
Reversi, also known as Othello, is a strategic board game for two players played on an 8×8 board. The goal of the game is to have more stones of your color on the board than the opponent.
(more…) -

Traverse graphs with Swift Playground
What is a graph?
A graph is a mathematical structure consisting of vertices (nodes) and edges that connect these vertices. Graphs can be used to represent relationships between objects, for example in social networks or traffic networks. They are a central concept in graph theory and are used in many areas of computer science and mathematics.
(more…)
