Questions
Python CODE for this question: There are 2 red marbles and 98 blue marbles in a...

Python CODE for this question:

There are 2 red marbles and 98 blue marbles in a jar. Draws are made at random with replacement. Find the smallest number of draws needed such that the probability is greater than 1/2 that a red marble is drawn at least once.

In: Computer Science

Peter rolls an 8 die and then Kate gets three chances to roll a 6-die and...

Peter rolls an 8 die and then Kate gets three chances to roll a 6-die and get greater number than whatever Pter rolled. What is the probability that at least one of Kate’s rolls is greater than what Peter's rolls?

In: Statistics and Probability

Among the students at a particular college, the mean number of days absent from classes is...

Among the students at a particular college, the mean number of days absent from classes is 3.5 with a standard deviation of 1.2. Assuming absences at the college are normally distributed determine the probability that 3 students all missed 5 days or more days.

In: Math

Goodwin Company has three segments: 1, 2, and 3. Data regarding these segments follow: Segment 1...

Goodwin Company has three segments: 1, 2, and 3. Data regarding these segments follow:

Segment 1          Segment 2          Segment 3

Contribution to indirect expenses            $ 432,000            $ 208,800            $ 72,000

Assets directly used by and identified

with the segment                                            3,600,000                 1,440,000         360,000

a. Calculate the return on investment for each segment. Rank them from highest to lowest.

b. Assume the cost of capital is 10% for a segment. Calculate the residual income for each segment. Rank them from highest to lowest.

c. Repeat (b), but assume the desired cost of capital is 14%. Rank the segments from highest to lowest.

d. Comment on the rankings achieved.

In: Accounting

Write a class Lab7 that reads and evaluates postfix expressions contained in a file. Each line...

Write a class Lab7 that reads and evaluates postfix expressions contained in a file. Each line of the file contains a postfix expression with integers as operands and ‘+’, ‘-’, ‘*’ and ‘/’ as operators. Consecutive operands and operators are separated by spaces. Note the following requirements for the lab: • The main method in Lab7.java should do the following. 1. ask the user for the name of the file containing the expressions, 2. for each line of the file, read the postfix expression, call the method evaluatePostfix on this expression, and print the expression and its evaluation on the console. • The method to evaluate the postfix expression in Lab7.java must have the following signature: public static int evaluatePostfix(String expr). Your implementation must use the Scanner class to parse each line of the file to obtain the postfix expressions and then use a stack to evaluate each of these expressions. Test your code using lab7.dat as your input data file. You will also need the following files : StackInterface.java, StackArrayListBased.java, StackException.java

/** Implementation of a Stack Class using an ArrayList; we consider the
 * top of the stack to be the first element in the ArrayList. Hence a
 * push adds an element in the front of the vector, and a
 * pop removes the first element of the vector.
 * @authors Sharmin Jahan, Sandip Sen
 */
import java.util.ArrayList;

public class StackArrayListBased implements StackInterface {
    /** ArrayList used for the stack */
    private ArrayList stack;

    /** default constructor */
    public StackArrayListBased() {
        stack = new ArrayList();
    }  // end default constructor


    /** Tests if this stack has no elements.
     * @return true if this list has no elements;
     * false otherwise.
     */
    public boolean isEmpty() {
        return stack.isEmpty();
    }  // end isEmpty


    /** Adds an item to the top of a stack.
     *Postcondition: If insertion is successful, newItem is on the top
     * of the stack
     * @param newItem is the item to be added.
     * @throws some implementations may throw StackException when
     * newItem cannot be placed on the stack.
     */
    public void push(E newItem) throws StackException {
        stack.add(0, newItem);
    }  // end push

    /**
     * Removes all the items from the stack.
     * PostCondition: Stack is empty.
     */
    public void popAll() {
        stack.clear();
    }  // end popAll

    /**
     * Removes the top of a stack.
     * @return If the stack is not empty, the item that was added most
     * recently is removed from the stack and returned.
     * @throws StackException if the stack is empty.
     */
    public E pop() throws StackException {
        if (!isEmpty()) {
            return stack.remove(0);
        }
        else {
            throw new StackException("StackException on " +
                    "pop: stack empty");
        }  // end if
    }  // end pop

    /**  Retrieves the top of a stack.
     * @return If the stack is not empty, the item that was added most
     * recently is returned. The stack is unchanged.
     * @throws StackException if the stack is empty.
     */
    public E peek() throws StackException {
        if (!isEmpty()) {
            return stack.get(0);
        }
        else {
            throw new StackException("Stack exception on " +
                    "peek - stack empty");
        }  // end if
    }  // end peek
}  // end StackArrayListBased
/** Generic Stack Interface */
public interface StackInterface {

    /** Determines whether the stack is empty.
     * @return true if the stack is empty; false otherwise
     */
    public boolean isEmpty();
    
    /**
     * Removes all the items from the stack.
     * PostCondition: Stack is empty.
     */
    public void popAll();
    
    /** Adds an item to the top of a stack.     
     *Postcondition: If insertion is successful, newItem is on the top
     * of the stack
     * @param newItem is the item to be added.
     * @throws Some implementations may throw StackException when
     * newItem cannot be placed on the stack.
     */
    public void push(E newItem) throws StackException;

    /**
     * Removes the top of a stack.
     * @return If the stack is not empty, the item that was added most
     * recently is removed from the stack and returned.
     * @throws StackException if the stack is empty.
     */
    public E pop() throws StackException;
  
  
    /**  Retrieves the top of a stack.  
     * @return If the stack is not empty, the item that was added most
     * recently is returned. The stack is unchanged.
     * @throws StackException if the stack is empty.
     */
    public E peek() throws StackException;
 
    

}  // end StackInterface
public class StackException 
             extends java.lang.RuntimeException {
  public StackException(String s) {
    super(s);
  }  // end constructor
}  // end StackException

lab7.dat

5 4 - 12 - 10 62 + /
10 7 * 43 - 15 / 17 39 - +
22 11 / 19 * 14 2 + 2 * -
40 3 * 66 - 5 / 29 +

In: Computer Science

Consider the following binomial experiment. The probability that a green jelly bean is chosen at random...

Consider the following binomial experiment. The probability that a green jelly bean is chosen at random from a large package of jelly beans is 1/8. If Sally chooses 13 jelly beans, what is the probability that at most two will be green jelly beans?

a) 0.7781

b) 0.5000

c) 0.2800

d) 0.7841

e) 0.2159

f) None of the above.

Consider the following binomial experiment: A company owns 5 copiers. The probability that on a given day any one copier will break down is 0.64. What is the probability that at least 3 copiers will break down on a given day?

a) 0.4398

b) 0.5075

c) 0.6417

d) 0.7491

e) 0.0024

f) None of the above.

Consider the following binomial experiment: A company owns 19 copiers. The probability that on a given day any one copier will break down is 11/100. Find the mean number of copiers that will break down on any given day.

a) 0.21

b) 2.09

c) 1.73

d) 1.10

e) 1.90

f) None of the above.

In: Statistics and Probability

In this activity, you will determine the probability of obtaining one of these disproportionate ratios if...

In this activity, you will determine the probability of obtaining one of these disproportionate ratios if we assume that nature alone is responsible for these obscure results. In order to determine these probabilities, you will use the Normal approximation to the binomial.

1. Outline the binomial model for the number of boy births in the next 1000 births assuming that births are produced according to the natural ratio of 51.2% chance of a boy.

2. Outline the Normal approximation to the binomial by determining if this binomial distribution satisfies the conditions for the Normal approximation. Furthermore, determine the mean and standard deviation.

3. Next, determine the probability of getting an obscure ratio or worse. That is:

(a) What is the probability of having 33% boys or less? (in 1000 births, 330 would be male)

(b) What is the probability of having 41% boys or less? (in 1000 births, 410 would be male)

(c) What is the probability of having 1200 boys for every 1000 girls or 54.5% boys? (in 1000 births, 545 would be male)

4. Interpret these results in the context of the problem.

5. Comment on the moral and ethical implications of these results.

In: Statistics and Probability

Consider a monoatomic ideal gas of N moles in a gas cylinder eqilibrated at temperature T1...

Consider a monoatomic ideal gas of N moles in a gas cylinder eqilibrated at temperature T1 and pressure P1 by a mass placed on the piston. Upon removal of the mass , the gas reaches a new eqilibrium pressure P2 (<P1). Calculate the amount of work done by the gas on the surroundings for the following processes.

( You must express your answer in terms of the given variables.)

1. a nonquasistatic isothermal process (sudden removal of the mass)

2. a quasistatic isothermal process (gradual removal of the mass)

3. a nonquasistatic adiabatic process

4. a quasistatic adiabatic process

5. Show that for both isothermal and adiabatic processes, the quasistatic work is larger than the

nonquasistatic work.

In: Physics

A 0.831 gram sample of SO3 is placed in a 1.00 L rigid container and heated...

A 0.831 gram sample of SO3 is placed in a 1.00 L rigid container and heated to 1100 K. The SO3 decomposes to SO2 and O2 :

                                    2SO3(g) ↔ 2SO2(g) + O2(g)

At equilibrium, the total pressure in the container is 1.300 atm. Calculate the value of Kp at 1100 K

Extra Credit: Consider two containers A and B where A is a rigid container and B is a container with a massless, frictionless piston that maintains constant pressure. NH3(g) is injected into both containers and allowed to come to equilibrium. At equilibrium, 2 atm of Argon gas is injected into each container. Explain any changes (up, down or no change) to the equilibrium concentrations of NH3, N2and H2?

In: Chemistry

Two kg of water is contained in a piston–cylinder assembly, initially at 10 bar and 200°C....

Two kg of water is contained in a piston–cylinder assembly, initially at 10 bar and 200°C. The water is slowly heated at constant pressure to a final state. If the heat transfer for the process is 1740 kJ, determine the temperature at the final state, in °C, and the work, in kJ. Kinetic and potential energy effects are negligible. (Moran, 01/2018, p. P-23) Moran, M. J., Shapiro, H. N., Boettner, D. D., Bailey, M. B. (01/2018). Fundamentals of Engineering Thermodynamics, Enhanced eText, 9th Edition [VitalSource Bookshelf version]. Retrieved from vbk://9781119391388 Always check citation for accuracy before use.

In: Physics