Samir Khan

2116 Reputation

20 Badges

17 years, 24 days

My role is to help customers better exploit our tools. I’ve worked in selling, supporting and marketing maths and simulation software for all my professional career.

I’m fascinated by the full breadth and range of application of Maple. From financial mathematics and engineering to probability and calculus, I’m always impressed by what our users do with our tools.

However much I strenuously deny it, I’m a geek at heart. My first encounter with Maple was as an undergraduate when I used it to symbolically solve the differential equations that described the heat transfer in a series of stirred tanks. My colleagues brute-forced the problem with a numerical solution in Fortran (but they got the marks because that was the point of the course). I’ve since dramatized the process in a worksheet, and never fail to bore people with the story behind it.

I was born, raised and spent my formative years in England’s second city, Birmingham. I graduated with a degree in Chemical Engineering from The University of Nottingham, and after completing a PhD in Fluid Dynamics at Herriot-Watt University in Edinburgh, I started working for Adept Scientific – Maplesoft’s partner in the UK.

MaplePrimes Activity


These are Posts that have been published by Samir Khan

Great playwrights and poets are drummers – they craft the written word so that the rhythm and the cadence of their dialogue when spoken are a drumbeat, and combine with the meaning of the language to create emotion.  Shakespeare, for example, used syllables as his drumbeats (as did many other playwrights and poets).  Analyzing linguistic structure isn’t a common application for a math tool (and for a very good reason), but can Maple tell us more about Shakespeare’s favourite drumbeat?

We need to find some way of programmatically counting the number of syllables in a word. In an irregular language like English, this is a hit-and-miss affair.  Maple’s SyllableLength command, for example, tallies the number of vowel-consonant changes in a word to calculate the number of syllables (but increases the count by one if the word ends in a “y”.)  While this is a good start, for many words it’s merely an approximation. Conscious and serious, for example, have the same number of vowel-constant changes, but a different number of syllables when spoken.

I chose to modify the basic premise of SyllableLength with several empirical adjustments that give a more accurate tally of the number of syllables in a word.  This simply involves increasing or decreasing the calculated number of vowel-consonant changes if a word contains a particular letter structure.  For example, terrible has two vowel-consonant changes, but we increase this count by one (to calculate the number of syllables) because it ends in ble.

Although we can implement a number of these workarounds, this (admittedly very clumsy) approach is never going to account for the full irregularity of the English language, and we have to accept the results in that light.  The attached worksheet contains the chosen approach, and I’d appreciate feedback on more accurate ways of programmatically counting the number of syllables in a word.

So, let’s start by examining the monologue in Act 3 Scene 1 of Henry V.  Here’s the number of syllables per line as computed by the attached worksheet.

“Once more unto the breach, dear friends, once more;”
10 syllables

“Or close the wall up with our English dead”
10 syllables

“In peace there’s nothing so becomes a man”
10 syllables

“As modest stillness and humility”
10 syllables

“But when the blast of war blows in our ears,”
10 syllables

“Then imitate the action of the tiger”
11 syllables

So it looks like Shakespeare used ten beats, or syllables, per line, but placed an extra syllable in the final quoted line.  In fact, he often wrote monologues in a style called iambic pentameter, in which each line consists of five syllable-pairs (the first syllable in each pair being unstressed and the second stressed)

In much the same way that the darkening of a cinema is a visual cue that implies that a movie is about to begin, Shakespeare used iambic pentameter as an audio cue to signify emotionally resonant or particularly important dialogue, occasionally varying the number of syllables (or the number of polysyllabic words) per line to create a sense of discord, or a quickening or slowing of pace.

You might want to check out the following video – it’s Kenneth Brannagh’s version of the full speech in his 1989 film adaptation of Henry V.

Here’s another example from Romeo and Juliet (Act 3 Scene 5), together with the syllable counts given by Maple.

“Wilt thou be gone? It is not yet near day”
10 syllables

“It was the nightingale, and not the lark”
10 syllables

“That pierced the fearful hollow of thine ear”
11 syllables

“Nightly she sings on yond pomegranate tree”
11 syllables

“Believe me, love, it was the nightingale”
10 syllables

Again, Shakespeare shifts between 10 and 11 syllables per line to indicate emotionally resonant and poetic dialogue.

Shakespeare did not write entirely in verse with a defined metric structure.  He also wrote in free prose with no defined syllable structure, sometimes to indicate that the speaker was vulgar or mentally unbalanced, or in short question-answer dialogue.

Given the limitations of a purely programmatic approach, we’re never going to fully deconstruct the beauty of Shakespeare’s language.  Maple can, however, offer a small insight into how he controlled the rhythm and pace of his dialogue.

Download the attachment: Shakespeare.mw

I'm one of several technical writers at Maplesoft.  It's our job to craft the text in our brochures and user stories, and on our web site.  We all have differing styles, but we share a common goal; we want to write in a manner that’s technically compelling but simple to understand.

After recently exploring Maple’s string manipulation tools, I was surprised to find a command that measures the readability of a sample of English text.  It seems that as well as making you a better mathematician, Maple will poke and prod you into being a better writer.

StringTools[Readability] returns a measure of readability called the SMOG index (but, when asked, will also give the Flesch Reading Ease, Flesch-Kincaid Grade Level Formula, Automated Readability and the Coleman-Law indices).

These measures do not gauge the quality of the writing, its grammatical correctness, or account for specialized discipline-specific vocabulary. They simply use guidelines determined from in-the-field studies (largely conducted in the US) to quantify the degree of education or effort it takes to understand a sample of text.  Additionally, the calibration of the results against the required reading effort is only meaningful for readers whose native language is English, and whose schooling resembles that of the US system.

The SMOG index wins an award for the most amusing acronym of the month: Simple Measure of Gobbledegook. It's calculated with the following empirical formula.

 It returns the years of education (that is, the US grade level) required to completely understand a sample of text.  Typically, Newsweek has a SMOG index of 10 to 11, the New York Times 13 to 15, and the Harvard Law Review 17 to 18.

I was recently asked to describe MapleSim in less than 70 words; this was the result:

MapleSim is a tool for multi-domain physical modeling and control systems development.  Physical components and signal-flow blocks can be connected to create models that map onto the real system. It features an integrated environment in which the system equations can be automatically generated and analyzed, and new physical components created. It contains tools for optimized code generation, controls analysis and design documentation.

This has a SMOG index of 15.5, which implies the reader needs a university education for complete comprehension.  Since that’s the target audience, I guess I’m in the right ballpark.

As I write this post, I know I’m guilty of making many readability errors.  Are my fellow Maplesoft bloggers as guilty?

To answer this question, I used Maple to calculate the SMOG index for all the blog posts on Maplesoft.com (but first stripping out code snippets or URLs that would distort the score).  The top 10 and the bottom 10 scores are given below.

 

The Ten Most Readable Blog Posts

 

Rank

Title

Author

SMOG Index

1

Who Needs Math?

Fred Kern

10.2

2

China on my Mind

Fred Kern

10.8

3

Maple Goes Social (Networking)

Tom Lee

10.9

4

Top 10 things to evangelize about …

Tom Lee

11.0

5=

“Every time I walk into math class a little part of me dies”

Tom Lee

 

11.1

 

5=

India on my Mind

Fred Kern

11.1

7=

The Physics of Santa Claus

Stephanie Rozek

12.1

7=

Stringing Me Along

Samir Khan

12.1

9

A Better Tomorrow in Engineering Software

Samir Khan

12.2

10

Good Vibrations

Samir Khan

12.6

 

The Ten Least Readable Blog Posts

 

Rank

Title

Author

SMOG Index

30=

An Animated Discussion about Pendulums

Samir Khan

15.4

30=

Algebraic Surface Blending

Tom Lee

15.4

32

An Optimal Day

Tom Lee

15.5

33

Repaying Old Debts

Tom Lee

15.6

34

Taking the Lead

Tom Lee

15.8

36

Postcards from the road: Part 1 -- On rocket science

Tom Lee

 

16.0

35

Postcard from the road: Found in translation Part II

Tom Lee

16.3

37

Postcard from the road: Found in translation Part I

Tom Lee

16.5

38

Physical Modeling - Killer Application No. 2 for Symbolics

Laurent Bernardin

 

16.7

 

39

Let's Get Physical

Samir Khan

18.1

Well...it appears that I’ve written some of the most readable posts and the single least readable post.  The two least readable blog posts are those that explore abstract, high-level ideas (and hence demand more sophisticated writing), while the most readable blog posts are essentially opinion pieces.

Other than that, the only conclusion we can make is that good writers tend to write to the level of comprehension of the intended audience and the material; they don’t unnecessarily dumb down the sophistication of their writing to the lowest common denominator, or write to a level that’s beyond the scope of the material.

I’ve attached a Maple worksheet that helps you explore the readability of text using all of the measures in StringTools[Readability].  You may want to use it to write a more readable blog post than this one.

I was recently forwarded a link to this Snopes article.

According to the urban legend described therein, text is still readable if all the letters in a word apart from the first and last are randomized. I quickly threw together a Maple worksheet, primarily using its flexible string manipulation tools.

We’re now at an inflection point in which symbolic technology will automate physical modeling and equation generation through tools like MapleSim. As a recent webinar hosted by Maplesoft and the Society of Automotive Engineers proved, engineers are fascinated by the application of the technology, and the technology itself.

  • Voting patterns in Mexico and Florida.
  • The size of files in your Maple 12 installation
  • Stock trading volumes on the NYSE

What do all of these have in common? They, and other data sets drawn from the real world, often follow a non-intuitive pattern called Benford’s Law.

First 9 10 11 12 Page 11 of 12