In k nearest neighbor density estimation we calculate the density using following formula
For given 1D sample X={4,5,6,7,9,10,11,12,13,14) if k=3, and we do not consider on boundary samples inside the region then density estimation p(X) at X=10 has to be calculated.