Lock in $30 Savings on PRO—Offer Ends Soon! ⏳

Simplifying complexity: some ideas (PyConUK 2017)

Simplifying complexity: some ideas (PyConUK 2017)

How to use ideas from Christopher Alexander, Bill Tutte, and modern mathematics to help simplify complex design problems. More work is required in this area. Presented in the PyData track at PyConUK, Cardiff.

Jonathan Fine

October 27, 2017
Tweet

Other Decks in Programming

Transcript

  1. Simplifying complexity: some ideas Jonathan Fine jfi[email protected], @jfine2358, etc For

    Bill Tutte (1917–2002) Bletchley Codebreaker Foundations of graph theory and matroids PyConUK, Cardiff — Friday 27 October, 2017
  2. The human problem of scaling Understand our own actual, real

    and specific complex human situation well enough, to divide it usefully into parts. Sometimes habit fails us. MVC design pattern and web apps?
  3. Christopher Alexander on complexity and parts In his 1964 book

    Notes on the synthesis of form he drew on his experience as architect and designer saw traditional design process not working saw it as a problem of innovation and complexity recorded potential misfits between variables recorded this in nodes-and-edges graph used agriculture village in India as example used new software to decompose misfit graph hence divide-and-conquer solution Next, a software example of design complexity.
  4. Our example is to develop small to medium website Success

    factors? Our own goals, and perhaps rapid software development, loads of extras, secure, scalable, versatile easier, more fun, everything you need, large and friendly community, used by big names, open source quick to load, mobile, easy check-out, calls-to-action, secure shopping, social sharing, product reviews, contact information content, usability, accessibility, strategy, design, marketing, analytics, updates strategy, audience, competition, design, brand, ease of use, content, updates, social media, mobile, promotion Success will require many 1–1 and small group conversations (say 3 to 7 people). Sources for success factors: django, rubyonrails, thewebbureau.com, linkenin.com/pulse, cre8ive.co.nz
  5. The misfit table contains agenda items Here’s a misfit table

    for factors A to F. A B C D E F A| ? ? ? B| ? ? C| ? D| ? E| ? Mark cells that are a potential misfit. These cells are agenda items for conversations.
  6. We now have a scheduling problem People need to talk.

    And the project manager is getting anxious. Rooms have to be booked. Meetings scheduled. Time is short. Resources are limited. Too many bullet points. Can computers help us schedule this?
  7. And now we’re well into the big data Our toy

    example has 6 success factors and 8 agenda items. And so there are 8 × 7 × 6 × 5 1 × 2 × 3 × 4 = 70 ways to choose a 4-item conversation. And 70 × 69 × 68 × 67 1 × 2 × 3 × 4 = 916,895 ways of choosing 4 of these conversations. What makes a good collection of agendas?
  8. Loops (aka cycles) cause complexity Henry and Liza are a

    team. They want a bucket of water. It’s complicated. Let’s listen in to their conversation. It’s an old song. There’s a hole my bucket, dear Liza. Well fix it, dear Henry. To fix the bucket, Liza suggests straw. Henry finds it too long. Liza: Cut, with axe. Henry: Axe blunt. Liza: Sharpen, with stone. Henry: Stone dry. Liza: Wet, with water. In what shall I fetch it, dear Liza? In a bucket, dear Henry. There’s a hole my bucket, dear Liza.
  9. Absence of loops (aka cycles) causes simplicity We want a

    rigid jointed structure, to support our soft tissues while we walk about. Also song. Your toe bone connected to your foot bone Your foot bone connected to your ankle bone . . . ankle . . . leg . . . knee . . . thigh . . . hip . . . back . . . shoulder. . . Your shoulder bone connected to your neck bone Your neck bone connected to your head bone I hear the word of the Lord! (What a good design.)
  10. An old problem: Alexander quotes Plato First, the taking in

    of scattered particulars under one Idea [Python], so that everyone understands what is being talked about. [. . . ] Second, the separation of the Idea into parts [modules], by dividing it at the joints, as nature directs, not breaking any limb in half as a bad carver [programmer] might. Plato, Phaedrus, 265D [adapted] Work is hard without right concepts, shared across the team.
  11. How Alexander cut the complexity knot He used the methods

    of the time. Kirchoff’s circuit laws (1845) give mathematical analysis of electrical current flow in a network. And probability theory. Alexander’s set up: A system of 0-1 random variables, some pairwise dependent. Decompose to minimize information transfer. Alexander’s algorithm: Use a computing hill-climbing procedure to find a local optimum. Programmed for the IBM 7090, in 1962-3.
  12. I’m a doctor (PhD pure math). Can I help? A

    donut is more complex than a ball. Homology measures complexity by counting holes. There are many types of hole. Fact: Convex polytopes (given by linear inequalities) have nice homology. Let E = {e1, e2, . . . , en} be agenda items. Each agenda A ⊆ E is a vertex of an n-dimensional cube. (0, 0, . . . , 0) is the empty agenda, and (1, 1, . . . , 1) = E everything. Definition: Say that agenda A is a basis if There are no cycles (Henry-Liza loops) in A. Adding any item to agenda A creates a cycle. Theorem: Any two bases of E have the same number of elements. Proof: Exactly the same as the proof used for vector spaces! Definition: The convex hull of the bases of E is the matroid polytope P(E). It is a convex polytope, with vertices the bases.
  13. We can now apply homology to complexity We’re now in

    a realm with extra tools. Think Fourier transorm. The matriod polytope P(E) has vertices, edges, 2-dimensional faces, and so on. Count them. This is the flag vector f (E). We simplify by hiding E, and showing only f (E). We want good complexity measures gi such that: gi (E) is always a non-negative whole number. gi (E) is a linear function of f (E). Homology defines many such gi (X), and proves beautiful and perhaps helpful results about them. Think least squares approx’n. For more information (PhD level pure math hard) start with Hodge theory in combinatorics, Matthew Baker, Bull AMS (2017) . Speaker, work in progress on Linear homology on the Internet .
  14. Summary and conclusions Some of our concepts have deep roots.

    Simplifying complexity is central to good design. Computers might help us. Alexander developed one approach. Homology of matroid polytopes may give another. More work is needed.
  15. Q+A: Answers I wish I gave What if you didn’t

    get all the agenda items? Adding an agenda item only changes things if it’s part of a cycle. And if it is, then you may be in a garbage-IO situation. But the answer might still be helful. What’s you objective function? With a hyerplane, cut the matroid poytope into two. The gives two smaller polytopes and a ‘gasket’. We want a cut such that the two smaller polytopes roughly share equally the complexity, and the gasket has little complexity. (The flag vector (and gi ) are linear functions of the parts.)