Results 1 to 7 of 7
Thread: Pascals Triangle
 12092010, 10:53 PM #1Senior Member
 Join Date
 Oct 2010
 Location
 Newark,nj
 Posts
 111
 Rep Power
 0
 12102010, 01:13 AM #2
Work it out on paper. Pick a number (like 5 or 6), and draw every line of Pascal's Triangle up to that point. Then think about how you determined each line in your head. Think about the criteria you use to determine which numbers would go in which order.
 12102010, 03:48 AM #3Senior Member
 Join Date
 Feb 2010
 Location
 Waterford, Ireland
 Posts
 748
 Rep Power
 6
Or to help out those who do not know post a description of what Pascal's Triangles are...so we can help you programmatically (is that a word :D)
 12102010, 06:37 AM #4
Silly guynever took math!? =) Clicky.
The numbers are based on binomial theorem; it is formulated as such, and procedurally generated by adding adjacent numbers for the row below.
 12102010, 06:10 PM #5Senior Member
 Join Date
 Oct 2010
 Location
 Newark,nj
 Posts
 111
 Rep Power
 0
Hey guys thanks for the responses i've been away so i couldnt reply..UGGHH.. ok so i've wrote a little bit of code but im basically shooting in the dark ..heres what i have so far..Code has some english in it so please dont critique TOO MUCH , im trying.
Java Code:public class Pascal { public static void main(String[] args) { Pascal p=new Pascal(); int row=10; for(int x=0;x<=row;x++){ for(int y=0;y<=x;y++){ System.out.print(p.pascal(x, y)+" "); System.out.println(); } } } int pascal(int x,int y) { if(x=1  x=y  y=0){ } else{ return pascal(x1,y1)+pascal(x1,y); } } } //int x=row; //int y=col;
 12102010, 07:57 PM #6
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,004
 Blog Entries
 7
 Rep Power
 23
Suppose you have the values for n1, say, 1, 3, 3, 1. For the values for row n all you have to do is add all (left) consecutive values from the right: 1, 4, 6, 4 and add another value 1 to the right: 1, 4, 6, 4, 1. For n == 0 you have the value 1 and you don't need to know more.
kind regards,
JosI have the stamina of a seal; I lie on the beach instead of running on it.
 12162010, 01:22 AM #7Senior Member
 Join Date
 Feb 2010
 Location
 Waterford, Ireland
 Posts
 748
 Rep Power
 6
Similar Threads

triangle
By Shyamz1 in forum New To JavaReplies: 4Last Post: 11072010, 07:12 PM 
Triangle using Numbers
By Anandt88 in forum New To JavaReplies: 16Last Post: 06052010, 04:10 PM 
ASCII Triangle
By physics in forum New To JavaReplies: 2Last Post: 03132010, 02:00 AM 
Pascals triangle through recursion
By hedonist in forum New To JavaReplies: 3Last Post: 08032009, 07:45 PM 
Triangle
By jkswebsite in forum New To JavaReplies: 8Last Post: 01102009, 03:08 PM
Bookmarks