In response to this post.
I've been thinking a lot about the same kinds of things, and I've come up with a few ideas that touch upon this:
First, some game designers want their game to be "hard" or "easy" - and this is a choice I can respect, although I would question its effect on sales.
Second, there's more than one kind of "difficulty", as Corvus pointed out. Adjusting on all these levels independently may very well be possible, but it requires an unusually deft algorithm.
I thought about how to determine the ideal difficulty. My first thought was:
A simple way to do this initially, without alienating them, is to have a tutorial which has several different "paths" they can take. This could be used not only to measure their play preferences (they chose the "exploration" path rather than the "stealth" path) but also their memetic preferences (they really like the rocket launcher, or being a psychic).
However, I decided that wasn't going to be very accurate. There is one sure way to tell that a player is or is not enjoying a game:
How long they play for.
Sure, some players will play in eight hour blocks and others play an hour a week. However, everybody will tend to make time to play a great game and let a weak game slide.
What you do is: over time, you slide the difficulty bar up. And up, and up, and up. After a few hours, they'll reach a point they "can't beat" (or don't care to try to beat) and quit playing.
But most people will come back and try again. I would say nearly all of them. And you are now aware of their limits - the "upper bound" of their "flow channel". After that, your primary goal is to find the optimum flow, which is done by moseying slowly towards that line, and being pushed down each time they quit. Over several sessions, you decrease the difficulty increase and bracket some place where they are having fun.
It's a noisy signal, unfortunately: they may quit to eat dinner, not because it's too hard. But noise just decreases the efficiency of the algorithm - it doesn't invalidate it.
At first glance, this would seem to tend towards "hard". But not really: people who want to explore will be naturally turned off by the rather high-seeming difficulty, and shut off the machine. This will bring the difficulty down, and the rise will be slower this session.
It's got some lumpy parts, but I think it's possible to measure what kind of challenge a player likes by simply measuring when they stop playing, and taking into account that sometimes they'll stop playing for non-game-related reasons.