Thursday, January 24, 2013

Conflict Resolution - 2: Asimov's Laws of Robotics

Asimov's Laws of Robotics
The introductory discussion on prioritized business rules can be read here. This sequel treats Asimov's sci-fi laws of robotics as a set of prioritized business rules within a decision support system (DSS). We try to learn some 'field lessons' from stories that revolve around violations of one or more of these laws. The three (original) laws postulated in the 1940s and the stories cited in the Wikipedia page are used in this post:
  1. A robot may not injure a human being or, through inaction, allow a human being to come to harm.
  2. A robot must obey the orders given to it by human beings, except where such orders would conflict with the First Law.
  3. A robot must protect its own existence as long as such protection does not conflict with the First or Second Laws.
We can think of these anthropocentric laws as 'Asenion' robotic design constraints in the sci-fi world which, among other things, seek to prevent the creation of Frankenstein-type automatons. Every robotic decision must satisfy these constraints in normal operating conditions. As the laws imply, a lower priority rule can be violated only to prevent the counterfactual infraction of a higher-priority rule. Asimov's robot stories cover situations where a rule is violated for no immediately apparent reason, or a lower-priority rule appears to override a higher priority rule. A robot typically 'crashes/auto-destructs' when faced with an irreconcilable conflict ("damned if you do, damned if you don't").

(Trivia: Robot Chitti in the Indian movie Endhiran is obviously not Asenion. A portion of the plot in the movie bears some resemblance to a story-line in 'Robots of Dawn')

Inadequacy of rules for complex systems
Anticipating 'bugs', and identifying/resolving potential conflicts (low-probability high consequence (LPHC) events in particular) within and between interacting components of a complex, synthesized system can be quite challenging. Recent examples: Boeing 787 Dreamliners, offshore oil rigs, or the western financial system. The positronic robot is no exception. Roger Clarke notes: "Asimov's Laws of Robotics have been a very successful literary device. Perhaps ironically, or perhaps because it was artistically appropriate, the sum of Asimov's stories disprove the contention that he began with: It is not possible to reliably constrain the behavior of robots by devising and applying a set of rules."

(picture link source: Wikipedia)

Hard Constraint Violation

Stories around initial designs of Asenion robots appear to revolve around hard-constraint satisfaction. Humans forget that a telepathic robot also protects humans from mental harm. It often prefers to tell the questioner what she/he wants to hear, violating the second law by not responding with facts, in order to satisfy the higher priority constraint of not injuring human minds 'by dashing hopes'. In the end, it runs into an irreconcilable constraint violation when it can neither speak nor be silent without hurting somebody mentally. It 'dies', taking its telepathic secrets with it.

An expensive decision support system that provides a 'null' response (or '42') after running for a long time can be irritating. There once was a user who loved a DSS when it worked, but would question slow-failures, asking why the application was designed to go through bugs and not around them.

Soft Constraint Violation
A more sophisticated robotic design in another story employs an optimization model. The laws are encoded as soft constraints using potential functions that take into account the level of importance of the order given, the priority of the law, and the degree of constraint 'violation'. Consequently, a 'truant' robot that is faced with a conflict between the second and third laws determines an optimal (equilibrium) solution to the corresponding weighted cumulative violation minimization problem that causes it to continually run around in a circle centered at the origin of the conflict. Doing so prevents the robot from completing a routine task it was assigned. Unfortunately, the robot is uninformed that the delay in the completion of this task is increasingly endangering human lives on the planet. An initial idea of the engineers to break this cycle by perturbing the potentials in the objective function merely shifts the optimum and alters the radius of the Robot's circle, but doesn't help them one bit. Finally, an engineer put his own life in visible jeopardy to inject high-intensity counter-potential (associated with the first law) into the objective function, and is ultimately able to resolve the conflict without loss of life.

This story reminds us of the problems associated with careless softening of 'hard' constraints that attenuates or randomizes the sensitivity of the model's response to priorities and scarce resources ("noisy duals"). The user is left with the unpleasant task of figuring out how to tweak the various 'potential' coefficients for a given problem instance in order to achieve the best results. In practice, an artful mixture of hard and soft constraints usually results in a more manageable and usefully responsive system.

Side-effects of Violation
Users often turn a few knobs in a DSS, look at the results, and wonder "why did this weird thing happen?". This leads to discussions that often unlocks hidden benefits for the customer. In an Asimov story, a robot determines that it is optimal for it to take over the management of delicate instrumentation that is vital to human survival on a planet. It deliberately disobeys humans and gangs up with other robots to permanently banish humans from the control room. The engineers are initially exasperated by this behavior ("is it a bug or a modeling issue?") before a data-driven realization of the life-saving benefit of 'violating' the lower-priority rule calms them. In practice, it is useful to identify unnecessary legacy constraints, if any, that are employed.

Rule violations can also result in undesirable side effects. In the world of airline scheduling, careless rule-changes put in to fix one problem can result in bizarre (hilariously alternative-optimal) schedules for pilots and planes that send them on a wild-goose chase all over the continent. In Asimov stories, engineers discover that a conflict-stressed robot's positronic brain turns it into a practical joker, a prophet, or a wacky friend who plays tag in a life-or-death situation.

Conflict resolution is not just about figuring out what went wrong in the model - a relatively easy task given the excellent solver tools that are available in the market today. It also involves the task of usefully and legibly mapping this change in the model's response back to real world causals. The more interlinked the decision variables and business rules in the system, the more difficult this latter task can become.

In memory of the late Tamil writer Sujatha.

Sunday, January 13, 2013

Being Optimally Sorry: When to Apologize?

A Delayed Apology
This post examines modeling ideas related to the timing of an apology in a two-person scenario that results in a maximally effective 'sorry'. We optimize timing here not to maximize own benefits (user optimal), but on the basis of mutual respect, to express regret and maximally repair the damage in a timely manner that most helps the subject (recipient optimal). We start with the findings in Frank Partnoy's book "Wait: the Art and Science of Delay". It's one of the many useful books in the last couple of years that analyze human decision making. We introduce a mental decision support model for a timely apology that is derived from decision analytical methods employed in an industrial setting.

Objectives and Constraints
Justice delayed may be justice denied, but an apology that is optimally delayed may not be such a bad thing. The 'Wait' book recognizes the existence of a suitable time to apologize, and notes that the fastest apology in not necessarily the most effective. Given that we may have to apologize more than once, in general we have to determine an optimal trajectory of timed apologies. Thus, our goals are to:
i)   apologize at least once,
ii)  in a timely manner, and
iii) within a finite time horizon, such that
iv) a measure of the recipient's benefits is maximized

'Wait' notes:
"... Saying you are sorry is always better than not apologizing at all. But as with the first study, the students felt better about a delayed apology: “Improvement in the late apology condition was significantly greater than improvement in the early apology condition.” In fact, a statistically significant improvement in the students’ reactions occurred only in the late apology condition, when there was a chance for them to discuss what had happened and why. Overall, these studies suggest that the relationship between apologies and timing follows a “bell curve” distribution: effectiveness is low at first, then rises, peaks, and ultimately declines."

(It seems that these ideas are related to the complementary 'problem' of delivering the most time-effective 'Thank You')

We can see that the timing-effectiveness curve described in the book extract above is related to the subject's level of distress/angst (which we represent as 'entropy') that follows a similar trajectory of rise, cruise, and a gradual demise. Depending on the person, the 'cruise' and 'demise' portions can last long and result in a very fat-tailed distribution. But before we get into 'when', a quick comment from the book on the what/why/how questions:
".... effective apologies typically contain four parts: 
1. Acknowledge that you did it. 
2. Explain what happened. 
3. Express remorse. 
4. Repair the damage, as much as you can."

Searching for the Optimal Timing
'Wait' notes:
"The art of the apology centers on the management of delay. For most of us, the lesson is that the next time we do something wrong to a close friend or family member, or say something at work we wish we could take back, we should try to imagine how the victim might react to an apology tomorrow instead of today, or in a few hours instead of right now. If delay will give a friend or relative or coworker a chance to react, to voice a response and prepare themselves to hear our regret, the apology will mean more later than right away."

In other words, the timing has to take into account where the subject is located in their entropic life cycle: is the person likely to be getting angrier by the hour now (positive entropic gradient), or has reached the peak and is calming down (negative entropic gradient). To formulate a model based on these observations, we borrow ideas from a classical inventory management problem analyzed in retail operations research: Markdown Optimization (MDO).

An Optimization Model
MDO is employed to manage an inventory of short-life cycle (SLC) products that are manufactured pre-season, with the (sunk) costs paid up-front. Thus MDO typically focuses on total revenue earned in-season. Analogously, we already messed up in the beginning incurring an irreversible cost, and thereafter it costs relatively little to issue a sincere apology.  Retailers employ a cadence of optimally delayed price cuts to smartly boost the end-of-season demand rate so as to maximize revenue over the remaining life of the product. Like MDO, we eventually have to solve an entropic inventory depletion problem: optimally alter the entropic gradient via one or more carefully timed apologies, which will (ideally) reduce the inventory level to zero within a finite time period.

Disclaimer: The postulated model is not assumed to be the most suitable or even a "correct" one for this problem, but merely a useful starting point. Some brief comments on the modeling elements, next.

a. Life-cycle of the entropy
SLC products (like designer fashion apparel) often have little to no historic data early in the season, and retailers may borrow results for a comparable historical "like-item" to produce an initial prediction and then continually update their sales projection based on in-season demand. Here, we play the role of a 'like-item' and place ourselves in the recipient's shoes to better appreciate the degree of distress caused and the impact it will have on the recipient over time. The entropy level is an uncertain quantity that must be learned, but its 'mean value' is assumed to representable using an approximately concave function like the one shown in the figure below. Note that unlike the MDO case where inventory is always non-increasing, entropic inventory initially increases before gradually decreasing.

b. Elasticity of the entropy with respect to an apology

Elasticity ~ % change in entropy / % change in regret and effort, as perceived by the subject
A simple model like the inverse square law that abounds in nature (elasticity = -2) may be a good starting point. Ill-timed and empty-sounding apologies may have zero elasticity and do little to reduce entropic inventory. A careless apology can result in an entropic spike ("adding insult to injury"). On the other hand, an apology that is 'deep and sincere' and well-timed can be expected to have a calming effect.

c. Timings
Optimally timing a single apology requires impeccable timing. On the other hand, randomly distributed, and incessant apologies may not be helpful either. A premature apology (e.g. around an increasing entropic gradient) that kicks the can down the road is a greedy approach that may be counter-productive. Thus, optimally timing multiple apologies can require a degree of coordination between decisions. Today's apologize-or-delay decision will impact the timings of future decisions, so we have to holistically manage the impact on the entropic life-cycle. 

Often, despite our best efforts, the damage can never be fully repaired. Note that our objective function was setup to be indifferent to personal benefits. To paraphrase a profound Indian saying: "You have the right to optimize, but not to the fruits of your actions". Regardless of the outcome, a sincere and optimally timed apology is good Karma.

Tuesday, January 8, 2013

Business Rule Conflict Resolution: Needles in a Haystack

This post uses the retail industry as a sketchpad to illustrate some simple but useful conflict resolution ideas employed within optimization methods in practice.

Least Infeasible Answers
Retailers have to address a myriad of business rules while optimizing merchandising, pricing, shelving, replenishing, and assortment planning decisions. Operations Researchers build mathematical models that translate these rules into a combination of soft constraints (goals, objectives, Key Performance Indicators (KPI)) that have to be maximally satisfied, and hard constraints that must be absolutely satisfied.
Conflicting hard rules can prevent the optimization application from returning a recommendation. The retailer would like to know which among their long list of rules is/are the root cause of this conflict so that they can address them appropriately and re-evaluate. Commercial solvers like CPLEX (and GUROBI, among others) can perform an infeasibility analysis to provide useful information pertaining to IIS (Irreducibly Inconsistent Sets), and based on optimizing a user-parameterized penalty function, can also find a minimally infeasible answer. These are non-trivial problems. (Try explaining to a senior pilot why a more junior pilot was assigned that plum schedule filled with all those long Hawaii layovers!) JW Chinneck has an entire book dealing with such issues.

User Experience
The liberal-arts degree armed retail store manager (RSM) has a business to operate and sales targets to achieve. Many a RSM care little for iterative conflict refinement and resolution and have even lesser patience to set up paramterized penalty functions. He/She often desires that the analytics software product automatically flag problematic rules and always return the "best possible" answer(s) and be done with it. 'Null' or 'Try, try again' is not an option. A positive user experience combined with the ability to "help me earn a bonus or you are toast" is correlated with continued patronage. In such situations, the decision analytics plumbing must be designed in such that it can, with little to no external guidance, produce practically useful diagnostics that pinpoints infeasibility and generate 'best fit' solutions that are readily business-comprehensible to the average user. After all, the business application interface and functionality is not primarily meant to be a analytics-tutorial warp drive thingy.

 (picture link source:

Actions Express Priorities - Mohandas Gandhi
A store manager may have a high-level goal in mind such as: find a minimally business disruptive resolution of conflicting business rules. Toward this, several retailers employ prioritized business rules that result in a special haystack structure that invariably makes the conflict identification and resolution process more transparent and easy to manage. What would this decision problem structure look like? Borrowing computer-ware terminology (for example), it would be akin to an ordered collection of hard constraints, soft constraints, and firm constraints. Patented methods that gainfully exploit related ideas have been used to build retail optimization products that turned out to be successful in the global marketplace. On the other hand, the efficacy of such resolution methods can be context-specific and is not necessarily designed to yield universally scalable solutions. If your job is to solve only your company's or industry's specific problems and not that of all current and future corporations in the galaxy and beyond, such methods can be handy.

Thursday, January 3, 2013

Priceless Pricing

Listening to Jazz feels like time well spent, despite a limited understanding of this beautiful American art-form. John Coltrane and Miles Davis are especially close to heart given their affection for India's native music that also influenced how they played. Miles is recognized for paying attention to the 'space between the notes' as noted in this blog:

"Among Miles’ trademarks was his emphasis on the space between the notes as much as the notes themselves.  Silence was key to his music.  He was so cool he didn’t feel the need to jam up every measure with noise.  Sometimes it’s better to just stand there and not do something."

It is well known that silence is an important tool in the hands of an expert stand-up comedian or a novelist. In the world of ORMS, optimally scheduling working hours for airline crews is really about paying close attention to their silent periods of rest. In the world of pricing optimization, it is imperative to recognize that a customer always values something else in the product in addition to price. To usefully optimize price, we must accurately identify its priceless attributes.

Update: January 11, 2013
Richard Marcus, former CEO of Neiman Marcus:  “Price is important, but quality is remembered long after price is forgotten, as are qualities of uniqueness and originality.

Update: February 06, 2013
Competing beyond price to maximize customer loyalty: "...“Attractive prices are an effective means to get people in the door, but it’s not enough to maintain loyalty, drive future purchases, and generate customer recommendations..."

Update: May 30, 2013
Price Perception: "’s not about price, it’s about what am I getting for that price"