Posts

Showing posts from February, 2024

Pi value estimation in Pascal

Image
This is an example code for estimating the value of 'pi'. The method is a trivial Monte-Carlo sampling upon a quarter-circle using built-in 'random'. Two different estimations are impleneted: (a) the average area under curve (AUC), which is the (randomized) integral of y=f(x)=sqrt(1-x*x) in [0,1], and (b) the area ratio between the quarter-circle and its bounding box. Since the AUC uses twice the number of samples, it should produce consistently better estimations. Turbo Pascal 3.0 was one of those programming artworks of the early '80s, fitting an editor (external), a compiler, debugger and plenty of room to work with in just 64 KB of RAM. Similarly, it was one of the first programming tools (besides x86 Assemblers) to produce .COM executables directly, since the 'tiny' memory model was the default option at that time. Enable captions for more details and walk-through. Source code available at the Github repository (see channel info). Tags: #asmr #

Linear regression in Matlab

Image
Linear Regression (LSE) fit in retro Matlab 3.5 (MS-DOS) back in the early '90s. The purpose of this tutorial is to demonstrate elementary data processing and statistics via non-iterative coding paradigms, i.e., based on matrix operations only. Matlab was one of the first programming platforms to adopt such a matrix-based 'algebraic' data manipulation procedure as the core part of the language, like R and Python (numpy, pandas) do today. Although its functionality and toolboxes some three decades ago were nowhere near today's status and richness, it still was one of the most powerful platform for linear Algebra, signal processing and visual data exploration. The most common and almost 100% compatible open-source alternative is Octave, which is also in use today in many Universities around the world. Enable captions for more details and walk-through. Source code available at the Github repository (see channel info). Tags: #ambient #coding #programming #notalking

Channel Updates