Question

Write python or java or c programs to simulate the problems and display the output in...

Write python or java or c programs to simulate the problems and display the output in a graphical form, with the following simplifications:

5) The triangle has one corner at the origin, one at (1,0), and one at (x,1), repeating the program for x = 0, 1/2, 1.

Problem 5. Consider a triangle and a point chosen within the triangle according to the uniform probability law. Let X be the distance from the point to the base of the triangle. Given the height of the triangle, find the CDF and the PDF of X.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

5) The triangle has one corner at the origin, one at (1,0), and one at (x,1), repeating the program for x = 0, 1/2, 1.

ans:-

In python we can plot all three triangle with following code:

import matplotlib.pyplot as plt

plt.plot([0,1,0,0], [0,0,1,0])

plt.plot([0,1,0.5,0],[0,0,1,0])

plt.plot([0,1,1,0],[0,0,1,0])

plt.show()

5. Consider a triangle and a point chosen within the triangle according to the uniform probability law. Let X be the distance from the point to the base of the triangle. Given the height of the triangle, find the CDF and the PDF of X.

ans:-

we have to find the CDF and PDF of t. Consider a triangle and a point chosen with in the triangle. according to the uniform Pf (x) = 1 (n- for XE [o, n] for 24 [o,h] i fu (x) 20 So fx (x)= {1 - Chypre xe [o h] o u¢ [o, h] Thus the CDF of x is : P(x2x

If u have any doubt please ask me.

Add a comment
Know the answer?
Add Answer to:
Write python or java or c programs to simulate the problems and display the output in...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Write short programs to simulate problem 16 and 22. For problem 22, use k=5, m=10, n=5....

    Write short programs to simulate problem 16 and 22. For problem 22, use k=5, m=10, n=5. In Python Problem 16 We are given three coins: one has heads in both faces, the second has tails in both faces, and the third has a head in one face and a tail in the other. We choose a coin at random, toss it, and the result is heads. What is the probability that the opposite face is tails? Problem 22 Each of...

  • PYTHON:please display code in python Part 1: Determining the Values for a Sine Function Write a...

    PYTHON:please display code in python Part 1: Determining the Values for a Sine Function Write a Python program that displays and describes the equation for plotting the sine function, then prompts the user for the values A, B, C and D to be used in the calculation. Your program should then compute and display the values for Amplitude, Range, Frequency, Phase and Offset. Example input/output for part 1: Part 2: Displaying a Vertical Plot Header A vertical plot of the...

  • Please write the answer to all & uploading problems including this one on the paper and...

    Please write the answer to all & uploading problems including this one on the paper and upload the answer in one pdf file after you finish and submit this final 19 points) Let ü - (.:-( Recall that each vector correspond to a point in R' (a). (3 points) Show that the triangle with vertices o, u, jis a equilateral triangle (ie, a triangle with equal-length sides). What is the length of the three sides? (Hint: the third side can...

  • Problem 5 . This question considers uniform random points on the unit disc x2+92 〈 1...

    Problem 5 . This question considers uniform random points on the unit disc x2+92 〈 1 (a) A point (X, Y) is uniformly chosen in the unit disc. Find the CDF and PDF of its distance from the origin R X2 +Y2 (b) Compute the expected distance from the origin. (c) Determine the marginal PDF of X and Y (d) Are X and Y independent? (Justify your claims) e) One way to generate uniform random points on this disc is...

  • Choose 3 of 5 Problems to Solve Need Soon as possible Choose 3 of5 Problems to...

    Choose 3 of 5 Problems to Solve Need Soon as possible Choose 3 of5 Problems to Solve (20 Point/Each) Problem l: Triangle Printing Program: Write an application that prints a right triangle with 1 to 8 rows. Prompt the user to enter an odd number in the range of 1 to 8 to specify the number of rows in the diamond. Add a validation loop to ensure the user does not enter an even number or a number outside the...

  • I have to use java programs using netbeans. this course is introduction to java programming so...

    I have to use java programs using netbeans. this course is introduction to java programming so i have to write it in a simple way using till chapter 6 (arrays) you can use (loops , methods , arrays) You will implement a menu-based system for Hangman Game. Hangman is a popular game that allows one player to choose a word and another player to guess it one letter at a time. Implement your system to perform the following tasks: Design...

  • JAVA problem: Upgrade and extend the previous programs Draw.java and DrawCanvas.java used in the class to...

    JAVA problem: Upgrade and extend the previous programs Draw.java and DrawCanvas.java used in the class to maintain a list of shapes drawn as follows: Replace and upgrade all the AWT components used in the programs to the corresponding Swing components, including Frame, Button, Label, Choice, and Panel. Add a JList to the left of the canvas to record and display the list of shapes that have been drawn on the canvas. Each entry in the list should contain the name...

  • You need not run Python programs on a computer in solving the following problems. Place your...

    You need not run Python programs on a computer in solving the following problems. Place your answers into separate "text" files using the names indicated on each problem. Please create your text files using the same text editor that you use for your .py files. Answer submitted in another file format such as .doc, .pages, .rtf, or.pdf will lose least one point per problem! [1] 3 points Use file math.txt What is the precise output from the following code? bar...

  • Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you w...

    Java Programming .zip or .jar with 4 files: Shape.java, Square.java, TSquare.java, Triangle.java In this homework, you will build the below hierarchy: Overview: You will implement the supplier code: Shape, Square, TSquare, and Triangle, which will be used by the Homework7Main program. This program will use the DrawingPanel to draw these objects onto a canvas. Specification: You will take advantage of inheritance with using a super class, Shape.java. (below) Shape is an abstract class, which means it can be extended, but...

  • Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three...

    Write a C/C++ program that simulate a menu based binary number calculator. This calculate shall have the following three functionalities: Covert a binary string to corresponding positive integers Convert a positive integer to its binary representation Add two binary numbers, both numbers are represented as a string of 0s and 1s To reduce student work load, a start file CSCIProjOneHandout.cpp is given. In this file, the structure of the program has been established. The students only need to implement the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT