Jump to content

finding general formula


mpsn

Recommended Posts

Hi, for my assignment, I need to figure out how many possible paths through a bubblesort,

 

Let n be the size of the array

 

so my results are:

if n = 0, 2^0 paths

if n = 1, 2^1 paths

if n = 2, 2^3 paths

if n = 3, 2^6 paths

if n = 4, 2^10 paths

 

so I need to figure out a summation/product notation formula for the exponent, for a given size n so I mean 2^(some formula involving summation or multiplication notation)

 

Any help appreciated

Link to comment
https://forums.phpfreaks.com/topic/257850-finding-general-formula/
Share on other sites

  Quote

Wait, actually I need to have a summation and/or product notation used, b/c yours is simply:

 

2^[n(n+1)/2], but I need 2^(summation from start to n for some formula) for instance.

 

The n(n+1)/2 is the value for the sum of numbers from 1 to n, so you're just looking for:

 

gif.latex?\LARGE%202^{\sum_{i=1}^{n}i}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.