Skip to main content
Engineering LibreTexts

9.3: Segregation

  • Page ID
    46651
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    chap09-1.png
    Figure \(\PageIndex{1}\): Schelling’s segregation model with n=100, initial condition (left), after 2 steps (middle), and after 10 steps (right).

    Now let’s see what happens when we run the model. I’ll start with n=100 and p=0.3, and run for 10 steps.

    grid = Schelling(n=100, p=0.3) 
    for i in range(10): 
        grid.step()
    

    Figure \(\PageIndex{1}\) shows the initial configuration (left), the state of the simulation after 2 steps (middle), and the state after 10 steps (right).

    Clusters form almost immediately and grow quickly, until most agents live in highly-segregated neighborhoods.

    As the simulation runs, we can compute the degree of segregation, which is the average, across agents, of the fraction of neighbors who are the same color as the agent:

    np.nanmean(frac_same)

    In Figure \(\PageIndex{1}\), the average fraction of similar neighbors is 50% in the initial configuration, 65% after two steps, and 76% after 10 steps!

    Remember that when p=0.3 the agents would be happy if 3 of 8 neighbors were their own color, but they end up living in neighborhoods where 6 or 7 of their neighbors are their own color, typically.

    chap09-2.png
    Figure \(\PageIndex{2}\): Degree of segregation in Schelling’s model, over time, for a range of p.

    Figure \(\PageIndex{2}\) shows how the degree of segregation increases and where it levels off for several values of p. When p=0.4, the degree of segregation in steady state is about 82%, and a majority of agents have no neighbors with a different color.

    These results are surprising to many people, and they make a striking example of the unpredictable relationship between individual decisions and system behavior.


    This page titled 9.3: Segregation is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Allen B. Downey (Green Tea Press) .

    • Was this article helpful?