Posts Tagged ‘ Math ’

How many perfect riffle shuffles are required to restore a deck to its initial order?

September 24, 2018
By
How many perfect riffle shuffles are required to restore a deck to its initial order?

Last week I compared the overhand shuffle to the riffle shuffle. I used random operations to simulate both kinds of shuffles and then compared how well they mix cards. The article caused one my colleague and fellow blogger, Rob Pratt, to ask if I was familiar with a bit of

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on How many perfect riffle shuffles are required to restore a deck to its initial order?

Distances on rectangular grids

September 10, 2018
By
Distances on rectangular grids

Given a rectangular grid with unit spacing, what is the expected distance between two random vertices, where distance is measured in the L1 metric? (Here "random" means "uniformly at random.") I recently needed this answer for some small grids, such as the one to the right, which is a 7 x 6

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Distances on rectangular grids

The continued fraction representation of a rational number

September 6, 2018
By
The continued fraction representation of a rational number

Continued fractions show up in surprising places. They are used in the numerical approximations of certain functions, including the evaluation of the normal cumulative distribution function (normal CDF) for large values of x (El-bolkiny, 1995, p. 75-77) and in approximating the Lambert W function, which has applications in the modeling

The post Read more »

Tags: ,
Posted in SAS | Comments Off on The continued fraction representation of a rational number

Offset regions: Find all points within a specified distance from a polygon

July 16, 2018
By
Offset regions: Find all points within a specified distance from a polygon

My colleague Robert Allison recently blogged about using the diameter of Texas as a unit of measurement. The largest distance across Texas is about 801 miles, so Robert wanted to find the set of all points such that the distance from the point to Texas is less than or equal

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Offset regions: Find all points within a specified distance from a polygon

The intersection of two line segments

July 9, 2018
By
The intersection of two line segments

Back in high school, you probably learned to find the intersection of two lines in the plane. The intersection requires solving a system of two linear equations. There are three cases: (1) the lines intersect in a unique point, (2) the lines are parallel and do not intersect, or (3)

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on The intersection of two line segments

Visualize a torus in SAS

November 9, 2016
By

This article uses graphical techniques to visualize one of my favorite geometric objects: the surface of a three-dimensional torus. Along the way, this article demonstrates techniques that are useful for visualizing more mundane 3-D point clouds that arise in statistical data analysis. Define points on a torus A torus is

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on Visualize a torus in SAS

Cantor sets, the devil’s staircase, and probability

July 5, 2016
By

Last week I blogged about how to draw the Cantor function in SAS. The Cantor function is used in mathematics as a pathological example of a function that is constant almost everywhere yet somehow manages to "climb upwards," thus earning the nickname "the devil's staircase." The Cantor function has three

The post Read more »

Tags: , ,
Posted in SAS | Comments Off on Cantor sets, the devil’s staircase, and probability

What is a moving average?

January 25, 2016
By

A moving average (also called a rolling average) is a satistical technique that is used to smooth a time series. Moving averages are used in finance, economics, and quality control. You can overlay a moving average curve on a time series to visualize how each value compares to a rolling

The post Read more »

Tags: , , ,
Posted in SAS | Comments Off on What is a moving average?

Welcome!

SAS-X.com offers news and tutorials about the various SAS® software packages, contributed by bloggers. You are welcome to subscribe to e-mail updates, or add your SAS-blog to the site.

Sponsors







Dear readers, proc-x is looking for sponsors who would be willing to support the site in exchange for banner ads in the right sidebar of the site. If you are interested, please e-mail me at: tal.galili@gmail.com
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration.