1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
avanturin [10]
2 years ago
6

(lesson 7.9: acceptance-rejection --- continuous examples.) consider the constant . on average, how many iterations (trials) wil

l the a-r algorithm require?
Computers and Technology
1 answer:
valentina_108 [34]2 years ago
7 0

In (lesson 7.9: acceptance-rejection --- continuous examples.) consider the constant . on average,the iterations (trials) will the a-r algorithm require an acceptance-rejection algorithm for non-stop random variables generate an RV y disbursed as g.

<h3>What is acceptance-rejection sampling?</h3>

It is acceptance-rejection sampling is a manner to simulate random samples from an unknown (or tough to pattern from) distribution (known as the goal distribution) through the use of random samples from a similar, greater handy chance distribution. a random subset of the generated samples are rejected; the relaxation are accepted.

  1. As we already know, finding an express system for f −1(y) for the cdf of an RV x we want to generate, f (x) = p (x  x), isn't always usually possible.
  2. Moreover, despite the fact that it is, there can be opportunity strategies for producing a rv disbursed as  this is greater eÿcient than the inverse remodel technique or different strategies we've got come across. here we gift a totally smart technique called the acceptance-rejection technique.

Read more about acceptance-rejection --- continuous:

brainly.com/question/25759088

#SPJ1

You might be interested in
Connect research concepts to their definitions
stellarik [79]
Answer Research is defined as the creation of new knowledge and/or the use of existing knowledge in a new and creative way so as to generate new concepts, methodologies and understandings
8 0
2 years ago
This is a program that calculates information about orders of shirts and pants. All orders have a quantity and a color. Write a
LuckyWell [14K]

Answer:

Check the explanation

Explanation:

// Clothing.java

public class Clothing {

//Declaring instance variables

private int quantity;

private String color;

//Zero argumented constructor

public Clothing() {

this.quantity = 0;

this.color = "";

}

//Parameterized constructor

public Clothing(int quantity, String color) {

this.quantity = quantity;

this.color = color;

}

// getters and setters

public int getQuantity() {

return quantity;

}

public void setQuantity(int quantity) {

this.quantity = quantity;

}

public String getColor() {

return color;

}

public void setColor(String color) {

this.color = color;

}

public double calculatePrice()

{

return 0.0;

}

}

_____________________________

// Pants.java

public class Pants extends Clothing {

//Declaring instance variables

private int waist;

private int inseam;

//Zero argumented constructor

public Pants() {

this.waist = 0;

this.inseam = 0;

}

//Parameterized constructor

public Pants(int quantity, String color, int waist, int inseam) {

super(quantity, color);

setWaist(waist);

setInseam(inseam);

}

// getters and setters

public int getWaist() {

return waist;

}

public void setWaist(int waist) {

if (waist > 0)

this.waist = waist;

}

public int getInseam() {

return inseam;

}

public void setInseam(int inseam) {

if (inseam > 0)

this.inseam = inseam;

}

public double calculatePrice() {

double tot = 0;

if (waist > 48 || inseam > 36) {

tot = 65.50;

} else {

tot = 50.0;

}

return tot;

}

}

__________________________

// Shirt.java

public class Shirt extends Clothing {

//Declaring instance variables

private String size;

//Zero argumented constructor

public Shirt() {

this.size = "";

}

//Parameterized constructor

public Shirt(int quantity, String color, String size) {

super(quantity, color);

this.size = size;

}

// getters and setters

public String getSize() {

return size;

}

public void setSize(String size) {

this.size = size;

}

public double calculatePrice() {

double tot = 0;

if (size.equalsIgnoreCase("S")) {

tot = getQuantity() * 11.00;

} else if (size.equalsIgnoreCase("M")) {

tot = getQuantity() * 12.50;

} else if (size.equalsIgnoreCase("L")) {

tot = getQuantity() * 15.00;

} else if (size.equalsIgnoreCase("XL")) {

tot = getQuantity() * 16.50;

} else if (size.equalsIgnoreCase("XXL")) {

tot = getQuantity() * 18.50;

}

return tot;

}

}

___________________________

//Test.java

import java.util.ArrayList;

public class Test {

public static void main(String[] args) {

int totShirts=0,totPants=0;

double sprice=0,pprice=0,totWaist=0,totinseam=0,avgWaist=0,avginseam=0;

int cnt=0;

ArrayList<Clothing> clothes=new ArrayList<Clothing>();

Shirt s=new Shirt(8,"Green","XXL");

Pants p1=new Pants(6,"Brown",48,30);

Pants p2=new Pants(4,"Blue",36,34);

clothes.add(s);

clothes.add(p1);

clothes.add(p2);

for(int i=0;i<clothes.size();i++)

{

if(clothes.get(i) instanceof Shirt)

{

Shirt s1=(Shirt)clothes.get(i);

totShirts+=s1.getQuantity();

sprice+=s1.calculatePrice();

}

else if(clothes.get(i) instanceof Pants)

{

Pants pa=(Pants)clothes.get(i);

totPants+=pa.getQuantity();

pprice+=pa.calculatePrice();

totinseam+=pa.getInseam();

totWaist+=pa.getWaist();

cnt++;

}

}

System.out.println("Total number of shirts :"+totShirts);

System.out.println("Total price of Shirts :"+sprice);

System.out.println("Total number of Pants :"+totPants);

System.out.println("Total price of Pants :"+pprice);

System.out.printf("Average waist size is :%.1f\n",totWaist/cnt);

System.out.printf("Average inseam length is :%.1f\n",totinseam/cnt);

 

}

}

_________________________

Output:

Total number of shirts :8

Total price of Shirts :148.0

Total number of Pants :10

Total price of Pants :100.0

Average waist size is :42.0

Average inseam length is :32.0

4 0
4 years ago
Marissa bought 2 and 1/2 gallons of orange juice to make punch how many quarts of orange juice did Marissa Buy
Vladimir [108]
1 gallon = 4 quarts
using this information, you can then use simple proportion.
if 1 gallon = 4 quarts 
then to find the amount of quarts in 2 and 1/2 gallons, you multiply 2 and 1/2 by 4 which should give you 10 gallons
5 0
3 years ago
Read 2 more answers
Which relationship is possible when two tables share the same primary key?
patriot [66]

When two tables share the same primary key, they share a

A. one-to-one relationship.

Explanation:

  • One-to-one relationship is a type of cardinality that refers to the relationship between two entities A and B in which one element of A may only be linked to one element of B, or the opposite way.
  • A one-to-one relationship in a relational database occurs when one parent record or field has either zero or one child record only.
  • These relationships are the easiest to represent in databases because both the parent and child records may be in the same table.
  • One-to-one relationships associate one record in one table with a single record in the other table.
  • These relationships are frequently used to indicate critical relationships so you can get the data you need to run your business.
  • A one-to-one relationship is a link between the information in two tables, where each record in each table only appears once.
8 0
4 years ago
What feature of a computer program allows it to function on various platforms?
xxTIMURxx [149]
Cross-platform, i believe thats your answer

if this is correct please mark as brainliest.

3 0
3 years ago
Read 2 more answers
Other questions:
  • In Word, how can you tell when text is selected?
    8·1 answer
  • What does it mean to calculate frequencies within a dataset
    7·2 answers
  • What is 1/2 minus 1/16?
    7·2 answers
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • What is the advantage of using CSS?
    14·2 answers
  • An administrative assistant types a document, saves, and prints. The assistant is using _____.
    14·1 answer
  • Python exercise grade 10
    7·1 answer
  • If you were creating a program that would convert Fahrenheit to Celsius, which kind of variable would you want to use? a string
    7·2 answers
  • I need the answer ASAP. I’ll mark brainliest if right
    5·1 answer
  • Is electricity a force or energy?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!