1. W

    Vector Multiplication for Programming

    Alright, so I want to program a Ray Tracing Rederer for which i need to do some math. Specifically, I need to check for the intersection of a sphere and line. So I looked up the wikipedia article and got the formula. However, it involves multiplying to 3d vector with one another. I've heard...
  2. Flexico

    Complex verses Quaternion Question

    In Python, complex numbers are typed as follows: 3+4j. This kinda bugs me that they use "j" instead of the traditional "i", particularly because quaternions (4-dimensional complex numbers) use i, j, and k for the three "imaginary" directions, so this would cause some overlap. But then I got to...
  3. E

    Linear Programming in AMPL

    Hope this is the right thread. I've only just started learning AMPL but I'm stuck trying to figure out how to write a program that would solve this LP: Jimbo Enterprises produces n products. Each product can be produced in one of m machines. Let tij be the time in hours needed to...
  4. G

    Linear Programming problems.

    Hello everyone. I'm flummoxed about how to formulate the linear programming problem for this questions, and was wondering if anyone had any ideas or hints on how to proceed with it? Any help would be greatly appreciated.
  5. R

    Scilab Programming question

    Can anyone help with this tutorial question? Consider the following non-linear system of equations: g(x; y; z) = xyz – x^2 + y^2 - 1.34 = 0 ; h(x; y; z) = xy – z^2 - 0.09 = 0 ; i(x; y; z) = e^x – e^y + z – 0.41 = 0 : Write a Scilab function that will evaluate g, h and i at any point (x; y; z)...
  6. R

    Scilab Programming question

    I have come across the Scilab program below, but I am having difficulty understanding how this program calculates z3. I inserted the line disp(z3(i)) to try to work this out, but there is one thing I do not understand. If w goes from -25000 to 25000 in intervals of 500 and L = 0.5, then why...
  7. G

    Linear Programming Problem

    Can someone please help me with this. I am not sure what to do. Show that the following dictionary cannot be the optimal dictionary for any linear programming problem in which $w_1$ and $w_2$ are the initial slack variables: \zeta=4-w_1-2x_2 x_1=3 -2x_2 w_2=1+w_1- x_2
  8. N

    Linear Programming

    Question 2A. How do you calculate the objective function. I can get the graph drawn but i just cannot figure out where the dashed line in the solution comes from.
  9. D

    Investment/Financial Linear Programming Model

    Hello! Please help me set up the formulations for this! Thank you!! Information on a prospective investment for Wells Financial Services is given below. Period 1 2 3 4 Loan Funds Available 3000 7000 4000 5000 Investment Income (% of...
  10. C

    Linear programming, finding smallest triangle enclosing n points

    I am currently facing a problem that bothers me because it kind of confuses me a bit and I will be extremely grateful if you could help me out on this. Here is the problem: We are asked to find the smallest equilateral triangle that encloses a given set of n points in 2 dimensions, (x1, x2). The...
  11. A

    Application of linear programming

    4. Carol Summers has 50 minutes to take an English test that has 20 multiple-choice questionsand 20 short –answer questions. She knows she can answer a multiple-choice question in 1.5minutes and a short-answer question in 2 minutes. Each correct multiple-choice answerreceives 2 points, and each...
  12. M

    Linear Programming quiz questions

    I have some questions if my answers are correct and I just need anyone to verify and correct my solutions :(. A.Given an optimal solution to an LP model, is there a case when the value of z is negative? Justify your answer. My solution: Yes, the value of z can be negative if the gradients of...
  13. M

    deterministic dynamic programming

    A gambler has 2 dollars. He is allowed to play a game four times and his goal is to maximize his probability of ending with at least 6 dollars . If the gambler bets b dollars then with probability 0.4 he wins the game and increases his capital position by b dollars; with probability 0.6 he loses...
  14. O

    Dynamic programming problem

    Could somebody help me in solving this question, We have an exam coming up and it has beensaid that questions will be loosely based around similar style questions. Find attached the queston Thanks in advanced
  15. T

    Linear programming applied to a financial bond portfolio

    Hi everybody, I've the following linear programming problem with no objective function and only as restrictions only a set of portfolio indicators (e.g. duration, convexity, sensitivity, yield to maturity). The problem is to find the correct weights (xi) which satisfies the following...
  16. K

    linear programming problem 2

    A company is considering making a TV or radio advertising. 380,000 $ in a TV ad, a radio ad 120,000 $ it costs. A TV ad for the 500,000 people, it is estimated that 200,000 people access to a radio program. Advertise policy to more than 15 TV and radio should be used at least 10 advertised. The...
  17. K

    linear programming problem

    A furniture craftsman has 6 boards and 28 hours of time. Type A tables require 2 boards and 7 hours of labor. Type B tables require 1 board and 8 hours of labor. Type A tables sell for $1200; type B tables sell for $800. How many of each type of table will maximize sales revenue?
  18. M

    R programming

    A small investment firm expects to receive premium income of €1million each month for the next year. The firm’s outgo each month is assumed to follow a Normal distribution with mean €0.9million and standard deviation €0.2million. Build a simple simulation model, based on 1,000 runs, in R to...
  19. S

    MP3 decoder synchronization word using Matlab

    Hi, I found this programming from a book entitled 'Analysis of the MPEG-1 Layer III (MP3) Algorithm Using MATLAB'. % P 6.1 – Seek the synchronization word and place the bitstream pointer function [bs, retval] = seek_sync(bs, sync, N) global ALIGNING maxi = round(2^N - 1); aligning =...
  20. S


    Hi everyone, I am Star. I am doing MP3 decoder using Matlab. Will have bunch of questions regarding Matlab programming and algorithm. Hope to learn from you guys. (Bow)(Handshake) ~Star