![hobbs4ever1](/avatars/32111.jpg)
hobbs4ever1
25.10.2019 •
Mathematics
What is the first term when applying binomial theorem
Solved
Show answers
More tips
- H Health and Medicine How to Whiten Teeth and Get the Perfect Smile...
- S Style and Beauty How to Properly Apply Eye Makeup: Tips from a Professional Makeup Artist...
- A Auto and Moto How Can Parking Sensors Help Drivers?...
- C Computers and Internet Make Money Online: Secrets and Essential Ways...
- A Auto and Moto What is the Average Lifespan of an Engine in a Car?...
- H Health and Medicine What You Need to Know About Nasal Congestion in Infants: Causes, Symptoms, and Treatment...
- S Science and Technology Discovering the Anatomy of an LCD TV Screen...
- F Food and Cooking How to Get Reconfirmation of Registration?...
- F Food and Cooking Why Doesn t the Confirmation Link Come to Email?...
- F Food and Cooking Deflope: What is it and how does it work?...
Answers on questions: Mathematics
- M Mathematics DJ Ali is making a playlist for a friend; she is trying to decide what 99 songs to play and in what order they should be played. If she has her choices narrowed down to 1616...
- M Mathematics Which of the following sets is a subspace of set of prime numbers P Subscript nℙn for an appropriate value of n? A. All polynomials of the form p(t)equals=aplus+bt squaredt2,...
- M Mathematics What number when added to 1 1/3 gives 2?...
- M Mathematics Determine the coordinates of the point that divides directed line segment BA into the ratio 1/3...
- S Spanish Derivation of mayer s formula...
Ответ:
1
Step-by-step explanation:
Binomial theorem is describing the expansion of powers of the term (a + b)^n
Obviously if n = 0, a + b = 1
So the first term is 1.
Ответ:
/ Sierpinski.java
public class Sierpinski {
// method to find the height of an equilateral triangle with side length =
// length
public static double height(double length) {
// formula= length*sqrt(3)/2
double h = (length * Math.sqrt(3)) / 2.0;
return h;
}
// method to draw a filled triangle (pointed downwards) with bottom vertex
// x,y
public static void filledTriangle(double x, double y, double length) {
// finding height
double h = height(length);
// filling triangle as a polygon
// passing x, x-length/2, x+length/2 as x coordinates
// and y, y+h, y+h as y coordinates
StdDraw.filledPolygon(new double[] { x, x - (length / 2.0),
x + (length / 2.0) }, new double[] { y, y + h, y + h });
}
// method to draw an n level sierpinski triangle
public static void sierpinski(int n, double x, double y, double length) {
// checking if n is above 0 (base condition)
if (n > 0) {
// drawing a filled triangle with x, y as bottom coordinate, length
// as side length
filledTriangle(x, y, length);
// drawing the triangle(s) on the top
sierpinski(n - 1, x, y + height(length), length / 2);
// drawing the triangle(s) on the left side
sierpinski(n - 1, x - (length / 2.0), y, length / 2);
// drawing the triangle(s) on the right side
sierpinski(n - 1, x + (length / 2.0), y, length / 2);
}
}
public static void main(String[] args) {
// parsing first command line argument as integer, if you dont provide
// the value while running the program, this program will cause
// exception.
int n = Integer.parseInt(args[0]);
// length of the outline triangle
double length = 1;
// finding height
double h = height(length);
// drawing a triangle (pointed upwards) to represent the outline.
StdDraw.polygon(new double[] { 0, length / 2, length }, new double[] {
0, h, 0 });
// drawing n level sierpinski triangle(s) with length / 2, 0 as x,y
// coordinates and length / 2 as initial side length
sierpinski(n, length / 2, 0, length / 2);
}
}