# Posts tagged math

## Project Pivot Point to Horizontal Line

Suppose a hole is drilled underground into the back of a drift. The hole is drilled from a pivot point at a particular height from the floor. Typically this height is a characteristic of the drill. In itself, this is relatively moderate and quite standard in underground mining. Sometimes, the drill may break down, and they need to use a different drill. Suppose further that the alternate drill has a different pivot height from the floor. How can we determine where the new pivot point of each hole would be without re-designing the pattern? To narrow the scope a little, how can we determine the new horizontal distance of the pivot point from the reference line?

## Interest Rates - Interesting Properties

I was working on some wage modelling in Excel and was looking at multiple increases within a given period. I wondered if the result of applying individual increases throughout the year is the same as applying the sum of the increases to the initial value (Spoiler: it is not). I work the algebra to satisfy my curiosity. It isn’t difficult, but it can be a mistake that is difficult to detect.

I am involved with some experimental work, and a lot of the video footage is captured with a GoPro. They are durable and work well in the field. Unfortunately, they don’t support timestamp overlay with the date and time on the video. I used FFmpeg and a shell script to automate the process. The following script will take the video, extract the creation_time tag from the video and use that to generate the timestamp overlay.

## Uncertainty Propagation in Calculations

In science and engineering, uncertainties and errors are a fact of life. This post is a study of how uncertainties can be used in calculations. More importantly, this post explores how uncertainty is propagated to subsequent calculations. That is, given a series of calculations that build on top of one another, what happens to the uncertainty?

## LED Strip Calculations

The idea is to construct a spiral (Archimedean spiral or others) around a right-cone simulating a Christmas tree. We want to model the situation and understand how many lights or how long the strip(s) should be to wrap the proper amount of loops around the tree. This blog will establish the basic model and mathematics. This article will walk you through the mathematical derivation and the calculations. The derivations are for completeness. An understanding of the process is not required to use the results.

## Cribbage Strategies Are Explored With New Code And New Methods

This is a rewrite of my previous cribbage article and my article on expected average. It also includes access to completely re-written code. The code is simplified and complete with unit tests. It uses the click library to drive a nice command line/terminal application. This article will assume you are familiar with the rules and the point counting conventions of cribbage. Some of the relevant counting and conventions will be reviewed.

## Vector Reflection (2D Derivation)

This notebook will work through the explanation of determining the 2D vector reflection from a surface. I had a problem where I needed to determine the reflected vector from an incident vector in two dimensions. There are a lot of pages out there with good explanations. But a lot of seemingly conflicting information caused me to question my knowldge and write this article. This source is quite nice. It walks you through the steps and develops a valid relationship:

## Circle/Ray Intersection

The problem: We have a 2D circle and we have a ray or line. What are the intersections points between the two, if any?

## Extract Email

I have a lot of alerts configured with Google Scholar for various research interests. It’s a very cool concept, setting up a keyword search like blast fragmentation shockwave and Google sending you a summary email of new research that matches.

## Parts of Hashes and Expected Collisions

I am building a documentation system that works using Markdown for the documents and Pandoc to transform the documents to HTML, PDF, etc… It works well and is very easy to use. However there is a problem I have encountered. By default when Pandoc transforms a Markdown file to HTML, it automatically inserts section anchors. In Markdown, an ATX section header could look something like this:

## Measurement Uncertainty - How do measurement errors add up when working with areas?

Typically when you measure things, there is a certain amount of error. In everyday life, this is ignored for the most part. I was thinking about uncertainty in measuring areas. Like everyone else, I learned about uncertainty in measurement in high school during science class. It was further reinforced in university in every lab I took. The problem was, it was addressed as a set of rules to memorize and apply that covered the use of significant figures. Most people do not fully explore what this means exactly and consequently have trouble with the concept outside the typical canned responses. I was having trouble understanding why calculating an area with uncertainty was expressed the way it was.

## Change Units in Regression Equation

The purpose of this post is to explore the concept of changing the base units for a regression fit equation. Particularly the coefficients. The work is based on a paper called, “Prediction of Compressive Strength from Other Rock Properties.”

## Use Winscp to sync files from Windows to Linux

Recently I upgraded my work laptop to Windows 7. At that time I didn’t want to use the previous sync methods that I have blogged about. I wanted to use something simpler (read easier to install and maintain between different machines). After doing some research I settled on using winscp. Winscp supports folder sync operations through a command line. Winscp takes a simple text file listing the commands that it is to execute. This process can be automated on Windows using batches, one to pull changes and the other to push changes.

## Tolerance Testing - Determining an Appropriate Tolerance

Programming with floating point values leads to numerical round off errors due to the nature of binary numbers. For a more detailed discussion see this article or this one. Basically it boils down to the fact that not all real numbers can be represented by a finite binary sequence. Due to this phenomena comparing floating point values directly is strongly discouraged as the results can be unexpected. Normally, the absolute value of the difference is taken and if it is less than some tolerance value it is accepted as a match.

## Team Combinations from a Limited Pool of Players

I had to determine an arrangement of teams from a player pool. Specifically there were 9 players that needed to be organized into fair teams. It seemed straight forward to arrange them into 3 teams of 3 players. The other caveat was that the teams needed to be as fair as possible. Some players were highly skilled while others were not. It wouldn’t be fair to stack the best players on a single team. In order to determine a fair team I had to figure out how many combinations of teams were possible. This would allow me to iterate through all of the combinations and apply a metric to each combination. The combination that produced the minimal value would be the optimal arrangement.

## Speed Up Factor

I watch a lot of Coursera videos and usually view them at 1.25x or 1.5x normal viewing speed. I started thinking about how much that would translate into viewing time.

## Sequential Generation from an Index Value

I needed to be able to generate a sequence of letters from a specific index value. Basically, I wanted to loop through a sequence of values and retrieve the corresponding string value. For example, 0 would be A; 4 would be E; 36 would be AK; etc.

## Configuring MathJax on Ghost

I am going to add MathJax support. In the code injection portion of your settings, add the following code to the header injection mechanism:

## 5-pin Bowling Statistics Calculator

My son plays 5 pin bowling and is a member of YBC Canada. I used to keep track of his average and some statistics using a spreadsheet. I would enter the data after the end of every series of games and then copy the cells down so that the formula were applied and the correct statistics were calculated. This process worked well enough except I started to notice small discrepancies between my calculations and the posted results.