I recently proposed that an email address be simplified in order to improve the user experience, and I used mathematics to justify the idea. I proposed to replace the email address it-support-xyz-na@company.com with help@company.com. Ignoring the common ending, the chance of randomly discovering the first email address is 1 in 1,133,827,315,385,150,000,000,000 (2617 or 1.13 septillion), which means that you have a better chance of winning the super-lotto multiple times. With those odds it would make a better password than it does a customer service email address. The chance of randomly discovering the email address that I suggested is 1 in 456,976 (264), which seems much more sane.
As I thought about the problem it occurred to me that the chances of randomly discovering the email address that I suggested is probably better than stated above since it is a word that English speaking people already know (and readily associate with what they are looking). As far as I can tell there are less than 250,000 words in the English language, which nearly doubles the chances of discovering help@company.com. This idea made me think about string guessing algorithms and the assumptions that are made when evaluating them, specifically algorithms designed to guess passwords.
Thoughts on String Guessing Algorithms
Labels:
Algorithms,
Ideas,
Passwords,
Security
JavaScript Dynamic Programming Example
Despite its name, many programmers have never heard of dynamic programming. In all fairness, it is not really programming in that sense of the word, rather it is a mathematical method for dividing problems into smaller subproblems and then combing those parts to form an optimal solution. The "programming" portion of "dynamic programming" probably shares more in common with "television programming," since they both involve using tables to organize data. The technique is taught in advanced computer science classes, so computer scientists and software engineers should be familiar with the technique.
Dynamic programming is a general technique which involves four basic steps: determine the structure of an optimal solution; recursively define values of the optimal solution; compute the optimal solution; and, if you need to know the optimal path in addition to the computed optimal solution value, construct the value formed by the path. The code on this page shows all of these parts, so it may help in understanding the technique.
I have read articles which explain complicated methods for doing fuzzy string matching that could possibly be replaced by dynamic programming techniques. Dynamic programming certainly brings its own overhead, so it would be interesting to perform empirical analysis on both techniques and compare the results. Since I presently lack the time to perform such an analysis, I decided to share a small, rough example that I created in JavaScript for doing string matching with a dynamic programming algorithm. The code below is essentially a simplified implementation of A Dynamic Programming Algorithm for Name Matching, which was published in the IEEE by Top, Dowla, and Gansemer.
Here is one example of how to use the code. This example uses searchValueA and searchValueB to generate an html table which shows how the dynamic programming matrix should look.
And, here is the JavaScript class/object (continued on the next page):
Dynamic programming is a general technique which involves four basic steps: determine the structure of an optimal solution; recursively define values of the optimal solution; compute the optimal solution; and, if you need to know the optimal path in addition to the computed optimal solution value, construct the value formed by the path. The code on this page shows all of these parts, so it may help in understanding the technique.
I have read articles which explain complicated methods for doing fuzzy string matching that could possibly be replaced by dynamic programming techniques. Dynamic programming certainly brings its own overhead, so it would be interesting to perform empirical analysis on both techniques and compare the results. Since I presently lack the time to perform such an analysis, I decided to share a small, rough example that I created in JavaScript for doing string matching with a dynamic programming algorithm. The code below is essentially a simplified implementation of A Dynamic Programming Algorithm for Name Matching, which was published in the IEEE by Top, Dowla, and Gansemer.
Here is one example of how to use the code. This example uses searchValueA and searchValueB to generate an html table which shows how the dynamic programming matrix should look.
nm = new nameMatch(searchValueA, true, '#html_div_result');
nm.score(searchValueB);
And, here is the JavaScript class/object (continued on the next page):
/**
* A Dynamic Programming Algorithm for Name Matching
* Top, P.; Dowla, F.; Gansemer, J.;
* Sch. of Electr. & Comput. Eng., Purdue Univ., West Lafayette, IN
*
* Variation in JavaScript
* Copyright © 2011, Christopher Stoll
* @author Christopher Stoll
*
* @constructor
* @param {String} [pNameSource=''] The source name, the name of interest
* @param {Boolean} [pDebug=false] The instance is in debugging mode
* @param {String} [pDebugOutputArea=''] Where to put debuging output
*/
function nameMatch(pNameSource, pDebug, pDebugOutputArea){
var tNameSource = pNameSource || '';
if(tNameSource){
if(tNameSource.indexOf(',') > 0){
var tIndex = tNameSource.indexOf(','),
tFirst = tNameSource.slice(tIndex+1),
tLast = tNameSource.slice(0, tIndex);
tNameSource = tFirst + ' ' + tLast;
}
tNameSource = tNameSource.toLowerCase();
tNameSource = tNameSource.replace(/[.'"]/ig, ' ');
tNameSource = tNameSource.replace(/\s{2,}/g, ' ');
}
// debug variables
this.DEBUG = pDebug || false;
this.DEBUG_AREA = pDebugOutputArea;
// y axis in matrix, the name in question
this.nameSource = tNameSource;
this.nameSourceLength = this.nameSource.length + 1;
this.nameSourceScore = 0;
this._reset();
}
Labels:
Algorithms,
Code,
Dynamic Programming,
JavaScript
1936 Akron Rubber Strike
The world has recently experienced an economic depression the likes of which have not been seen since the Great Depression. World leaders have been struggling for over three years to keep this economic calamity from destroying social institutions and precipitating war as the last one did. Of the tools and techniques that were used in the 1930s to restore American economic prosperity there is one that has been neglected. Not only has this tool remained unused during the current depression, but it has been actively attacked. That tool is organized labor.
Like other labor movements, the American labor movement began to appear with the onset of industrialization. In its early years American labor was weak, decentralized, and probably not classifiable as a movement. It was not until the Great Depression that unionization gained the institutional acceptance that it needed to truly become a movement. However, as Americans learned with the “Nobel Experiment” of Prohibition, laws and institutional changes cannot alter society without the acceptance of the people. The 1936 Akron Rubber Strike marks the moment when the ideas of policy makers met the hands of labor and the American labor movement began its ascent.
It can be demonstrated that the 1936 Akron Rubber Strike was a pivotal event by examining the changed attitude of Goodyear’s management team. Prior to the rubber strike Goodyear felt that it had the upper hand, while afterwards management’s tone was much more conciliatory. The chronology of events will establish that this change in attitude was caused by the workers themselves and not simply foisted upon the company and its employees by “professional strike leaders” as Goodyear’s president at the time asserted.1
Like other labor movements, the American labor movement began to appear with the onset of industrialization. In its early years American labor was weak, decentralized, and probably not classifiable as a movement. It was not until the Great Depression that unionization gained the institutional acceptance that it needed to truly become a movement. However, as Americans learned with the “Nobel Experiment” of Prohibition, laws and institutional changes cannot alter society without the acceptance of the people. The 1936 Akron Rubber Strike marks the moment when the ideas of policy makers met the hands of labor and the American labor movement began its ascent.
It can be demonstrated that the 1936 Akron Rubber Strike was a pivotal event by examining the changed attitude of Goodyear’s management team. Prior to the rubber strike Goodyear felt that it had the upper hand, while afterwards management’s tone was much more conciliatory. The chronology of events will establish that this change in attitude was caused by the workers themselves and not simply foisted upon the company and its employees by “professional strike leaders” as Goodyear’s president at the time asserted.1
Fuzzy Economic Numbers
This is an interesting video which highlights some unusual aspects of how government economic statistics are generated.
(video after the jump)
(video after the jump)
Labels:
99Percent,
Economics,
Inequality
Jon Stewart on TARPs Big Brother
Jon Stewart discusses the $7.7 Trillion worth of secret loans and guarantees that the Federal Reserve extended to large financial institutions in the early days of the financial crisis.
(video after the jump)
(video after the jump)
Labels:
99Percent,
Economics,
Inequality
Most Popular Passwords of 2011
It is Thanksgiving in the US, which means it is time to get together with family that you have not seen in a while. And, if you are one of those family members who "know about computers," then you will probably be hit up with computer questions. If you get to the point where you actually need to repair someone's computer this holiday season, but find that the person has forgotten their password, then SplashData may have some help for you. They have published their list of 2011s worst passwords. If you able to help your third cousin twice removed with this list then you might want to suggest that they get a password manager like the ones offered by SplashData or 1Password (I have used both, but prefer the latter).
( via Gizmodo > Mashable > SplashData )
password
123456
12345678
qwerty
abc123
monkey
( via Gizmodo > Mashable > SplashData )
password
123456
12345678
qwerty
abc123
monkey
Labels:
Passwords,
Security,
Thanksgiving
Thankful for Our Rights
Congress shall make no law respecting an establishment of religion, or prohibiting the free exercise thereof; or abridging the freedom of speech, or of the press; or the right of the people peaceably to assemble, and to petition the Government for a redress of grievances. — United States Constitution, First Amendment
(video after the jump)
(video after the jump)
Labels:
99Percent,
Thanksgiving
Calories in Christmas Ale for 2011
There are approximately 278 calories in each 12 fluid ounces of Great Lakes Christmas Ale this year, if my math is correct. Below are my calculations, if you would like to know how I came to this answer. To calculate the number on your own: grab a hydrometer, calculate the final gravity, plug your findings into the equations below, and let me know if I did it right!
First we need to find the original gravity:
Alcohol(by weight) = 76.08(OG-FG)/(1.775-OG)
7.5 = 76.08(x - 1.012) / (1.775 - x)
7.5(1.775 - x) = 76.08(x - 1.012)
13.3125 - 7.5x = 76.08x - 76.99
90.3025 = 83.58x
x = 1.080
OG = 1.080
Now, for the calories calculation:
C = 851(1.080 - 1)(1.080 + 3)
C = 851 * 0.080 * 4.080
C = 277.77
Historical Values:
Christmas Ale 2010 = ???
Christmas Ale 2009 = 313.25
Christmas Ale 2008 = 242.45
First we need to find the original gravity:
Alcohol(by weight) = 76.08(OG-FG)/(1.775-OG)
7.5 = 76.08(x - 1.012) / (1.775 - x)
7.5(1.775 - x) = 76.08(x - 1.012)
13.3125 - 7.5x = 76.08x - 76.99
90.3025 = 83.58x
x = 1.080
OG = 1.080
Now, for the calories calculation:
C = 851(1.080 - 1)(1.080 + 3)
C = 851 * 0.080 * 4.080
C = 277.77
Historical Values:
Christmas Ale 2010 = ???
Christmas Ale 2009 = 313.25
Christmas Ale 2008 = 242.45
Labels:
Brewing,
Calories in Christmas Ale,
Math
The Occupy Wall Street Protests of the 1930s
Modern protests seem quite tame compared to similar protests of the 1930s.
(video after the jump)
(video after the jump)
Where Have All the Capitalists Gone?
![]() |
| Paul W. Litchfield (via Summit Memory) |
In the first four sections he discusses the labor laws and customs of Great Brittan, Canada, Australia, and the US (specifically with rail roads). The transcription begins at section five. The emphasis is mine.
UNITED STATES CHAMBER OF COMMERCE
ANNUAL MEETING
APRIL 28, 1937
A LABOR RELATIONS PROGRAM
BY
P W LITCHFIELD
V
(A Suggested Course)
Turning now from this summary review of the past and some of the attempts already made both here and abroad to handle labor disputes, what suggestions can be advanced in the interest of a definite program that will enlist the support of capital, labor, and management?
Labels:
1930s,
Chamber of Commerce,
History,
Labor,
Politics,
Primary Source
Subscribe to:
Posts (Atom)





