Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

Lv 32,408 points

- DP -

Favorite Answers37%
Answers441
  • Plotting Imaginary/Real in MATLAB?

    Hi I was trying to plot the function: e^(j14(pi)t)

    I want to plot the real and the imaginary, but I'm not sure how to go about doing this in MATLAB. Also, how would I limit this to the point where it only gives me a certain amount of cycles?

    Thanks for the help!

    2 AnswersEngineering10 years ago
  • Strings and Ints in C Programming?

    I was wondering how I can go about extract different integers from a string that contains number in C.

    For example, if I have variables:

    int x,y,z;

    String message = "3 1 -2 3";

    How can I make it so that x = 1, y = -2, z = 3? (The first number can represent the number of integers that will be in the string).

    I'm pretty sure there is a function that does this for me in an easy way, but I'm rusty with C and cannot recall how. Please help!

    Thank you!

    5 AnswersProgramming & Design1 decade ago
  • Question about building a LCD display?

    I am trying to figure out how to build a very basic type of LCD display (like a 7-segment display kind of display).

    However, I am having trouble finding what kind of parts I will need to create one. If possible I want to know the manufacturer, part number, costs, and basically as much information as possible.

    Please help! Thank you!

    3 AnswersMonitors1 decade ago
  • C Programming pointers question?

    I want to build a function such that if I'm given an input parameter of an array of integers in the syntax of:

    int *list

    the function will directly access the elements of the array and have the power to change the values.

    I am not very familiar with the syntax of arrays in the format of variabletype *name (I must use this type of array for the assignment).

    How would I access the array of integers such that after it passes through a function called something like:

    void changeValues(int *list);

    the value of the int at each index is something like 4. I don't know how to directly change the value of each element in the array.

    Please help!

    Thank you

    2 AnswersProgramming & Design1 decade ago
  • Array of Strings Implementation in C?

    I wanted to implement an Array of Strings in the form:

    char data[15][10];

    How would I edit the contents of the string array? (Could I do that?)

    I want to do it without using the string library if possible (so not pre-defined strcpy-type functions).

    For example, I understand that I now have an array of size 10 for strings that can be a maximum of 15 characters long.

    If I wanted to add the string "hello" to the 3rd index, how would I do so?

    Please help!

    Thank you!

    3 AnswersProgramming & Design1 decade ago
  • Questions about String in C programming?

    Before we start, note that I used a typedef to define:

    typedef char* String;

    I want to create a function such that there is an input parameter char *msg. I want to be able to change the value of msg directly through the input parameter.

    For example, let's say I have a function called void changeStr(char *msg);

    It would take in whatever *msg is and set it so that the string that msg is set to is "hello world"

    I tried doing this, but I just can't get it to work. How would I implement this?

    Like if I try to do

    void changeStr(char *msg)

    {

    msg = "hello world";

    }

    msg would be set to "hello world" for the duration of the function, but when I try to test the value outside the function, the value remains at its original string.

    Please help!

    Thank you!

    5 AnswersProgramming & Design1 decade ago
  • Removing ending characters of a String in C?

    I'm trying to implement a code where if I have a maximum string length of 512 bytes including the null terminator (512 characters) and I am given a string of a larger size, let's say 522 bytes of size. Then, I must remove the last 10 bytes of the given string such that it is now a size of 512 bytes with the first part of the string that was not removed.

    However, I'm not sure how to do that. Please help. Thank you!

    2 AnswersProgramming & Design1 decade ago
  • Probability Question?

    The probability of a bit error in a binary channel is 0.1.

    Treat each transmission as a Bernoulli random variable; assume that successive transmissions are identically and independently distributed.

    If you transmit 1000 bits, what is the probability that 115 or fewer errors occur in the channel?

    I know that because there are a large number of n (1000) this pertains to the Gaussian Normal Distribution, but I'm still not sure how to solve the problem. Please help!

    Thank you!

    1 AnswerMathematics1 decade ago
  • Electromagnetism Question?

    The question asks:

    Consider two parallel, circular loops of radius r, oriented normal to the z-axis and whose centers are at z = (+/-)a=2. Each loop carries a current I, so that the both coils generate a magnetic field in the +z-direction along the z-axis (when x = y = 0).

    These loops are referred to as Helmholtz rings.

    a. Plot the magnitude of the magnetic field along the z-axis in the three cases

    a = r=2, a = r, and a = 2r. Please generate the solution numerically and

    indicate how you did it. Include a copy of the computer code that you create to

    solve the problem.

    b. For what ratio r=a is the variation of the magnetic field flattest at the origin?

    Hint: Show that the first and third derivatives of H are zero in the z-direction

    at the origin. Find the conditions that make the second derivative zero. In that

    case, the first derivative that appears will be the fourth derivative.

    I'm really not sure how to do this problem. Help please! Thank you!

    1 AnswerEngineering1 decade ago
  • Probability/Statistics Question?

    The question asks:

    The simulation model of a proposed computer system for Students Gosset uses a discrete approximation of a continuous uniform distribution on the interval 10 to 30. Find the mean and variance of the continuous uniform distribution over this range, and compare it to the the approximation if we use:

    a. the elevent values 10, 12, 14, ..., 20

    or

    b. the 101 values 10, 10.1, 10.2, ..... 29.9, 30.

    I'm not sure how to do this problem. Any help is appreciated. Thanks!

    1 AnswerMathematics1 decade ago
  • Linux Shell Question?

    Hi,

    I am currently working on my own basic shell for a Linux OS and I am being asked to do a number of things.

    Including " Upon completion of each command and before printing the prompt for the next command, mshell prints the total number of commands it has executed so far together with the total CPU time (in seconds) and maximum amount of memory used (in Kbytes) to execute all those commands. "

    I know how to counter the number of executions. I tried using the time.h header file along with the clock function to calculation the time. However, it does not seem to return the time spent on each process in seconds. Also, I don't know where to find a function that will allow me to calculate the memory of each process used while the user uses the shell.

    Please help. Thank you!

    1 AnswerProgramming & Design1 decade ago
  • Probability Question?

    The question asks:

    The personnel of the Farout Engineering company use a supercomputer to make a complicated engineering calculations. An examination of computer records show that each terminal in the system can, on average, service 5/3 engineers each hour, that is, each engineer spends, on average a little more than 30 minutes on the terminal. Find the probabilities:

    a.) probability that an engineer will use the terminal for more than one hour.

    b.) probability that an engineer will use the terminal for less than 30 minutes.

    c.) if an engineer has already been at the terminal for 30 minutes, what is the probability that she will spend more than another hour at the terminal.

    d.) 90% of all sessions end in R minutes or less. Find R.

    I think this is a Poisson Probability problem because it deals with certain events in respect to time with lambda (average service rate) being 5/3 engineers per hour which is actually .0278 engineers per minute. However, I honestly got nothing after that. I don't know how to incorporate the information into the Poisson equation to get the probabilities. Please help.

    Thank you!

    2 AnswersMathematics1 decade ago
  • Probability PDF Question?

    The question asks: The PDF of a random variable X is of the form:

    f_x(x) = { Cxe^(-x) x>0

    { 0 x<=0

    (a) Find the constant C and sketch f_x(x)

    I'm not sure if I did this correctly. I integrated by parts for Cxe^(-x) and got C=-1?

    But, I don't think that is correct.

    Also, how would I find the probability of the event x_0 < X <= x+0 +.001 for the following values of x_0:

    i. x_0 =1/2

    ii. x_0 = 2

    What value of x_0 is "most likely," i.e. , what value of x_0 would give the largest probability for the event:

    x_0 < X <= x_0 + .001

    Please help. Thanks!

    1 AnswerMathematics1 decade ago
  • Probability Binomial Equation Question?

    Hi, the question I'm having trouble with states:

    "in transmission of a very long (you may read "infinite") set of characters, byte errors occur independently with probability 1/9. what is the probability that the first error occurs within the first five bytes transmitted?

    I use the variable p to be the probability that an error occurs (1/9).

    I understand that this question involves a binomial pmf.

    However, I don't know how I would solve this question. Please help.

    Thanks!

    2 AnswersMathematics1 decade ago
  • Probability/Statistics Question?

    The question asks:

    "We wish to communicate over a certain communication channel where the probability of an error on any single bit is Q. We wish to communicate over this channel using 8-bit words.

    a. write an expression for the pmf the number of bit errors per 8-bit word as a function of Q. (one equation)

    b.plot or sketch the pmf for values of Q = .1, .01, and .001 (three plots)

    c. assume that the words are 16 bits in length. repeat step a

    d. repeat 6.2 for the 16 bit words

    "

    Now I'm not confident in the way to answer this question. But for the expression to represent the pmf. However, I am pretty sure that a geometric random variable should be used to represent this?

    This would mean the expression to represent this probability would be:

    f[k] = Q(1-Q)^k

    where f[k] represents the probability of the event and k is the number of bit that is currently being looked at?

    I would assume that the same concept goes behind a 16-bit word and plotting the function is just a matter of plugging various k values into the function?

    Am I doing this correctly? Please help!

    Thank you!

    1 AnswerMathematics1 decade ago
  • Splay Tree Question (Computer Science)?

    Using this diagram as an example: http://i617.photobucket.com/albums/tt253/bboyDP/30...

    Show that if all nodes in a splay tree are accessed in sequential order, the resulting tree

    consists of a chain of left children. Hint: Using this example splay tree prove to yourself this

    statement is true.

    I'm not sure how I would show that all nodes in the splay tree are accessed in sequential order (consists of a chain of left children). Please help. Thank you!

    1 AnswerProgramming & Design1 decade ago
  • Computer Programming Binary Trees Question?

    Picture from the problem:

    http://i617.photobucket.com/albums/tt253/bboyDP/cm...

    The question asks to perform the following operations:

    Remove 6, Insert 7, Insert 10, Insert 6, Remove 1, Remove 3

    Then answer the following questions:

    1.

    2.

    3.

    4.

    5.

    What is the height of the tree?

    What is the depth of 7?

    Is 5 a full internal node?

    What is the new root of the tree?

    What is the max of the tree?

    I'm not very sure how to do this but this is what I thought out so far:

    After all the operations, the tree would look like:

    ---------------------5

    -----------------2

    ----------------------4

    ---------------------------7

    -----------------------------10

    But again, I'm not too sure, as for the questions,

    the height would be 4?

    depth of 7 is 3?

    not sure if 5 is a full internal node

    new root is 5 because it was the predecessor

    max is 10?

    please help! Thank you

    2 AnswersProgramming & Design1 decade ago
  • Computer Programming Binary Tree Question?

    Write a recursive algorithm that determines the height of any binary node in a Binary

    Tree. An empty tree has a height of -1.

    This is what the question asks, but I'm not sure how to code it.

    I know that I would have to iterate to the bottom most "leaf" in the binary tree, but how would I make the program iterate through the correct way?

    Please help. Thank you!

    3 AnswersProgramming & Design1 decade ago
  • Computer Programming Binary Trees?

    Reconstruct the exact BINARY Tree given the following traversals:

    In Order: 9, 2, 10, 6, 5, 8, 3, 1, 4, 7

    Post Order:9, 10, 2, 6, 8, 3, 7, 4, 1, 5

    I'm not sure how to do this one..

    For in order would it be:

    -------------------------9

    ---------------------2------10

    --------------------------------------6

    ---------------------------------- 5-----8

    -------------------------------3

    ----------------------------1------4

    ------------------------------------------7

    ? would that be correct

    Then, for post order would it be:

    ---------------------------7

    ------------------------3

    -------------------4--------8

    ---------------6-----5

    -----------2-------1

    ------------------------10

    -------------------9

    I'm really confused. Please help. Thank you!

    1 AnswerProgramming & Design1 decade ago
  • Java Programming Question LinkedList Iterator?

    I'm working on an assignment where I have to create my own Java LinkedList, which I did successfully, but I also have to create the iterator and I am having trouble doing so. I tried looking it up in my class's textbook, but there is an error in it that I cannot figure out how to resolve. It is the part of the code that I commented out. Please help! What am I supposed to put in place of it?

    private class myListIterator implements java.util.Iterator<AnyType> {

    private Node<AnyType> current = beginMarker.next;

    private int expectedmodCounter = modCounter;

    private boolean okToRemove = false;

    public boolean hasNext() {

    return current != endMarker;

    }

    public AnyType next() {

    if (modCounter != expectedmodCounter)

    throw new java.util.ConcurrentModificationException();

    if (!hasNext())

    throw new java.util.NoSuchElementException();

    AnyType nextItem = current.data;

    current = current.next;

    okToRemove = false;

    return nextItem;

    }

    public void remove() {

    if (modCounter != expectedmodCounter)

    throw new java.util.ConcurrentModificationException();

    if (!okToRemove)

    throw new IllegalStateException();

    // myList.false.remove(current.prev);

    okToRemove = true;

    }

    }

    2 AnswersProgramming & Design1 decade ago