|
![]() |
|
| Author |
|
|||||||
|
Strik3r
Posts: 1209
Location: Gold Coast, Queensland
|
hey, i need some maths help.
i need to work out an equation in terms of X and Y. (ie. what manipulation do you perform on x and y to give z that will work for all of the below examples (and more). also some background information: x can be of any positive value, y will be a number between 1 and 12 (inclusive) and Z will always be equal to or less than X. From the work i did today, the equation will be something similar to Z = X - ( ((y-1)/4) + 1 ). this works for some values of x and y but not all. Any ideas ? here is the data set. X Y Z 1 1 1 1 2 1 1 3 1 1 4 1 1 5 1 1 6 1 1 7 1 1 8 1 1 9 1 1 10 1 1 11 1 1 12 1 2 1 2 2 2 2 2 3 2 2 4 2 2 5 2 2 6 2 2 7 2 2 8 1 2 9 1 2 10 1 2 11 1 2 12 1 3 1 3 3 2 3 3 3 3 3 4 3 3 5 3 3 6 3 3 7 3 3 8 2 3 9 2 3 10 2 3 11 2 3 12 1 4 1 4 4 2 4 4 3 4 4 4 4 4 5 4 4 6 4 4 7 4 4 8 3 4 9 3 4 10 3 4 11 3 4 12 2 |
|||||||
| #0 08:50pm 12/01/06 |
|
|||||||
|
system
|
--
|
|||||||
| #0 |
|
|||||||
|
Cr@ckerJ@ck
Posts: 750
Location: Brisbane, Queensland
|
Right............................
|
|||||||
| #1 08:57pm 12/01/06 |
|
|||||||
|
Strik3r
Posts: 1210
Location: Gold Coast, Queensland
|
oh and i should have mentioned, this deals with integers only. So if you for example have y/4 and y is 5, the result is 4, not 4.25
last edited by Strik3r at 20:59:22 12/Jan/06 |
|||||||
| #2 08:59pm 12/01/06 |
|
|||||||
|
Tanaka Khan
Posts: 1926
Location: Brisbane, Queensland
|
Right............................
|
|||||||
| #3 09:01pm 12/01/06 |
|
|||||||
|
Strik3r
Posts: 1211
Location: Gold Coast, Queensland
|
solved: answer = Z = X - Y^2/64
|
|||||||
| #4 09:24pm 12/01/06 |
|
|||||||
|
Tanaka Khan
Posts: 1927
Location: Brisbane, Queensland
|
I knew that,but i wanted you to work it out for yourself.
|
|||||||
| #5 09:31pm 12/01/06 |
|
|||||||
|
Habib
Posts: 76
Location: Brisbane, Queensland
|
err... how does that work Striker? If x=1 and y=8, by your formula
z = x - y*y/64 z = 1 - 8*8/64 z = 1 - 64/64 z = 1 - 1 z = 0 |
|||||||
| #6 10:09pm 12/01/06 |
|
|||||||
|
Habib
Posts: 77
Location: Brisbane, Queensland
|
I'm not sure if you mean any division results in trucation of the fraction part? Or do you mean round?
I assumed truncation for any division operation for simplicity, and devised a formula in Excel that works. Copy the data into excel, so that the first row of data is in A2,B2,C2 for X,Y,Z respectively. The following formula can be used to calculate Z: A2 - TRUNC(B2/8) - (TRUNC(B2/12) * TRUNC(A2/3)) + (TRUNC(B2/8) * TRUNC((1-LOG(A2,10))/1)) Or, written normally z = y - (y/8) * (x/3) + (y/8) * ((1-log(x))/1) which simplifies to z = y + (y/8) * (((1-log(x))/1) - (x/3)) Note that I exploited the integer-only way division works by dividing (1 - log(x)) by 1. I tried using your original formula with both round() and trunc() as a starting point, but it didn't seem to be close? Oh well, if it turns out you meant round(), then it shouldn't be too hard to adjust the formula. |
|||||||
| #7 10:12pm 12/01/06 |
|
|||||||
|
mission
Posts: 2708
Location: Brisbane, Queensland
|
Nerds.
|
|||||||
| #8 10:13pm 12/01/06 |
|
|||||||
|
Boofe
Posts: 1002
Location: Brisbane, Queensland
|
Nerds. They just understand it! We DONT. Thats a simplified answer.. |
|||||||
| #9 10:18pm 12/01/06 |
|
|||||||
|
paveway
Posts: 3177
Location: Brisbane, Queensland
|
striker wanted to show the internets his skills
|
|||||||
| #10 10:23pm 12/01/06 |
|
|||||||
|
whoop
Posts: 9719
Location: Brisbane, Queensland
|
http://users.bigpond.net.au/ritsuko/emoticons/paveway.gifpaveway does not approve
|
|||||||
| #11 10:33pm 12/01/06 |
|
|||||||
|
system
|
--
|
|||||||
| #11 |
|
|||||||
|
| ||||||||