Combinatorics of some musical objects

Excerpts from Appendix C (page 164) from Keith [1991].  All results assume a 12-tone equal-tempered scale.

Number of diatonic scale classes: 3
Number of note names (A-G); number of notes in a common scale; number of white keys per octave on a piano:  7
Number of scales one note different from the Major scale: 9
Number of notes in the most common equal-tempered scale:  12
Number of common musical keys (C + 1-6 flats/sharps):  13
Number of 7-note diatonic scales (=7 * 3):  21
Number of elementary 2-fold polychords: 23
A k-fold polychord is an n-note chord sub-divided into k non-empty subchords, for k=1,  . . ., n.  For example, the 6-note chord <C, D, E, F#, G, A> can be subdivided into the 3-note 2-fold polychords, <C, E, G> and <D, F#, A>.
Number of 7-note chords:  66
Number of distinct interval sets (partitions of 12):  77
Number of 7-note triatonic scales (=7*35):  245
Number of notationally-distinct diatonic scales (=13 *21):  273
Number of distinct chord-types (= N(12) – 1):  351
Number of 7-note musical scales (=7*66):  462
Number of scales (=Number of n-note scales, summed over all n)  (=2^(12-1) = 2^11):   2048
Number of chords without rotational isomorphism (= 2^12 – 1):  4095
Number of notationally-distinct scales (=13 * 462):  6006
Number of non-syncopated 8-bar 1/4-note rhythmic patterns:  458,330
Number of non-syncopated 8-bar 1/8-note rhythmic patterns:  210,066,388,901

Reference:
Michael Keith [1991]:  From Polychords to Polya:  Adventures in Musical Combinatorics.  (Princeton, NJ:  Vinculum Press.)

This Much I Know (about CS and AI)

Inspired by The Guardian column of the same name, I decided to list here my key learnings of the last several years regarding Computer Science and Artificial Intelligence (AI). Few of these are my own insights, and I welcome comments and responses. From arguments I have had, I know that some of these statements are controversial; this fact surprises me, since most of them seem obvious to me. Statements are listed, approximately, from the more general to the more specific.

Dream on

Over at Normblog, Norm is thinking about anxiety dreams, and seeks to answer the question:  Who is the author of these dreams of ours?  Some think it seems not to be us, since the events in the dream come as a surprise to us and trouble us.  He concludes that it is the dreamer who is the author. If we think of dreams as being like films that we view in our sleep, then I assume Norm means that the author is the film-director, or perhaps the projectionist.
But there is another explanation of  all our dreams, not only those which cause us angst.  That explanation is that our dreams are just random images flashed before us by some mechanical process in our brain.  Here there is no continuous film, no coherent plot, no themes, no actors, no film-director, and the projectionist is outside having a cigarette while images are being loaded automatically by a random reel selector that management installed to save on staff.   We, however, are not outside.  We are sitting down in the front-row of the stalls of the cinema, being the audience for the film. So its no wonder we are surprised by what we see.   We try our best, both then and after waking, to make sense of the images that flash past us, looking for some narrative coherence.  If we have anxieties, this is when they appear, in our attempts at reconstruction of  a plot or a theme or some identifiable characters.   We are indeed the authors of our dreams, but only in the way that texts are written by their readers, and not their writers.

Poem: Petit Testament

About time we had another poem by Australian modernist, Ern Malley (Liverpool, UK 1918   1943 Sydney, Australia).  That Malley was not an existential being does not make his poetry any less powerful.

Petit Testament

In the twenty-fifth year of my age
I find myself to be a dromedary
That has run short of water between
One oasis and the next mirage
And having despaired of ever
Making my obsessions intelligible
I am content at last to be
The sole clerk of my metamorphoses.
Begin here:

In the year 1943
I resigned to the living all collateral images
Reserving to myself a man’s
Inalienable right to be sad
At his own funeral.
(Here the peacock blinks the eyes
of his multipennate tail.)
In the same year
I said to my love (who is living)
Dear we shall never be that verb
Perched on the sole Arabian Tree
Not having learnt in our green age to forget
The sins that flow between the hands and feet
(Here the Tree weeps gum tears
Which are also real: I tell you
These things are real)
So I forced a parting
Scrubbing my few dingy words to brightness.
Where I have lived
The bed-bug sleeps in the seam, the cockroach
Inhabits the crack and the careful spider
Spins his aphorisms in the comer.
I have heard them shout in the streets
The chiliasms of the Socialist Reich
And in the magazines I have read
The Popular Front-to-Back.
But where I have lived
Spain weeps in the gutters of Footscray
Guernica is the ticking of the clock
The nightmare has become real, not as belief
But in the scrub-typhus of Mubo.
It is something to be at last speaking
Though in this No-Man’s-language appropriate
Only to No-Man’s-Land.
Set this down too:
I have pursued rhyme, image, and metre,
Known all the clefts in which the foot may stick,
Stumbled often, stammered,
But in time the fading voice grows wise
And seizing the co-ordinates of all existence
Traces the inevitable graph
And in conclusion:
There is a moment when the pelvis
Explodes like a grenade. I
Who have lived in the shadow that each act
Casts on the next act now emerge
As loyal as the thistle that in session
Puffs its full seed upon the indicative air.
I have split the infinite. Beyond is anything.
 

Catwoman, my old flame

Those of you paying attention to these lectures will realize how obsessed I am with Economics.  That flaxen-haired lady promised so much, but she has so many flaws and failings.   When we first meet her, it seems she is everything you could wish for:  she is concerned with how society should be organized, how people should be given material goods, how the benefits of new technology and material well-being should be shared with all, and how the poor should be enriched, so that they can spend their time on self-improving and fulfilling activities, like art and sport.  So much is promised!
But then, once the flirtation and seduction are over, her flaws become evident. I have been thinking about these flaws again, having just read Deirdre McCloskey’s superb 2002 pamphlet, The Secret Sins of Economics.  Many of McCloskey’s criticisms are ones I (and many others) have made before, but some are new.   I decided, for comparison, to list here my chief complaints with this blemished beauty, this feline seductress, Our Lady of the Catallacts.  Date her if you wish, but you should read these accounts by her ex-lovers before you do.
First, she is blinkered, often unable to see what is obvious to anyone else – that we are all shaped by social and cultural forces, and peer pressures.   Instead, Catwoman and her acolytes invariably assume an individualist explanation for any economic or social phenomenon, and then seek to demonstrate it.  McCloskey calls this a focus on the P-variables (price, individual prudence, profit, the profane) as distinct from the S-variables (solidarity, speech, stories, shame) which Anthropology, that Indiana Jones of academic disciplines – creative, unruly, a thorn in everyone else’s side – has focused on.   A classic example is Levitt and Dubner’s Freakonomics.
Because of her blindness to the social, Cat Lady mostly ignored (until recently) major aspects of society, such as Institutions, legal frameworks, norms, and power relationships, aspects which can make or fail the marketplaces she says she studies.   She can’t claim that no one mentioned these to her, since 19th-century economists such as Karl Marx made the study of these aspects the work of a lifetime, and their study has continued to the present by sociologists and anthropologists and political scientists.
She has also been blind to anything historical or temporal, as if all her work stood outside the mundane and messy world in which we live.  This blindness manifests itself most strongly in the complete disregard (until recently) for endowments:  how did we get to where we are?  So, for example, free trade theory says that if England produces textiles more cheaply than Portugal, and Portugal produces wine more cheaply then England, the two should trade textiles for wine, and wine for textiles.   And the choice of these products is a subtly clever one, obfuscating much, since wine needs sunshine and not too much rain, while textiles (in the 18th and early 19th centuries) needed lots of rain, in order that the damp air would ensure cotton threads did not break when woven by machines.   So, Portugal’s sunshine and Northern England’s rain, being part of the God-given climate, were natural advantages, beyond the control or manipulation of any temporal human powers.  Free trade seems to have been ordained by the Almighty. But why consider only England’s textiles and not Ireland’s?    The answer is that Ireland had no textile industry to speak of.  And just why is that?  After all, much of Ireland is as damp as the valleys of Lancashire.   The reason is that the owners of northern English textile factories lobbied the British authorities to exclude Irish-made textiles from entering England.  When Ireland lost its own Parliament in a hostile takeover by Westminster, this protectionism for English textiles was entrenched, and the growing British Empire provided the critical masses of customers to ensure bonuses in Bury and Bolton and Burnley.     (Is it any wonder that people in Ireland and India and elsewhere sought Independence, when colonialism so powerfully stifled economic aspirations.)  Northern England has no natural comparative advantage in textile production, at least, not when compared to Ireland, but an artificial, man-made advantage.  The same type of advantage, in fact, that South Korea today has in ship-building, or the USA in most computer and aerospace technologies.   Where, in the mainstream theory of free trade, are these aspects studied, or even mentioned?
And when, angered by these failings, you face her with them, the wench promises you that that was all in the past, and she will be different from now on.  Path dependence and network goods and institutional economics are all the rage, she says.   But then you find, she’s still up to her old tricks:  She says she’s building models of economic phenomena in order to understand, predict and control, just like physicists do.  But, although it looks like that’s what she’s doing, in fact her models are not models of real phenomena, but models of stylized abstractions of phenomena.  Her acolytes even use that very word – stylized – to describe the “facts” which they use to calibrate or test their models.
Of course, she will say, physicists do this too.  Newton famously assumed the planets were perfect spheres in order to predict their relative movements using his theory of gravitation.   But physicists later relax their assumptions, in order to build revised models, in a process that has continued since Newton to the present day.  Physicists also allow their models to be falsified by the data they collect, even when that data too is stylized, and overturned.     Instead, Catwoman is still assuming that people are maximizers of individual utility, with perfect foresight and unlimited processing capabilities, obeying the axiom of the irrelevance of independent alternatives, when all these assumptions have been shown to be false about us.   When was the last time a mainstream economic model was overturned?
Indeed, here is another of her flaws:  her loose grasp of reality.  She says we are always, all of us, acting in our own self-interest.  When you quiz this, pointing out (say) a friend who donated money to a charity, she replies that he is making himself feel better by doing something he thinks virtuous, and thus is maximizing his own self-interest.  Her assumption, it turns out, is unfalsifiable.   It is also naive and morally repugnant – and false!  Anyone with any experience of the world sees through this assumption straight away, which is why I think our feline friend is borderline autistic.   She just does not know much about real people and how they interact and live in the word. Who would want to step out with someone having such views, and unable to reconstruct them in the light of experience?
And, despite her claims to be grounded in the material world (Paul Samuelson:  “Economics is the study of how people and society end up choosing, with or without the use of money, to employ scarce productive resources that would have alternative uses,  . . .”), she sure is fond of metaphysical entities for which no hard evidence exists:  invisible hands, equilibria, perfect competition, free trade, commodities, in fact, the whole shebang.   As marketers say, the existence of a true commodity is evidence that a marketing manager is not doing his or her job.  In comparison, Richard Dawkins with his memes is a mere amateur in this creation of imaginary objects for religious veneration.
One could perhaps accept the scented candles and the imaginary friends if she was a little more humble and tolerant of the opinions of others.  But no, the feline femme fatale and her acolytes are among the most arrogant and condescending of any academic disciplines.  Read the recovering Chicago economist McCloskey for an account of this, if you don’t believe me.   McCloskey’s anecdotes and experiences were very familiar to me, especially that sneer from an economist who thinks you’ve not acted in your own self-interest – for example, by helping your colleagues or employer with something you are not legally required to do.  Indeed, the theft by economists from philosophers of the word “rational” to describe a very particular, narrow, autistic behavior is the best example of this.   Anyone whose behavior does not fit the models of mainstream economics can be thus be labeled irrational, and dismissed from further consideration as if insane.
Date her at your peril!  You have been warned!

Vale: Robin Milner

The death has just occurred of Robin Milner (1934-2010), one of the founders of theoretical computer science.   Milner was an ACM Turing Award winner and his main contributions were a formal theory of concurrent communicating processes and, more recently, a category-theoretic account of hyperlinks and embeddings, his so-called theory of bigraphs.   As we move into an era where the dominant metaphor for computation is computing-as-interaction, the idea of concurrency has become increasingly important; however, understanding, modeling and managing it have proven to be among the most difficult conceptual problems in modern computer science.  Alan Turing gave the world a simple mathematical model of computation as the sequential writing or erasing of characters on a linear tape under a read/write head, like a single strip of movie film passing back and forth through a projector.  Despite the prevalence of the Internet and of ambient, ever-on, and ubiquitous computing, we still await a similar mathematical model of interaction and interacting processes.  Milner’s work is a major contribution to developing such a model. In his bigraphs model, for example, one graph represents the links between entities while the other represents geographic proximity or organizational hierarchy.

Robin was an incredibly warm, generous and unprepossessing man. About seven years ago, without knowing him at all, I wrote to him inviting him to give an academic seminar; even though famous and retired, he responded positively, and was soon giving a very entertaining talk on bigraphs (a representation of which is on the blackboard behind him in the photo). He joined us for drinks in the pub afterwards, buying his round like everyone else, and chatting amicably with all, talking both about the war in Iraq and the problems of mathematical models based on pre-categories with a visitor from PennState. He always responded immediately to any of my occasional emails subsequently.

The London Times has an obituary here, and the Guardian here (from which the photo is borrowed).

References:
Robin Milner [1989]: Communication and Concurrency. Prentice Hall.
Robin Milner [1999]: Communicating and Mobile Systems: the Pi-Calculus. Cambridge University Press.
Robin Milner [2009]: The Space and Motion of Communicating Agents. Cambridge University Press.

Operational incompetence at CIA

At the end of December 2009, an Al Qaeda double agent killed himself and seven CIA agents and security staff at a US base in Khost,  Afghanistan.   Former CIA agent and writer, Robert Baer, has an account of the tragedy in a fascinating article in next month’s GQ, here.   Baer argues, as he has before, that CIA management have systematically and deliberately destroyed the agency’s capabilities for human espionage – that field operations are devalued, that field operational skills are not taught, not learnt, and not acquired, that junior field staff are not mentored, and that field skills and experience are not rewarded within the agency.   Organizational lack of attention to operational skills allowed a junior and field-inexperienced analyst to be appointed head of the Khost base, allowed that analyst to be appointed with neither knowledge of the local language nor prior local experience, allowed her to arrange a meeting with a human informant at the base (instead of off-base), allowed her to arrange a meeting with a human informant that no one locally had previously met, allowed numerous other people to attend this meeting, allowed this meeting to be discussed ahead of time back at Langley and in the White House, and allowed the informant to pass through three security checkpoints without being checked for weapons or bombs.  They even baked a birthday cake for their visiting suicide bomber.  The numbers killed made this the worst disaster for CIA since the 1983 bombing of the US Embassy in Beirut.
Retrospect, of course, is always wiser than prospect.  But one has to wonder how low the level of espionage tradecraft could be that so many gross errors were made.  Baer puts the blame squarely on the deprofessionalization of CIA’s field operations, especially since John Deutch’s time as Director (1995-1996).
At the end of his article, Baer says:

The United States still needs a civilian intelligence agency. (The military cannot be trusted to oversee all intelligence-gathering on its own.)”

In his memoirs, former US Defense Secretary Robert McNamara said that one lesson he’d learnt from the US military involvement in Vietnam was the need for an independent and objective source of intelligence on progress (eg, numbers and locations of enemy engagements; the outcomes of engagements; assessments of enemy strength and morale; etc).  In Vietnam, this information was not provided to the White House by CIA or any other independent agency, but by the US military themselves, and was therefore subject to distortion, to bias, and to outright manipulation.  The people firing the arrows were the same people drawing the targets for the arrows and counting how many bullseyes the archers had achieved.
A recent CNN interview with Robert Baer is here (conducted 2010-03-16).
A previous post which mentions Robert Baer is here.

Metrosexual competition

Writing about the macho world of pure mathematics (at least, in my experience, in analysis and group theory, less so in category theory and number theory, for example), led me to think that some academic disciplines seem hyper-competitive:  physics, philosophy, and mainstream economics come to mind.  A problem for economics is that the domain of the discipline includes the study of competition, and the macho, hyper-competitive nature of academic economists has led them, I believe, astray in their thinking about the marketplace competition they claim to be studying.  They have assumed that their own nasty, bullying, dog-eat-dog world is a good model for the world of business.

If business were truly the self-interested, take-no-prisoners world of competition described in economics textbooks and assumed in mainstream economics, our lives would all be very different.  Fortunately, our world is mostly not like this.   One example is in telecommunications where companies compete and collaborate with each other at the same time, and often through the same business units.  For instance, British Telecommunications and Vodafone are competitors (both directly in the same product categories and indirectly through partial substitutes such as fixed and mobile services), and collaborators, through the legally-required and commercially-sensible inter-connections of their respective networks.  Indeed, for many years, each company was the other company’s largest customer, since the inter-connection of their networks means each company completes calls that originate on the other’s network; thus each company receives payments from the other. 

Do you seek to drive your main competitor out of business when that competitor is also your largest customer?   Would you do this, as stupid as it seems, knowing that your competitor could retaliate (perhaps pre-emptively!) by disconnecting your network or reducing the quality of your calls that interconnect?  No rational business manager would do this, although perhaps an economist might.

Nor would you destroy your competitors when you and they are sharing physical infrastructure  – co-locating switches in each other’s buildings, for example, or sharing rural cellular base stations, both of which are common in telecommunications.   And, to complicate matters, large corporate customers of telecommunications companies increasingly want direct access to the telco’s own switches, leading to very porous boundaries between companies and their suppliers.   Doctrines of nuclear warfare, such as mutually-assured destruction or iterated prisoners’ dilemma, are better models for this marketplace than the mainstream one-shot utility-maximizing models, in my opinion.

You might protest that telecommunications is a special case, since the product is a networked good – that is, one where a customer’s utility from a particular service may depend on the numbers of other customers also using the service.    However, even for non-networked goods, the fact that business usually involves repeated interactions with the same group of people (and is decidely not a one-shot interaction) leads to more co-operation than is found in an economist’s philosophy.  

The empirical studies of hedge funds undertaken by sociologist Donald MacKenzie, for example, showed the great extent to which hedge fund managers rely in their investment decisions on information they receive from their competitors.  Because everyone hopes to come to work tomorrow and the day after, as well as today, there are strong incentives on people not to  mis-use these networks through, for instance, disseminating false or explicitly-self-serving information.

It’s a dog-help-dog world out there!

Reference:
Iain Hardie and Donald MacKenzie [2007]:  Assembling an economic actor: the agencement of a hedge fund. The Sociological Review, 55 (1): 57-80.