# Curse of Dimensionality


```julia
using Plots, SpecialFunctions
```

## 2D bionomial coefficients

This problem can be simplified as choosing M pieces out of 2M total pieces of the path. The selected pieces will form the right directions and others will be upward directions. 

$$
\begin{equation}
\binom{2M}{M} = \frac{2M!}{M! \times M!}
\end{equation}
$$

## 3D problem

This problem can be simplified as choosing $k_1=M$ pieces and $k_2=M$ out of 3M total pieces of the path. The selected pieces will form the directions in each dimension

$$
\begin{equation}
\binom{3M}{M,M} = \frac{3M!}{M! \times M! \times M!}
\end{equation}
$$

## ND problem

This problem can be simplified as choosing $k_1=M$ pieces, $k_2=M$, and $\dots$, etc. out of NM total pieces of the path. The selected pieces will form the directions in each dimension

$$
\begin{equation}
\binom{NM}{k_1=M,k_2=M,\dots,k_{N-1}=M} = \frac{NM!}{M!^N}
\end{equation}
$$

# Visualization


```julia
function npaths(N)
    nom = gamma(N*5+1)
    den = 1
    for n=1:N
        den *= gamma(6)
    end
    nom/den
end

N = 1:10
scatter(N, npaths.(N), yaxis=:log, label=:false, title="Path through lattice of side 5",
    xlabel="Numer of dimention", ylabel="Path count")
```




    

    



## Adjourn


```julia
using Dates
println("mahdiar")
Dates.format(now(), "Y/U/d HH:MM")  
```

    mahdiar





    "2021/April/17 17:05"



c523a127fe3617dce8f3c7b4fffc7439aeb69eec
ipynb
Jupyter Notebook
HW12/3.ipynb
mahdiarsadeghi/NumericalAnalysis
95a0914c06963b0510971388f006a6b2fc0c4ef9
MIT
HW12/3.ipynb
mahdiarsadeghi/NumericalAnalysis
95a0914c06963b0510971388f006a6b2fc0c4ef9
MIT
HW12/3.ipynb
mahdiarsadeghi/NumericalAnalysis
95a0914c06963b0510971388f006a6b2fc0c4ef9
MIT
Qwen/Qwen-72B
1. YES
2. YES