|
He still has a better chance for an answer here, but the Math forum would give him less abuse and better karma.
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|
peterchen wrote: He still has a better chance for an answer here
Might as well open up the Lounge to programming questions then.
Cheers,
Vikram.
"whoever I am, I'm not other people" - Corinna John.
|
|
|
|
|
peterchen wrote: but the Math forum would give him less abuse and better karma.
whoa whoa whoa. you mean the votes actually do something? like, make me Rise and Fall amongst the ranks of all the CPians?
|
|
|
|
|
Yes, at the end of the universe, The Great Maunder will count your fives and ones and theywill determine whether you come back as hamster. Or badger.
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|
Ah, but which one is better? Surely the most dedicated of CP members would like to give back something to CP (in the form of pedal power).
|
|
|
|
|
As you know, hamster run the servers (more responsibility, but then, Dave comes whipping you about daily), whereas badgers only run the signatures of.. some... members........
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP
Linkify! || Fold With Us! || sighist
|
|
|
|
|
|
Are you using the product rule when you take the derivative?
And I get on my knees and pray.
We don't get fooled again.
|
|
|
|
|
well the derivative itself is correct. i got a friend and a online thing to check that for me
and, i dont know what the right answer is. its an online submission thing, and it only says right/wrong not which part.
|
|
|
|
|
nevermind. aparently, i dont know how to add
|
|
|
|
|
y = (8 - 8pi)x + 32 pi<sup>2</sup> ??
|
|
|
|
|
yeah, correct. as i said above, i seem to not know how to add
|
|
|
|
|
I agree... as long as you mean the last term is 32(pi)^2
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
As already pointed out, there's a maths forum but here goes
y = f(x)
slope M = dy/dx
You have one point on the line - (4PI, f(4PI)), and since it is the tangent to the curve, its slope will be -1/M it has the same slope. Just use the slope-point equation for the straight line (IIRC, it's y - y1 = m(x - x1) ).
To find m at the point, simply substitute for x and y in dy/dx.
Please post in the maths forum in future. HTH.
Nostalgia is a very powerful emotion.
-- corrected slope of tangent, which I misread as normal. Thanks to Ryan. modified at 4:57 Wednesday 11th October, 2006
Cheers,
Vikram.
"whoever I am, I'm not other people" - Corinna John.
|
|
|
|
|
Vikram A Punathambekar wrote: Nostalgia is a very powerful emotion
thanks, already got it. as i said above(2 times now lol), i seem to have lost all ability to do simple addition
|
|
|
|
|
Vikram A Punathambekar wrote: since it is the tangent to the curve, its slope will be -1/M.
Not quite. If you know the gradient of a point on the curve, the gradient of the tanget line is equal to the gradient of the curve at the point of the tangent. The gradient of the normal to the line at the given point is -1/m.
The equation of tangent the line is y = f'(x<sub>0</sub>)(x - x<sub>0</sub>) + f(x<sub>0</sub>) where x<sub>0</sub> is the point he wants the tangent at and f'(x) is the first derivative of the curve.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks, mate, I corrected my post.
I misread tangent as normal.
Cheers,
Vikram.
"whoever I am, I'm not other people" - Corinna John.
|
|
|
|
|
Vikram A Punathambekar wrote: Thanks, mate, I corrected my post.
No worries
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
First I'll rephrase the question:
f(x) = g(x).h(x); where
g(x) = x; and
h(x) = 8cos(x) - 2sin(x)
f'(x) = ?
Now some basic calculus results you should know by heart:
sin’(x) = cos(x); and
cos’(x) = -sin(x)
Finally the product rule:
(g(x).h(x))’ = g’(x).h(x) + g(x).h’(x)
So in our case:
g’(x) = 1; and
h’(x) = -8sin(x) – 2cos(x)
Thus:
f’(x) = g’(x).h(x) + g(x).h’(x)
= 1.(8cos(x) - 2sin(x)) + x.(-8sin(x) – 2cos(x))
= 8cos(x) - 2sin(x) – 8.x.sin(x) – 2.x.cos(x)
= cos(x).(8-2x) – sin(x).(2+8x)
Now you can use f’(x) to find the gradient of the tangent and any point.
Once the gradient is known all that needs to be done is to plug it into y=mx+c and choose a c so that it touches the curve at the desired location.
Steve
|
|
|
|
|
Image that we have an array of integers, and we want to know any 2 numbers that their sum is x, using O(n), is it possible ?
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
sounds like a programming question!
Is this a homework?
(..I don't think i am in The Lounge anymore...")
Anyway, Are there negatives values in that array?
-- modified at 6:10 Wednesday 11th October, 2006
|
|
|
|
|
That's what pop into my mind:
<br />
sumx(A[],x)<br />
{<br />
Array S[x/2];<br />
for(i=0,i<S.lenght;i++) S[i]=0;
for(i=0,i<A.lenght;i++)<br />
{ <br />
a=A[i];<br />
if(a<0 || a>x/2) continue;<br />
if(a<x/2) S[a] |= 1;<br />
if(a>x/2) S[x-a] |= 2;<br />
}<br />
return S;<br />
}<br />
You get an array S.
For a number k<(x/2) you have:
if S[k] is 0 then neither number k, nor (x-k) is in the input array.
if S[k] is 1 then only number k was in the input array.
if S[k] is 2 then only number (x-k) was in the input array.
if S[k] is 3 then k and (x-k) was in the input array. The sum of those two is k+(x-k)=k+x-k=x. bingo!
For a number j>(x/2) you have k=(x-j) and continue as above.
The array S can be more comlex, like storing the index of two number in the input array A, if you like. Dealling with negative numbers as well might need a more complex aproach.
|
|
|
|
|
Small bug:
Kastellanos Nikos wrote: if(a<0 || a>x/2) continue;
if(a<0 || a>x) continue;
To put the algorithm in simple words, do a counting sort for numbers <x , so O(n).
lookup is O(1) for a hash table; will have to do x/2 lookups, so O(x).
Overall O(x+n).
The complexity of algorithm is O(x+n); If x is reasonably small, then the algorithm is good enough.
If x>n*log n; a quick sort followed by a binary search is better, but will be managable only in O(n*log n)
|
|
|
|
|
i have written a code to find the determinant of a matrix, i would like to ask is it fishy or can it be devoloped? thanks to you all for replies... my code is written in vb.. and one more thing... i wonder is it the right place to post? thanks anyway...
here is my code...
Sub deneme()
Dim a(1 To 10, 1 To 10) As Double
Dim t As Integer
a1 = 1
t = 0
GoTo git
For i = 1 To 3
For j = 1 To 3
t = t + 1
a(i, j) = t
Next j
Next i
git:
a(1, 1) = -1
a(1, 2) = 0
a(1, 3) = -50
a(2, 1) = 1
a(2, 2) = 4.92
a(2, 3) = -2
a(3, 1) = -1.4
a(3, 2) = 3
a(3, 3) = 1
For i = 1 To 3
For j = 1 To 3
If i = j Then
If a(i, i) = 0 Then GoTo devam
For g = i + 1 To 3
tut = a(g, i)
For b = 1 To 3
a(g, b) = a(g, b) - (a(i, b) * (tut / a(i, i)))
Next b
Next g
End If
Next j
Next i
devam:
For i = 1 To 3
For j = 1 To 3
Cells(i, j) = a(i, j)
Next j
Next i
For i = 1 To 3
a1 = a1 * a(i, i)
Next i
Cells(1, 10) = a1
End Sub
|
|
|
|
|
Well I don't know what your formula does, but why not use the Laplace Expansion?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|