flâneur — a map of the web's best reading

combinatorics - The total number of subarrays - Mathematics Stack Exchange

math.stackexchange.com · 2,482 words · saved by 1 readers

I want to count the number of subarrays for a vector (not combinations of elements). Ex. A[1,2,3] It has 6 subarrays : {1}, {2}, {3}, {1,2}, {2,3}, {1,2,3} I think that for a vector of N ele...

combinatorics - The total number of subarrays - Mathematics Stack Exchange Stack Internal Knowledge at work Bring the best of human thought and AI automation together at your work. Explore Stack Internal The total number of subarrays Ask Question Asked 11 years, 4 months ago Modified 8 months ago Viewed 51k times 27 $\begingroup$ I want to count the number of subarrays for a vector (not combinations of elements). Ex. A[1,2,3] It has 6 subarrays : {1}, {2}, {3}, {1,2}, {2,3}, {1,2,3} I think that for a vector of N elements the total number of subarrays is N*(N+1)/2 . I am not able to prove it,

Explore this link on the map →

related reading