• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

The Math Help Thread

Status
Not open for further replies.
Thanks for the suggestions but unfortunately still having the same problem lol

uNum6kH.png
 
Thank you! The (x^2.0526 * Jc) term should be in the denominator it looks like your missing parenthesis to dictate that. Do you mind adding them and letting me know if your still able to plot a graph? Thanks again

My bad. I read the problem again, it should be definite integral from Co to Cf, isn't it? For that, you should use numerical integration, something like this
Code:
fun=@(x)constant./(x.^2.0526.*a.*exp(-b.*x));
y=integral(fun, Co,Cf);

y=3.4911
 
Thank you! The (x^2.0526 * Jc) term should be in the denominator it looks like your missing parenthesis to dictate that. Do you mind adding them and letting me know if your still able to plot a graph? Thanks again

Try this? I'm still not sure what the problem you're solving is about (it looks poorly worded to me), so I hope the lower bound 0.5 that I used below is correct. I also wonder what Cf is used for.


syms x C;

% Define a, b, Co, Cf, A, Vo, sigma as before
a = 50; b = 0.02;
Co = 0.5; Cf = 50;
A = 19.4;
Vo = 3255;
sigma = 0.95;

% Define J(C) and the constant
Jc = a * exp(-b*x);
constant = Vo / (sigma * A) * Co^(1/sigma);

% Evaluate t = t(C)
t = constant * int(1 / (Jc * x^(1 + 1/sigma)), x, 0.5, C);

% Plot t = t(C)
ezplot(t, 0.5, 50);
 
Try this? I'm still not sure what the problem you're solving is about (it looks poorly worded to me), so I hope the lower bound 0.5 that I used below is correct. I also wonder what Cf is used for.


syms x C;

% Define a, b, Co, Cf, A, Vo, sigma as before
a = 50; b = 0.02;
Co = 0.5; Cf = 50;
A = 19.4;
Vo = 3255;
sigma = 0.95;

% Define J(C) and the constant
Jc = a * exp(-b*x);
constant = Vo / (sigma * A) * Co^(1/sigma);

% Evaluate t = t(C)
t = constant * int(1 / (Jc * x^(1 + 1/sigma)), x, 0.5, C);

% Plot t = t(C)
ezplot(t, 0.5, 50);

Wow great that worked! Thank you! Co is the initial concentration and Cf is the final concentration and also the limits for the integral. My goal is to plot concentration vs time, so I am assuming I do not plug in the limits because then I will just get a number (which is not what I want to plot). Your code is working for me however could you please explain what ",x, 0.5, C)" means at the end of the equation. From what I know I thought it was to just define your limits. How come we only put the lower limit? Also you used C can you explain where that comes from?

Thanks!
 
Wow great that worked! Thank you! Co is the initial concentration and Cf is the final concentration and also the limits for the integral. My goal is to plot concentration vs time, so I am assuming I do not plug in the limits because then I will just get a number (which is not what I want to plot). Your code is working for me however could you please explain what ",x, 0.5, C)" means at the end of the equation. From what I know I thought it was to just define your limits. How come we only put the lower limit? Also you used C can you explain where that comes from?

Thanks!


Sure. The second input, x, tells Matlab this is the variable that the integral is performed over. I used x as a dummy variable.

The two inputs that follow afterwards are the bounds of the integral. We are asking Matlab to integrate the expression from 0.5 to C. Note that I had earlier defined C to be a symbolic variable. Hence, the variable t isn't assigned a value yet, but is a function of C now.

Finally, the ezplot routine graphs the function t = t(C) from concentration level of 0.5 to 50.

The way you described the problem, though, it sounds like you might want to plot the concentration on y-axis and time on x-axis (may be more useful). I'd use the plot routine to have greater control over plotting, but this will require a little more work. At the very least, please use the title, xlabel, and ylabel routines to indicate what we are seeing on the graph.
 
Sure. The second input, x, tells Matlab this is the variable that the integral is performed over. I used x as a dummy variable.

The two inputs that follow afterwards are the bounds of the integral. We are asking Matlab to integrate the expression from 0.5 to C. Note that I had earlier defined C to be a symbolic variable. Hence, the variable t isn't assigned a value yet, but is a function of C now.

Finally, the ezplot routine graphs the function t = t(C) from concentration level of 0.5 to 50.

The way you described the problem, though, it sounds like you might want to plot the concentration on y-axis and time on x-axis (may be more useful). I'd use the plot routine to have greater control over plotting, but this will require a little more work. At the very least, please use the title, xlabel, and ylabel routines to indicate what we are seeing on the graph.

I see, makes sense! Thank you again you definitely helped me out big time! and yes I agree with you I did go and "flip" the graph.
 
I studied engineering years ago so did some high enough level maths but I've totally forgotten everything I ever knew. I'd be interested in having a look again at stuff like calculus, series, linear optimisation, so would anyone know of any decent resources for someone like me? A book would be ideal.
 
I studied engineering years ago so did some high enough level maths but I've totally forgotten everything I ever knew. I'd be interested in having a look again at stuff like calculus, series, linear optimisation, so would anyone know of any decent resources for someone like me? A book would be ideal.

I recommend "Calculus" by Larson, Hostetler, and Edwards, and "Numerical Optimization" by Nocedal and Wright.

The first one is on its 10th edition now, and you can get an earlier edition for cheap. I have the 6th edition. You can also get a single-variable version, which does cover series, but I wonder if you'd want the full, multi-variable version if you're working on optimization.

Nocedal covers numerical methods for nonlinear optimization first, then those for linear programming. The book is intended for graduate students and researchers, but I think his explanation is quite good and his drawings meaningful.


Does anyone know how to change t (x) to x (t) in matlab?
in other words how I make t = constant * int(1 / (Jc * x^(1 + 1/sigma)) to c= ???

I'd create two vectors (arrays): one that contains various values of C between 0.5 and 50 (you decide what values to look in-between) and an empty array of the same size as C that will contain the corresponding values of t.

Then, use a for loop to evaluate the integral for each value of C that you chose and store the result in the array t.

Finally, call,

plot(t, C);

so that the temperature is on x-axis and concentration on the y.

The plot function offers many options that you can specify to make the graph look great. Consult the online Matlab documentation for examples.
 
I'm trying to solve this inequality by using the graph but I'm lost on where to even start I think.

x/2 + (x-2)/(x+1) ≤ 1

Subtract 1 to get it to = 0

x/2 + (x-2)/(x+1) - 1 ≤ 0

And now I'm lost.

The graph that it gives me is this:
MSP16327225ge20i01d95c9300000cdbe6e7i1238c6g
 
I'm trying to solve this inequality by using the graph but I'm lost on where to even start I think.



And now I'm lost.

The graph that it gives me is this:
MSP16327225ge20i01d95c9300000cdbe6e7i1238c6g

Try multiplying by two to get rid of the fraction. Then multiply the equation out and combine like terms.

Edit: My bad, didn't see the fraction bar. In that case, combine the two fractions.
 
I'm trying to solve this inequality by using the graph but I'm lost on where to even start I think.



And now I'm lost.

The graph that it gives me is this:
MSP16327225ge20i01d95c9300000cdbe6e7i1238c6g
If, as you say, you are supposed to solve this by using the graph, then you are almost finished. You are interested in the parts of the graph where the y-values are less than or equal to zero. The solution will be the x-values of those sections.

For example, the graph crosses the x-axis at x=-3, and is negative everywhere to the left of that point. So x<=-3, or (-infinity, -3], will be part of your solution.
 
Trying to compare the variances of some estimators, but I'm confused by my teacher's steps. The estimators come from an exponential distribution.

D6iLISK.png


I get the variance of the first estimator. What I don't understand is why adding var(x1 + x2) is equal to 2 theta instead of 2 theta squared. Didn't we just prove that var(x1) = 2 theta squared? Am I forgetting something in adding variances that makes the square go away?
 
I've been given a problem on collision. Each vehicle moves at an initial speed of 9 m/s, they go into collision. Each driver has a mas of 60 kg. Including the drivers, the total mass for the car is 860 kg and the total mass for the truck is 4060 kg. The collision time is at 0.140 s.

I just need help on part i-l, I'm not sure what to do at this point. Here
 
I've been given a problem on collision. Each vehicle moves at an initial speed of 9 m/s, they go into collision. Each driver has a mas of 60 kg. Including the drivers, the total mass for the car is 860 kg and the total mass for the truck is 4060 kg. The collision time is at 0.140 s.

I just need help on part i-l, I'm not sure what to do at this point. Here

At the moment of the collision, each driver has a velocity, and shortly after the collision, you can assume that they have zero velocity (if the seatbelts worked!). So, there's been an impulse that pushed a driver from moving to completely still.

Does that help?
 
At the moment of the collision, each driver has a velocity, and shortly after the collision, you can assume that they have zero velocity (if the seatbelts worked!). So, there's been an impulse that pushed a driver from moving to completely still.

Does that help?

Makes sense. How would I calculate the impulse of it for both the car and the truck?
 
Makes sense. How would I calculate the impulse of it for both the car and the truck?

Impulse is force times the time applied. You know the time the force was applied, and to calculate the force, you have the masses of the drivers and cars, as well as the change in velocities that they underwent (some speed to nothing)
 
stuck on this linear systems thing

k so I have this pentagram thing. can't really draw it right now but the top three points have an input and the bottom two are output. I'm given values for all 5 points. all the lines between two points are labeled as a. a1-5 are the perimeter lines. there's a 6th line, a6, that stretches from the top left and right points.

I have to solve for the a's. I guess I'm just confused because I have no idea about the flow. I've tried a whole bunch of different combinations as to what direction the data goes and when I solve when I'm given values for two a lines, one of the lines give me a negative number.

I think this is similar to sample traffic flow questions on the web but eh, they all give the direction in between nodes so it's easy to tell what's an input and what's an output for each node
 
It's been forever since I've done partial derivatives. Could someone help with this?

I have this partial derivative dA(z)/dg2

A(z) = 1 - sum(a[k]*z^-k), k = 1 -> 2 or A(z) = 1 - a[1]*z^-1 - a[2]*z^-2

g2 = -a[1] / (1 + a[2])

I don't really know where to start with this...
 
It's been forever since I've done partial derivatives. Could someone help with this?

I have this partial derivative dA(z)/dg2

A(z) = 1 - sum(a[k]*z^-k), k = 1 -> 2 or A(z) = 1 - a[1]*z^-1 - a[2]*z^-2

g2 = -a[1] / (1 + a[2])

I don't really know where to start with this...

I don't think A is a function of g2. The problem is that a choice of g2 does not fix a[1] and a[2], and so some change in g2 does not determine a particular change in a[1] and a[2] and so does not determine a particular change in A.

Right? A doubling of g2 could be accomplished by doubling a[1] or by choosing a new a[2] such that (1 + a[2]_new) = 0.5*(1 + a[2]). But these have very different implications for A(z).
 
Not really sure this goes here, but I'll give it a try. I'm thinking of the following problem: you have a random number, and you want to reach that number by adding the same number several times, starting on 1.
So let's say 251 (prime). One way to do this would be, start with 1, sum until 5 (that would be 4 operations). Then you take that 5 and get, idk, 25 (another 4 operations), afterwards you take 25, "multiply" it with 10 (9 ops) and finally you add 1 (1 op). So, the process "costs" 4 + 4 + 9 + 1 = 18 operations with this chain.
I want to know if this problem has a name, and in that case, if an algorithm to minimize operations exists.
My reason is basically copy and paste, suppose you want to copy a word X number of times, what would be the most "efficient" way to do it.
Thanks!
 
Not really sure this goes here, but I'll give it a try. I'm thinking of the following problem: you have a random number, and you want to reach that number by adding the same number several times, starting on 1.
So let's say 251 (prime). One way to do this would be, start with 1, sum until 5 (that would be 4 operations). Then you take that 5 and get, idk, 25 (another 4 operations), afterwards you take 25, "multiply" it with 10 (9 ops) and finally you add 1 (1 op). So, the process "costs" 4 + 4 + 9 + 1 = 18 operations with this chain.
I want to know if this problem has a name, and in that case, if an algorithm to minimize operations exists.
My reason is basically copy and paste, suppose you want to copy a word X number of times, what would be the most "efficient" way to do it.
Thanks!

It's not clear but I think you're saying that you start with 1 and can add any number less than or equal to what you've got, and you're trying to reach some target with as few additions as possible.

The fastest you can reach any power of two will be to just double your number repeatedly. For targets that are not powers of two you go to the greatest power of two less than the target and then add the difference.
 
It's not clear but I think you're saying that you start with 1 and can add any number less than or equal to what you've got, and you're trying to reach some target with as few additions as possible.

The fastest you can reach any power of two will be to just double your number repeatedly. For targets that are not powers of two you go to the greatest power of two less than the target and then add the difference.
Yes, that's more or less what I was thinking, only you can't add any number less or equal (well, maybe you can but my point is it can be difficult). My problem comes from the last difference. Instead of an number example I'll just go with copy-pasting words.
Let's say you start copying and pasting words using powers of 2 and reach the infimum compared with the number, but the difference between the infimum and your number is big, let's say 153. How would you add those 153 words when you don't have them "stored"? My guess would be start again with powers of 2 and repeat till the difference is a power of 2.
Let me know if something is not clear, the problem is a little complicated and english is my second language so it's likely what I wrote is not entirely comprehensible.
EDIT: I think the solution is made easier if you can store powers of 2 somewhere so you don't have to "construct" them again
 
Not really sure this goes here, but I'll give it a try. I'm thinking of the following problem: you have a random number, and you want to reach that number by adding the same number several times, starting on 1.
So let's say 251 (prime). One way to do this would be, start with 1, sum until 5 (that would be 4 operations). Then you take that 5 and get, idk, 25 (another 4 operations), afterwards you take 25, "multiply" it with 10 (9 ops) and finally you add 1 (1 op). So, the process "costs" 4 + 4 + 9 + 1 = 18 operations with this chain.
I want to know if this problem has a name, and in that case, if an algorithm to minimize operations exists.
My reason is basically copy and paste, suppose you want to copy a word X number of times, what would be the most "efficient" way to do it.
Thanks!

Let x = floor( log2(N)) -1 , the number of operations = x + sum ( digits of N in binary) . In your example, N = 251 = 0b1111 1101, number of operations = 6+7 = 13. Basically, you do ((1+a_1)*2+a_2)*2... a_n is the binary digit at n-th position.

How to prove it's minimal though...
 
Let x = floor( log2(N)) -1 , the number of operations = x + sum ( digits of N in binary) . In your example, N = 251 = 0b1111 1101, number of operations = 6+7 = 13. Basically, you do ((1+a_1)*2+a_2)*2... a_n is the binary digit at n-th position.

How to prove it's minimal though...

This will be the fastest way to construct a number if you can only ever double your number or add 1. But it's not the fastest if you can also multiply your number by some factor k (at a cost k-1 rather than at a cost 1).

For example, suppose your target is of the form 2^n - 1, where n is large and even. That is, the target's binary representation is a long, even-length string of 1s. Then your method constructs the number in I believe 2n steps (I think you're counting the initial 1 as a step). But with only about 1.5n steps we can construct the alternating string 101010101...01, which we can multiply by 3 to obtain the target.
 
This will be the fastest way to construct a number if you can only ever double your number or add 1. But it's not the fastest if you can also multiply your number by some factor k (at a cost k-1 rather than at a cost 1).

For example, suppose your target is of the form 2^n - 1, where n is large and even. That is, the target's binary representation is a long, even-length string of 1s. Then your method constructs the number in I believe 2n steps (I think you're counting the initial 1 as a step). But with only about 1.5n steps we can construct the alternating string 101010101...01, which we can multiply by 3 to obtain the target.

I think you are right, so factorization first.
 
Unless I'm mistaken, this example disproves the power of 2 method. That leaves the problem of finding a general algorithm that works with any given number, which I cannot think of.
We want 27, so:
- First method: get 3, then get 9 and finally reach 27
1+1+1 = 3
3+3+3 = 9
9+9+9 = 27
Total: 6 ops
- Second method: work with powers of 2, assuming no storage
1+1 = 2
2+2 = 4
4+4 = 8
8+8 = 16
1+1 = 2
2+2 = 4
4+4 = 8
16+8 = 24
1+1=2
24+2=26
26+1=27
Total: 11 ops
- Third method: work with powers of 2, and you can store every power of 2 you compute.
1+1 = 2
2+2 = 4
4+4 = 8
8+8 = 16
16+8 = 24
24+2 = 26
26+1 = 27
Total: 7 ops
 
Trying to compare the variances of some estimators, but I'm confused by my teacher's steps. The estimators come from an exponential distribution.

D6iLISK.png


I get the variance of the first estimator. What I don't understand is why adding var(x1 + x2) is equal to 2 theta instead of 2 theta squared. Didn't we just prove that var(x1) = 2 theta squared? Am I forgetting something in adding variances that makes the square go away?
I got up the nerve to ask my instructor and turns out he made a mistake on his slides.
 
I think I got the algorithm. Basically you want to find the greatest divisor of the desired number X, let's call it D. If it's a prime number, you take X-1. Then your number is constructed by n additions of D (n-1 operations, n if X is prime). Repeat process with D. Also 2 must be hard coded to be 1+1. I guess I need to prove it's the most efficient method, gonna see how that goes.
Thanks Gotchaye and luoapp, you made me think in a different direction and that got me to the solution.

anybody good with cryptography?
I don't remember much about matrices, but if A^-1 is 2x2 and B is 1xn, how can you multiply them? Unless you transform the message so it fits a (n/2)x2 matrix.
 
So i got Story Problem

There is 4 Different city in a state (City A, City B, City C, City D). The Governor decide to chose 4 people from each city. The person that he pick will represent 4 ethnic group. Namely White, African, Asian, and Hispanic, of the said city.

From this 16 people, The governor then divide them into 4 groups of 4. The group must consist 4 people from different city and same 4 people must come from different ethnic group.

How many combination of group that The Governor can make?

Sorry for broken English.
 
So i got Story Problem


If I'm not mistaken, your problem is equivalent to counting Latin squares where rows = "city", columns = "ethnicity", and symbols are group labels.

There are 576 4x4 Latin squares. We don't care about the labels for the groups so we divide by the number of permutations of group labels. The answer is 576/4! = 24.
 
The worst thing about taking an exam is to not get enough sleep. I am having an written exam about mathematical analysis in a few hours. I just want to share my pain. Well. To be honest topology rocks, but that written exam won't.

Anyway, what is the difference between calculus and mathematical analysis? In America, one of the standard undergrad course is calculus instead of analysis, but isn't calculus a subset of analysis?
 
If I'm not mistaken, your problem is equivalent to counting Latin squares where rows = "city", columns = "ethnicity", and symbols are group labels.

There are 576 4x4 Latin squares. We don't care about the labels for the groups so we divide by the number of permutations of group labels. The answer is 576/4! = 24.

Thanks you very much. I did brute force and got 24 as answer. But not sure how to do it mathematically

Anyway to know all possible combination?
 
Thanks you very much. I did brute force and got 24 as answer. But not sure how to do it mathematically

Anyway to know all possible combination?


I would use the idea of reduced Latin squares defined on the page I linked. A reduced Latin square has 1234 as the first row and column, such as these:


f54c868d5fe682d273dfaaf4c20c67ec.png



Since the 1st row and column are fixed, your choices are limited, and it isn't hard to come up with the 4 reduced squares, and to see why they are the only 4.

Once you have those 4 reduced squares, every Latin square can be obtained by permuting rows and columns of a reduced Latin square. In addition, we don't care about labels, so without loss of generality we can leave the top row as 1234. Therefore, all the combinations we want can be obtained by permuting the bottom 3 rows.

Since there are 4 reduced Latin squares, and 3!=6 ways to permute the bottom 3 rows, there are a total of 24 combinations.

To list all those combinations you would construct the 4 reduced squares and write out the permutations of their bottom 3 rows.
 
i think i got the answer right

but when i enter it into the webassign system it says its wrong

so i just want to make sure whether or not i done goofed

You can make the maximum even larger and the minimum even smaller by choosing the right combinations: 8(+2) - 4(-1) = 20, and 8(-2) - 4(+1) = -20.

In your work, you wrote,

x^2 + x^2/4 = 5

then,

4x^2 + x^2 = 5.

The RHS should be 20 (which you did write later).
 
You can make the maximum even larger and the minimum even smaller by choosing the right combinations: 8(+2) - 4(-1) = 20, and 8(-2) - 4(+1) = -20.

In your work, you wrote,

x^2 + x^2/4 = 5

then,

4x^2 + x^2 = 5.

The RHS should be 20 (which you did write later).

oh wow, i hadn't realized you can mix and match the x and y values like that

mind = blown LOL

thanks a bunch!
 
Okay GAF, I'm studying for a Numerical Analysis final and on one of the practice finals, this question comes up

4lRG5ou.png


Here's my shot at it:
Every night that a picture of the thief isn't taken, you'll know whether or not the theft happened by the presence of the newspaper in the photo.

Therefore, the first night start at time [(3+7)/2 =] 5. Lets set x0 = 5.

If the newspaper is still there, then we know the theft occurs between 5 and 7.

If the newspaper is not there, then we know the theft occurs between 3 and 5.

Whatever the outcome, have the next photo taken at (x0 + y0)/2, where y0 is dependent on whether or not the newspaper is there. This will be x1.

Generally, we get xN = ( xN-1 + yN ) / 2, where yN is the other value that is not x0 within the time frame we know the theft occurs in.

We will have a photo of the thief by x3 at most, thus it will take at most 4 nights before a photo of the thief is taken.
I'm not great at writing proofs, so if anyone can tell me how to improve this, or if there's a better approach, it'd be much appreciated.
 
Okay GAF, I'm studying for a Numerical Analysis final and on one of the practice finals, this question comes up

[/IMG]http://i.imgur.com/4lRG5ou.png[/IMG]

Here's my shot at it:

I'm not great at writing proofs, so if anyone can tell me how to improve this, or if there's a better approach, it'd be much appreciated.

With your algorithm, the maximum is 3 nights, and I don't think that can be improved. The problem will be more interesting if ask for the minimal average number of nights instead of the maximum.
 
Status
Not open for further replies.
Top Bottom