Problem 49840. Our Dad went to Buy a car But the car seller can't think the easiest way to get the car out Give Him a solution!
This is the car sale and the cars are arranged according to the pascal's Traingle.
1 0 0 0 0
1 1 0 0 0
1 2 1 0 0
1 3 3 1 0
1 4 6 4 1
Pattern like this so the car number is given like
n=10;
So,you have to create a pascal's traingle and add the numbers and you have to add like this:-
1 0 0 0 0
1 1 0 0 0
1 2 1 0 0
1 3 3 1 0
1 4 6 4 1
%You have to add the numbers on the traingle except the 0 and you will get a matrix like:-
1 0 0 0 0
2 3 0 0 0
4 6 7 0 0
8 11 14 15 0
16 20 26 30 31
So the number of the vehicle is given accoring to only positive numbers not 0 (Don't recognize zero when counting the vehical number!)
Following functions are not allowed!:-every function except eye,find,size
You have to output the pascal's traingle number you summed up on that particular row and column like
%if I asked
%input
n=10;
%Output Should be:-
y=15;
Wishing You luck!
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers5
Suggested Problems
-
1553 Solvers
-
478 Solvers
-
Replace multiples of 5 with NaN
440 Solvers
-
MATCH THE STRINGS (2 CHAR) very easy
286 Solvers
-
Element by element multiplication of two vectors
373 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!