T[x_, a_] :=N[ Mod[x+a, 2 Pi]]

?NestList
orbita[x0_, a_, n_] := NestList[T[#, a]&,x0, n]

orbita[0, 1/2, 10]

?Map

Map[Sin, orbita[0, 1/2, 10]]

Total[Map[Sin, orbita[0, 1/2, 100000]]]/100000*2 Pi

Calka[x0_,a_, n_, funk_] := Total[Map[funk, orbita[x0, a, n]]]/n*2 Pi

funkcja[x_]:=Cos[x]^2
Calka[0, 1/2, 100000, funkcja]

?WeightedAdjacencyGraph

A:={{1/2, ∞, 1/2, ∞, 1}, {1/4, ∞, ∞, ∞, ∞},{1/4, 1, ∞, ∞, ∞} ,{∞, ∞, 1/2, 1, ∞}, {∞, ∞, ∞, ∞, ∞}}

WeightedAdjacencyGraph[ Table[(Subscript[v, i]), {i,5}], Transpose[A], VertexLabels -> "Name", EdgeLabels -> "EdgeWeight"]

MatrixForm[A /.{∞->0}]

A:={{1/2, ∞, 1/2}, {1/4, ∞, 1/4},{1/4, 1, 1/4} }

WeightedAdjacencyGraph[ Table[(Subscript[v, i]), {i,3}], Transpose[A], VertexLabels -> "Name", EdgeLabels -> "EdgeWeight"]

Zad. 3

?Eigensystem

Eigensystem[A /. {∞ -> 0}]

Re[Eigensystem[A /. {∞ -> 0}]]

Re[Eigensystem[A /. {∞ -> 0}]][[2]][[1]]

Rozklad stacjonarny

Re[Eigensystem[A /. {∞ -> 0}]][[2]][[1]]/Total[Re[Eigensystem[A /. {∞ -> 0}]][[2]][[1]]]

GraphicsGrid[{{Style["kot:1/2 ser:1/2", 24], Style["kot:2/3 ser:1/3", 24],
Style["kot:1 ser:0", 24]},
{Style["kot:1/3 ser:2/3", 24], Style["kot:1/2 ser:1/2", 24],
Style["kot:2/3 ser:1/3", 24]},
{Style["kot:0 ser:1", 24], Style["kot:1/3 ser:2/3", 24],
Style["kot:1/2 ser:1/2", 24]}}, Frame->All, ImageSize -> 500
]