### Homology Groups

Homology groups arise in Algebraic Topology, and are used to express - in some strange sense - how many holes an object has in it; they provide a number (called the genus) which does not change no matter how you (continuously) stretch and distort the object. You may have heard it said, for example, that a doughnut is 'topologically equivalent' to a coffee cup (one which has a handle). What this statement really means is that their homology groups are isomorphic.
As with many ideas in pure mathematics, the notion of homology groups started with an intuitively pleasant concept which was then formalised, abstracted and reformulated in such a way as to disguise its imperfect origins. Not being a person to tolerate this kind of nonsense, I'll start with the simple and intiutive case, and then show how it is generalised.

### Homology in 2D

Suppose you have some smooth surface (implictily two dimensional), which for reasons of topological pleasantness should be compact. We'll be considering classes of closed loops on the surface, in a similar manner to the fundamental group. Of course, this class will be rather large, and so in a similar manner to introducing homotopy in the fundamental group, we need some way in which two loops are 'homologous' (and then we can consider all such to be the same thing).
Consider the following picture:
```
.;---=+xxxxx+===-----,.,,.
,x##############################################;
-X##########-     ,;.   -Xx                    ;x##########=                                               . ..
.=#########+,         .x=         =#-                         .=#########;                                      ############x
=X#######x         ..,,;,,=###;.,,.;,,. .##=          #####X-             -#######+.                               .###,      -X###+
=#######-.       ..,,,,,,,,,,.,x##=..,,,,,,,. ,##+        #########X                =######,                           -##+           -#;
X#####+       ..,,,;;,,,,,,,,,,;,.,+X+ .,,,;,,,,,.  ##=       -#      ###+                  ,######X.                      -##
-#####=.    .,,.,,,,,,,,,,,,,,,,,,,,,.-### ,,,,,,;,,,,, -XX,      ##+     ;##=                      =#####X                    ;##
.#####+     .,;,,,,;,,,,,;.,,,,,,,,,,,,,,...,# ,,,,,;,,;,,, =X##      ##-     x##;                           #####;                 =#######x;
+####.     ,,,,,,,,,,,,,,,,,,;,,,,,,,,,,,,;,,.  , .,;;,,,,,,.  #####     ##,  =+###;                              +#####,                ;##########
+####-   ..,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,#...,,,,,,.  ;###X+#=    ##X######                                    ####,                      +###+
=###     ,,,;,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,.;+#x;,,,;,,  ;##, ;#=#+    ##-;=+-X##x                                    x###+                       ###.
;###.  .,,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,.;-#+,..,,; ,##-   =#=x#,   ##.     =##-                                     ,####      .###            ##+
-##=  ,,,,,,,,,,;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,##-..,,, ##+ ., =#=.##;  ##+     ###,                                       .####     =###x          ##+
-##= .,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,.##X-,,;,.=; .,. =#= x##- =#########=                                          -###=     ,####X+x#######
###   ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,. .x....;,...,;. +##.  x##.   x###+                                               ;###.      ########=.
x##  ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,. .   .,,;,,,. ,##-                                                                X##=
###  ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,,,.X#x;  ..,,. .##=                                                                  +##;
X##  ;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,.=####,  .   ##                                                                     ###,
##x. ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.  =X##+.  -XX                                                                      ,X##
##, .;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,    .,,,,,,,,,,,,.     ,X####################x-                                                        .##X
-#x  ,,,,..      .,,,,,,,;,,,,,,,,,,,,,,,,,,, #x, ,,;,,,,,,.    ##########+;,,,,,,,;-x#########-           .#=                                       ,##+
##  .;,,    .,..    .,,,;,,,,,,,,,,,,,,,,,,,, ##X  ;,,,,;.  ;####x.                         ,X####X,       +##.                                        ##x
;#+ .;,,..+########X, .,,,,,,,,,,,,,,,,,,,,,,,  ##=  .,,.  ;###+                                 x#####,    ##x                                          ##=
##=..,,, =###, .,=###-,.,,,,,,,,,,,,,,,,,,,,,,, ,X##     -###.                                       x###- +##.                                          +##-
##. .,,. X##x     .##-,,,,,,,,,,,,,,,,,,,,,,,,,.  =###=,=##                                            .+X###                                            -##x
,##.  ,, ;###x  .-####,,.,,,,,,,,,,,,,,,,,,,,,,;,,   ;####+                                             -###+                                              ###,
;##+ .;, .##X+X####X=  .,,,,,,,,,,,,,,,,,,,,,,,,,,,;.   ;####x.                                       +###;                                                ;##;
.##  ,,. x#######X;    .,,,,,,,,,,,,,,,,,,,,,,,;;,,,,.    ,=####-                                 ;####,                                                  ,##-
+#  .,. +##; ,-X####=.  .,,,,,,,,,,,,,,,,,,,,;,,,,;,,,,,.   .X#########X-                      ####x                                                     ;##;
+#+. ,, x##=     .+####=..,,,,,,,,,,,,,,,,,,,,,;,,,,,,,,,,,.     .;+#############################;                                                       ;##-
.##. ,, x##+ ,...   ;###+.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;;..         ,  =####+--+xxXXXxx+;        X#+                                               =##+
##+  , ,--. ,,,,,,.  ., .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,;;, ,x##+    ,X#=                  =####x                                             ###
,###  ,.  ..;,,,,,.,....,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,; =##x; .,.    ##x               .##x-###                                           X##;
;##x  ,,,,,;,,,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,, x#X, ,.,;,,,  x##=             x#X   ###,                                         ##+.
,###  .,;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,  .  .,,;,,,,,.  x##           -##     ;##x                                       =##
###   .,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,.... .,,,,,,,,,,,, .+##,         ##,    ,=X###                                      x#+
##X  .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-X#..,,,,,,,,,,,,,  .##-       +##############                                     ##=
###= .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..=##-;,,,,,,,,,,,;,,,  ##+     x##           ###;                                  -##
X##,  .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..-##;,.,,,,,,,,,,,,,,. +##+   -###            ;#.                                 =##,
=###.   .,,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;+##-;,,,,,,,,,,,,,,  #####X  ,X#                                              ;####,
+###+    .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,..=, .,,;,,;,,;,,,  .##X#x=##                                                ,####,
#####    .,,,,;,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....,,,;,;.,;;,,  .##= ;Xx ,##=                                            X###+
x###x,   ,,,,;.;;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.   ,;;,,;,,,. .##x   =##  ,##=                                        .####,
.+####,  .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-+   ,,,,;,,;##x. .. X#x   =###                                    =#####,
+###-  .,;;;,,;,,,,,,,,,,,,,;,,,,,,,,,,,,,,,-X##=.,,,;,,,..   ,,  #x.    ;X#.                                =####x
+###-       ..,,,,,,,,,,;.,,,,,,,;;,,,,,,,;=##= ,,,,;,,,,,,,,. ##+.                                     ;#####=
+######=..     ..;;,,.;,,,,;.;,,,,;,,,.. ##=..,,,,,;;,,,,. ,#+                                   .#####x
X#########,             . ,,;,;;;,,,,.,.     .;;;,,,. .=#x                               .-x#####=
+########X+-,.,..                 +##=    ;,,  =##                         -###########-
;-x################+           ;X##;     -#+              ;=+#############x=,
.;X################+#########x-.==++###############X=;.
;xxx++xxxxxX#######x,

```
Note that loops A and B above together form the boundary of region R, which is a two dimensional subset of the surface S. A and B have arrows on them, which define some choice of orientation, and write -B for the loops with the opposite orientation. We write the boundary of R as A-B, that is the loop formed by joining A with -B. The choice of the sign here is necessary for a consistent definition of the boundary: note that if we kept expanding R to fill all of S, then A and -B would meet, and then cancel with this choice of sign. It's worth pointing out too that R can also have an orientation - corresponding to whether its surface normal vectors are pointing 'inwards' or 'outwards'. Reversing the orientation of C reverses the orientation of its boundary.
So let's say that (orietnted) loops A and B are homologous if there is some subsurface R of S such that A-B is its boundary (and we write d(R) = A-B ). Being homologous is an equivalence relation, and see how use of the minus sign ensures that the relation is transitive (ie. dR = A-B and dT = B-C implies that A-C = d(R+T); the boundary operation d is linear). Notice that being homologous is a simpler concept than being contactable:
```
;+#####################x+;.
+########-                ;+##########.
,#####X.                              .+#####x
#####=                                       x####+
####+                                              .#####
####;                                                   .####
###                                                         ###x
=##+                                                           X##
X###,                                                            ###
x###                                                               .##=
.x####                               ;X##############     ##+           ##X
####=                              +########XXXXXX#######,-##+           +##
.=###################+-.                                             -####X        X#X                   -####-                 x#####.            ##;
.X########+;.    .,;---=xx###########;                                +########          ###           ..    =###+                      =##.             X#=
=#####=                           .=x#####x                          =######x=.            ##x          -###+ -##=                      ,##X               ##x
x###.      ........,,,,,,,,,,,,,....       x####-               ;########-   .,-X###x        X#=            -#####,                      ###=               -##
+###   .,,.           .,,,,,,,,,,,,,,,;,,;,.    +#####x-----=x#######x;  -=  .       =##x.     ##x               -####-                  x###                 =##
###,  .,,,  ;+########- ,,,,,,,,,,,,,,,,,;,;,,,.    -############;       +#- ,,,;,,,,.  =##=    ############.        X######################                   =##
,##X  .,;,;.,X####x+=x##X ,,,,,,,,,,,,,,,,.;,,,,,,,,.                .,,,.=#X ,,,,,,,,,;  +X###;                           =##############=                      =##
;##X. ,,,;,,..-##;     X#x ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,...  ;,;,,,,,,, =#++X###x                                                              ,##+
##;  .,,,,,,..;##-,++X###+ ;,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,....,,,,,,,.  #X;-x; +###+                                                           ###
x##  .,,,,,,,,..-########+.  ,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.;-; ,,,,,;,.=#X  -#-    ,                                                          x##-
;##  .,,,,,,,,,. ;##x#X     .,.,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,-##x ;,,,,,.#+  .x#=                                                             x##X
X#X ,,,,,,,,,,,..x##,=###X;.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,  ;+ ,,..,..    +#x                                                            ,###-
##  ,,,,,,,,,,,.+##+   x##X,,,,,..........,,,,,;.;,,,,,;,;,;,,,,,,,,,,,,,,,;,,,,...,.        ;xx.                                                            ###-
## .,;,,,,,,,,,.,==. .  ...                  .,,,,;;;;,,,,,,,,,,,,,,,,,,,,,,;,,,,.   .x#########X######X++=;,                                              ;###.
## ,;.,,,,,,,,,.   .,,,.     -#############+,    .    .,,,,;,,,,,,,,,,,,,,,,,     -##################################x,                                  X###=
#X ,,;,,,,,;,; ..  ,..   -#####=,.     .-#######   X#X ,;,,,,,,,,,,,,,,,,,.   ,X####.                            ,+##########x=-                     =#####.
,#+ ,,,,,,,,,,, ###     ####x                 .#######= ,,,,,,,,,,,,,,,,,,  =#####+                                      +ALL#YOUR#BASE#ARE#BELONG#TO#US#-
,#+ ,,,,,,,,,,, =#### ;##X                        ###+ .,;,,,,,,;,;,,;;,.  X##+                                                    .=x###############-
,#x ,,,,,,,,;,,. .#####X                         ,##+  ,,,,;,,;,,,,,,,.  .##=
.## ,,,,,,;,.;,,.   .-##,                      ####.  ,,,;,,,,,,,,,,,,  X##+
## ,;,,,,,;,,,,,,.    #####-               x####   .,,;,,,,,,,,;,,,,  X##
## ;,,;;,,,,,,,,,,,,,   ,########x=----######,   .,,,,,,,,,;,,,,,,,, -##.
## ..,,,,,,,,,,,,,,,,,,.    .;+##########=.   .,,,,,,,,,,,,,,,,;;,,  ##X
=#+ ,,,,,,,,,,,,,,,,,,,,,,..               .,,;,,,,,,,,,,,,,,,,,,;  ###
.##  .,,,,,,,,,,,,,,,,,,,,,,,;,,;;,,,,,,;,,,,,,,;,,,,,,,,,,,,,,;,. ###.
=##  .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,  ##;
x##. .,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,,,,,,,,,;,,,,,,,,,,,,,  ##x
###.  .,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.  =##
###+  .;.;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,;,,.  ###.
###-  .,,,;,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,.  -###
.###,  .,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,    ,###=
X###,     ...,,,,,,,,,,,,,,,,,,,,,,,,,;,,,..     +####
.#####=          ....,,,,,,,,,,,,,,,,..    =#####;
=##########x-.                      =######
=###############################-

```
See that this loop is homologous to zero, but is not contractable (ie. corresponds to no identity element of a fundemental group of this surface).

Now we're approaching a position for defining some kind of a group. Firstly notice that since we've been dealing not just with closed loops but also with various integrer valued sums of them, denote Z(S) to be all Z-linear combinations of loops on the surface (eg. allowing things such as A+27B-C and soforth), which a group under addition. There is a subgroup of this which consists of all those paths homologous to zero - we'll call this B(S). Seeing as then we're only interested in the homology classes, we can from the quotient group

H(s) = Z(S)/B(S)
which is the (first) homology group of the surface S. While Z and B are large groups, this quoitent is something more manageable. Typically, H comes out to be Zsome power, where the power is an even number equal to twice the number of holes in the surface (you could draw some pictures to convince yourself of this).

### Homology Groups in General

In greater generality, we wish to study the homologies of objects of higher dimensions. Instead of considering (1D) closed loops in a (2D) surface, we'll look at i dimensional boundary-free submanifolds of a n dimensional manifold (of which these are a special case).
Defining the notion of a boundary in this kind of generality is slighly tricky, so we'll approximate objects wire frame style by oriented simplicies composing a simplicial complex. (There are excellent write ups for these last two terms, so I shalln't explain what they mean here. Note that the condition of compactness that I mentioned above is what is required to ensure that your object can decomposed in this manner.) First I need to explain what its means for a simplex to be oriented:

# Oriented simplicies

Writing a simplex as [ x0,x1,...,xn ], define its orientation as a choice of ordering of the verticies x0,x1,...,xn up to parity (meaning that if two orderings are related by an even permutation, then they are considered the same). If T denoted an oriented simplex, let -T be the same simplex with the opposing choice of orientation.
Given some simplex, remeber that a face of the simplex is some lower dimensional simplex formed by ommitting some number of its verticies. If you have an oriented simplex, then its choice of orientation natrually determines the choice of orientation of its faces in the following way: removing vertex xi from the simplex [ x0,x1,...,xn ] yields the oriented face
(-1)i [ x0,...,xi-1,xi+1,...,xn ]
Next before defining the boundary operation, we need to find a way of composing the i dimensional submanifolds out of simplicies. This is done using chains:
Definition: The kth chain space of a simplicial complex S is the abelian free group generated by all the oriented k-simplicies withing the complex, and is denoted Ck(S).
which is just a poncey way of saying that Ck(S) is formed from Z-linear combinations of k dimensional simplicies. There is also the technical requiredment that (-1)*T = -T : that is, that these linear combinations recognise the orientations of the simplicies. Note that this isn't the corresponding object to Z(S) above, since we've not specified that the 'chains' are boundary free.
Now, at last:

# Boundaries

The boundary of an oriented simplex [ x0,x1,...,xn ] is
(sum over i=0 to n) (-1)i [ x0,...,xi-1,xi+1,...,xn ]
ie. the sum of its oriented faces in Cn-1(S). The boundary operator, which I'll call d, is then just extended linearly over the chain space Cn(S). An improtent property that this operator must have is that d^2 = 0; the boundary of any boundary is zero:
d2 [ x0,x1,...,xn ]
= d (sum over i) (-1)i [ x0,...,xi-1,xi+1,...,xn ]
= (sum over i and j, j!=i) (-1)i(-1)j [ x0,...,xi-1,xi+1,...,xj-1,xj+1,...,xn ] + (-1)i(-1)j-1 [ x0,...,xj-1,xj+1,...,xi-1,xi+1,...,xn ]
= 0
Then define
Zi = Ker(d: Ci(S) - > Ci-1(S))
(meaning things with no boundaries) and
Bi = Ker(d: Ci+1(S) - > Ci(S))
(meaning things which are boundaries), and we have that B is a subgroup of Z is a subgroup of C.

# Homology groups

Definition The ith homology group of a simplicial complex S is Hi(S) = Zi(S)/Bi(S)

### What they mean

H1(S) is the same thing as H defined earlier. As for H0(S), it counts the number of path connected components of a complex (since points on the complex are not boundaries, but are joined by polygonal paths). For a compact simply connected surface of genus g,
```
....................
,...    ;,..   +#####=,-##############################=
.,;-==-,.;;-+#######x ######x,,######- +#####-                              +#+
;+####################Xxx###########################+,                                                         -#+
##############################XXXX,      -##;                                                                   =#+
;#x                   ;##.                ,##,                                                                  ;###
#=                    x#;                -##x                                                        -#######= ;###
=##+                   .##x,               ;###-       .--      ;                                  ;x##########, -###  -#####,
.x##                     ##-                ;x##;    X#####+   =####-                             .####=           .#-   -X#######-
=, .x#X                -;  .##;                .=##  #####+         =#x;   X=.                    ,######-             #=         =######           ..
=####### ,### -x-        -#####= ;##,;##+             -## .##x                  ,####=                 ####-                +#+            ;#####=
.x######x;    ##X =###.   ;######.   .##- +###.           -##                          x##x.               ###                  =#+                #####
####=         .X##   x#######+         ##    +###x         -##,                          .#   -x#         =##x                   =#+                  ;####x
+###,           ,X##     ;+x=.           +#;     X##########+=##x                               x#####x +#####=                    =#+                     ####;
X###               -##                    .##=         .;;-,;,  -##.                                .=##x  -;,                       =#+                       x###+
+###.                -##                     x#,       ,          ,##=                                                                .###                        ,###;
;##;                  -##                    .X#=,    ,###         X##+                                                                -###                         ;###
##x                   =#X           ;###, ,##########X###          ;##-                                                                .##+          +               ###
,##                    =#-            .X#####X;X##,  ,x##=           =#X                                                         ;#####..##x ,X#-    +##+             x##,
.##                   .x#,              ;###=   #     x##,           x#+                                  -##;                 -######- .##+ ,#####x ##x.             x##-
,#x               ,#########+    X##.     ####,      X##+            ##X  ;+; ;##+                 =x##X= x##+         x##=  ,###+       x##     ===x##.              ###-
;#=             =###++###;##### x##x       .+##########,             ###  ###,x##x      X##.   ;#############=          ;##-;x#x         X##.      ,##,               X##-
;#+      .X#X  ####  =##-   .######            .+##x;            ##+ +##;     ###,      =###  ###X;      .###;            #####          x##.    .####                ###=
;#+       ###=;##.   ###=     +###+                       ..   ;###-  .##=   ###.        -###,##,        ###;              =####-               .###=                .###,
;#=        +####=            ,##.                        =###,.##=     =-   =##;           x###       ;###x                   X######X+=-,..;=x###x                  -##;
-#+         =####-          ,##+                          .######           ##x.            +############                        ,x##############                    x#x
;##           .x###############                              ####x+,      ;###;               x########-                                                             ##.
##;               ,-====--;                                   ,#############                                                                                       -##
##=                                                                 -xx+-                                                                                         .X##
;##.                                                                                                                                                              +##-
###.                                                                                                        xXx+,                                               -##+
###;                                                                                                      ;#########-                                         .###
,###+                                      =#######-                 +######x.                    .####.         X##-                                         ###;
+###,                                 =#############;           .############-                 ####x                 .###+                                -##X
+###=                             ,####        =###=         +###        =###=                                      x####x,                         ,X####-
X####=                       ;####X            ;#############;           ####=      .=###x                           ,######-                 ,######x,
.X######=;             -x#####x      .##-       #########=    +#x       ;#####+;+#####+                               .x#######################x
.+######################,         +##x                    ;###          .##;                                              ,-=,,,-=======-
.;--------;,               -##=                    ;X##
-##=                    ,X##                                                               ###;
.,;                        =##=                    ,X##                                                               ###;
###+               ,x#-    ;##=    ;x=             .x##                                                               ##X,      ;#+.
x##=                =####;  ##-   ####       ,##-   X##     -          ,###x    ####     .###x              =####,    X#X,     X##x.
+;     x##=                  ,###x ##. .###-        ;####  x#x   -##;          x#+.    =###     .###;                .####,  +#X.    +##;
,####-  +##-   ;###-             #####+x##;             ;#####- +###X                                                    =###xx#x.  X##x
-###= -##   +###.               =######                 ########+                                                        X####+  ####
,######.;###;                   X##-     .,.            X###-  .######X                                                  .#######.    .,,
-#######+    +##x                   #######-                x####X###x                                                   -###=    ###### .
;x##=      ###=                .####;  ###.             .###;     ##.                                                          x##.   ###-
x##;              .###X     +##,             .###.   .x#-                                                           X#,    ###=
+##;               =#-      ###;                   #######X=                                                        ##;    ####=
x##-                      ,###X                    .+#######+                                                       +###########.
###-                  ,####+                    +#        +##                                                         -##### .##X
.###.               .+######+,.                 =##;      -###                                                                 x##
,#############;            ;############+                                                x############;   +##
.-                 ,,,;;,.                                                  ;###=,,,,;;=+#####=x##
##X             X#####
+#+                 ,;,

```
H0 = Z, H1 = Z2g, H2 = Z (which means that the surface is orientable), and the higher homology groups are all trivial.