# Thread: VB 2010 - Need help

1. ## VB 2010 - Need help

I need to create an application that creates Pascal's triangle
the user would enter the number of rows, and using the formula (which i do not know... :/) would create the triangle. For example: the user enters 5 rows
triangle:
1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
as you can see the numbers are created by adding the 2 numbers above it starting with 1 at the top

2. ## Re: VB 2010 - Need help

In order to make an application, you need to understand the logic of it. I guess you need to go and find out what the formula is first.

3. ## Re: VB 2010 - Need help

you learn it in grade 11 math, which i have next semester...

4. ## Re: VB 2010 - Need help

If you searched this forum for "pascal's triangle", you would've have found this thread:

I wrote some functions to generate the Pascal's triangle not too long ago, and when I saw your question, I knew immediately it has been solved before

5. ## Re: VB 2010 - Need help

thanks man (y)

6. ## Re: VB 2010 - Need help

At the tip of Pascal's Triangle is the number 1, which makes up the zeroth row. The first row (1 & 1) contains two 1's, both formed by adding the two numbers above them to the left and the right, in this case 1 and 0 (all numbers outside the Triangle are 0's). Do the same to create the 2nd row: 0+1=1; 1+1=2; 1+0=1. And the third: 0+1=1; 1+2=3; 2+1=3; 1+0=1. In this way, the rows of the triangle go on infinitly. A number in the triangle can also be found by nCr (n Choose r) where n is the number of the row and r is the element in that row. For example, in row 3, 1 is the zeroth element, 3 is element number 1, the next three is the 2nd element, and the last 1 is the 3rd element. The formula for nCr is:

n!
--------
r!(n-r)!
Does this help?

7. ## Re: VB 2010 - Need help

The formula that creates the triangle is 11 ^ (row number - 1)... isn't it? With a BigInteger you could calculate any row.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•

Featured