In Mathematica N is the name of a Mathematica function. Using that for a variable name will cause you great problems. Use n instead.
Subscripts in Mathematica are from 1..n+1, not from 0..n. Using 0 as a subscript will cause you great problems.
Study the documentation for RandomReal until you can write a single line of code which will create an example dataset {{xi,yi}}.
Study the documentation for Part until you can write a single line of code which will extract all the {xi} from your example dataset.
Study the documentation for Partition until you can write a single line of code which will extract all the {xi,xi-1} pairs from all your {xi}.
Study the tutorial for DefiningFunctions until you can write a single line function that will do your calculation given a single pair.
Study the documentation for Map until you can write a single line of code that will do the calculation on all pairs.
Use all you have learned to repeat this for your {yi}
Make and keep careful notes about all you have learned doing this because you will use these again and again.
I apologize for the lack of formatting of this, after six tries I simply gave up. If there was a NeverMindJustDeleteMyPost button I would have used it.