Concept explainers
To write the similar program for previous exercise in another language than BASIC.
Explanation of Solution
Given:
Break a stick into three pieces to get the probability that you can join the pieces end-to-end to form a triangle. If the sum of the length of any two pieces is less than or equal to that of the third, a triangle can’t be form. This is known as Triangle Inequality. By an experiment your class can estimate the probability that three pieces of broken stick will form a triangle.
Calculation:
Let D, N, I, X, Y, R, S and T variables used in program. Where D stands for number of sticks you have to break, N stands for first end of stick that is 0, I stands for variable of for loop assign from 1 to D, X and Y are stand for the length of points distance from initial point that is 0, R assigned as X, S assigned as Y − R and T assigned for 1 − R − S. Consider the program below-
The given program in C programming language is
Program:
#include <stdio.h> #include <math.h> #include <conio.h> int main(int argc, char *argv[]) { int D=0; int N=0; int I=1; float X=0, Y=0, R, S, T, P; printf("SIMULATION--BREAKING STICKS TO MAKE TRIANGL...*I); do { // get the random number between 0 and 1; line 70, 80 X = ((float)(rand()%100))/(float)100; Y = ((float)(rand()%100))/(float)100; } while (X>=Y); // if condition for X>=Y // for lines 100-150 R = X; S = Y-R; T = 1-R-S; if (R+S <= T) continue; if (S+T <= R) continue; if (R+T <= S) continue; N = N+1; } P = (float)N/(float)D; printf("\nTHE EXPERIMENTAL PROBABILITY THAT\nA BROKEN STICK CAN FORM A TRIANGLE IS %f\n",P); return 0; }
Sample Output:
SIMULATION--BREAKING STICKS TO MAKE
HOW MANY STICKS DO YOU WANT TO BREAK:100
THE EXPERIMENTAL PROBABILITY THAT
A BROKEN STICK CAN FORM A TRIANGLE IS 0.260000
Output Explanation:
SIMULATION--BREAKING STICKS TO MAKE TRIANGLES
Enter number of sticks as 10 which you want to break that is value of variable D
HOW MANY STICKS DO YOU WANT TO BREAK:100
THE EXPERIMENTAL PROBABILITY THAT
Then you get the experimental probability equal to 0.260000 that is P=0.260000
A BROKEN STICK CAN FORM A TRIANGLE IS 0.260000
Chapter 6 Solutions
McDougal Littell Jurgensen Geometry: Student Edition Geometry
Additional Math Textbook Solutions
Calculus: Early Transcendentals (2nd Edition)
Algebra and Trigonometry (6th Edition)
Pre-Algebra Student Edition
Elementary Statistics
University Calculus: Early Transcendentals (4th Edition)
Basic Business Statistics, Student Value Edition
- What is a? And b?arrow_forwardMinistry of Higher Education & Scientific Research Babylon University College of Engineering - Al musayab Automobile Department Subject :Engineering Analysis Time: 2 hour Date:27-11-2022 کورس اول تحليلات تعمیر ) 1st month exam / 1st semester (2022-2023)/11/27 Note: Answer all questions,all questions have same degree. Q1/: Find the following for three only. 1- 4s C-1 (+2-3)2 (219) 3.0 (6+1)) (+3+5) (82+28-3),2- ,3- 2-1 4- Q2/:Determine the Laplace transform of the function t sint. Q3/: Find the Laplace transform of 1, 0≤t<2, -2t+1, 2≤t<3, f(t) = 3t, t-1, 3≤t 5, t≥ 5 Q4: Find the Fourier series corresponding to the function 0 -5arrow_forward3. Construct a triangle in the Poincare plane with all sides equal to ln(2). (Hint: Use the fact that, the circle with center (0,a) and radius ln(r), r>1 in the Poincaré plane is equal to the point set { (x,y) : x^2+(y-1/2(r+1/r)a)^2=1/4(r-1/r)^2a^2 }arrow_forwardn. g. = neutral geometry <ABC = angle ABC \leq = less or equal than sqrt{x} = square root of x cLr = the line in the Poincaré plane defined by the equation (x-c)^2+y^2=r^2 1. Find the bisector of the angle <ABC in the Poincaré plane, where A=(0,5), B=(0,3) and C=(2,\sqrt{21})arrow_forward2. Let l=2L\sqrt{5} and P=(1,2) in the Poincaré plane. Find the uniqe line l' through P such that l' is orthogonal to l.arrow_forwardLet A, B and C be three points in neutral geometry, lying on a circle with center D. If D is in the interior of the triangle ABC, then show that m(<ABC) \leq 1/2m(<ADC).arrow_forwardиз Review the deck below and determine its total square footage (add its deck and backsplash square footage together to get the result). Type your answer in the entry box and click Submit. 126 1/2" 5" backsplash A 158" CL 79" B 26" Type your answer here.arrow_forwardIn the graph below triangle I'J'K' is the image of triangle UK after a dilation. 104Y 9 CO 8 7 6 5 I 4 3 2 J -10 -9 -8 -7 -6 -5 -4 -3 -21 1 2 3 4 5 6 7 8 9 10 2 K -3 -4 K' 5 -6 What is the center of dilation? (0.0) (-5. 2) (-8. 11 (9.-3) 6- 10arrow_forwardSelect all that apply. 104 8 6 4 2 U U' -10 -8 -6 4 -2 2 4 6 10 -2 V' W' -4 -6 -8 -10 W V Select 2 correct answerts! The side lengths are equal in measure. The scale factor is 1/5. The figure has been enlarged in size. The center of dilation is (0.0) 8 10 Xarrow_forwardIn the graph below triangle I'J'K' is the image of triangle UK after a dilation. 104Y 9 CO 8 7 6 5 I 4 3 2 J -10 -9 -8 -7 -6 -5 -4 -3 -21 1 2 3 4 5 6 7 8 9 10 2 K -3 -4 K' 5 -6 What is the center of dilation? (0.0) (-5. 2) (-8. 11 (9.-3) 6- 10arrow_forwardQll consider the problem -abu+bou+cu=f., u=0 ondor I prove atu, ul conts. @ if Blu,v) = (b. 14, U) + ((4,0) prove that B244) = ((c- — ob)4;4) ③if c±vbo prove that acuius v. elliptic.arrow_forwardQ3: Define the linear functional J: H₁(2) R by ¡(v) = a(v, v) - L(v) Л Let u be the unique weak solution to a(u,v) = L(v) in H(2) and suppose that a(...) is a symmetric bilinear form on H(2) prove that 1- u is minimizer. 2- u is unique. 3- The minimizer J(u) can be rewritten under 1(u) = u Au-ub, algebraic form 1 2 Where A, b are repictively the stiffence matrix and the load vector Q4: A) Answer 1- show that the solution to -Au = f in A, u = 0 on a satisfies the stability Vullfll and show that ||V(u u)||||||2 - ||vu||2 2- Prove that Where lu-ul Chuz - !ull = a(u, u) = Vu. Vu dx + fu. uds B) Consider the bilinea forta Л a(u, v) = (Au, Av) (Vu, Vv + (Vu, v) + (u,v) Show that a(u, v) continues and V- elliptic on H(2)arrow_forwardarrow_back_iosSEE MORE QUESTIONSarrow_forward_ios
- Elementary Geometry For College Students, 7eGeometryISBN:9781337614085Author:Alexander, Daniel C.; Koeberlein, Geralyn M.Publisher:Cengage,Elementary Geometry for College StudentsGeometryISBN:9781285195698Author:Daniel C. Alexander, Geralyn M. KoeberleinPublisher:Cengage Learning