Pardon me, would you have any Grey Poupon?
The Forum > Math & Science > Math Problem Thread
Page: 1 2 3 ... 16 17 18 19 20 ... 30 31 32
 Nerd. Nitpicky. Thought it went without saying. So it turns out that OpenCL doesn't have any good random function. I could have sworn that I saw something in its specification for it, but I seem to be wrong. Oh well. [Quote] [Link]
 Hydrogen777 Administrator5987 Posts12 Ineo 14:3 - 16.81.71536.453 days ago Sorry, it just came across as pompous to me. XD It's hard to gauge tone through text, and admittedly I have a negative bias towards NP as being a haven for ego and condescension, which isn't really fair. I'm pretty sure I've nailed the number to five significant digits, though that's not enough for the Project Euler problem. [Quote] [Link]
 Couldn't you just calculate the probabilities of each possible value of I, and store that in a 2D array? For questions 200+, brute force is never the right way. [Quote] [Link]
 Hydrogen777 Administrator5987 Posts12 Ineo 14:3 - 17.36.76536.426 days ago That's a sensible solution. Wait, why 2D? [Quote] [Link]
 Erm, no not 2D. I was thinking [[1, a], [2, b], [3, c], etc.] but that's pretty stupid, you can go (position+1) instead. :) [Quote] [Link]
 Hydrogen777 Administrator5987 Posts12 Ineo 14:3 - 18.34.70536.377 days ago Ah, some sort of list of ordered pairs. Though given that there are only a few thousand possible values, I think you're right to go with an array, as you suggested. [Quote] [Link]
 As an approach, why not go with the "mean of square minus square of mean" definition, and work bottom-up. Use an array for each value of I as suggested, it does need to be 2d so you can store the frequency, value and value squared for each result on Id20. Use these to generate the summed values for D (remembering to account for the frequency) and so on up the chain. Edit: I'm havering. You only need the sum and sum of squares stored at each level, plus the overall divisor. [Quote] [Link]
 If you are doing the massively parallel random sample method, I suggest making sure you use a variance algorithm that does not require you to store all the data before processing it. http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#On-line_algorithm [Quote] [Link]
 Deckmaster-240.5 Posts12 Ineo 14:4 - 7.54.56535.917 days ago Nonono, I never meant that all the data needed to be saved before processing it, but rather that combining the data gathered from each process at the end ended up being serial, regardless of the algorithm used for calculating variance. Any serious attempt I made at solving the problem would involve analyzing how the variance breaks down and attempting to eliminate large portions of the variance calculation by doing them via known formulae instead of the entire simulation. Edit: Oh, and memoization, if applicable. [Quote] [Link]
 Does anyone have a good way at remembering prime numbers? [Quote] [Link]
 I have 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, and 31 buried inside me. The rest come by feel. A number, n, is possibly a prime if: n/6 has a remainder of 1 or 5 n ends in 1, 3, 7, or 9. [Quote] [Link]
 Also, when mentally checking prime numbers, you only have to check divisibility up to the square root. So, if you're testing, say, 137, you know that if it is composite there must be a factor less than 12 that divides it ( 122 == 144), so you only have to check divisibility by 2,3,5,7, and 11. 2 and 5 are obvious, 3 is straightforward (sum of the digits 1+3+7 = 11 = not divisible by three), so you only have to 'check' 7 and 11. If you've got a feel for your multiplication tables, that should be pretty quick. (140 is an obvious multiple of 7, 140-137 = 3 = not divisible by 7, 137-121 = 16 = not divisible by 11, so 137 is prime). [Quote] [Link]
 There is a 1/60th of a degree difference between two slots on rotating disks in a device used to measure the speed of light through different gases. Given the speed of the disks and the distance between them, shouldn't it be very easy to determine the speed of light through the particular gas? I mean, I don't see much higher level math here, the highest seems to just be some larger end numbers and trig. [Quote] [Link]
 Wouldn't it be an inaccurate approximation of the speed of light? The only way I see it is to record the time when the light passes through a disk. [Quote] [Link]
 I have to solve this equation with absolute value: |x+3|+|x-1,5|=5 I am not so sure about how to go about this, my teacher didn't explain absolute values very well and the book we have in class mentions almost nothing on the subject. [Quote] [Link]
 Hydrogen777 Administrator5987 Posts12 Cresco 14:4 - 10.22.15445.783 days ago I actually am not sure of the general solution to those sorts of equations. What I would do is consider the possible cases separately: first assume that x > 1.5. Then assume -3 < x <= 1.5. Lastly, assume x <= -3. If x > 1.5, you can simply drop the absolute values because both terms are non-negative. If -3 < x <= 1.5, then the left absolute value term is positive, so you can drop that absolute value and then solve the equation as you normally would with an absolute value problem. If x <= -3, then the first term can be replaced by "-x - 3", and the second term can be replaced by "-x + 1.5" (you can reason through why yourself, or ask me to explain why). In each case, make sure that the answers you get when you solve for x match your assumption (so for the first case, throw out any answers that are less than or equal to 1.5). I hope that helps. Perhaps someone else can come up with a more general method for solving it. Here's a similar example I contrived to illustrate the process without giving the answer away: |x| + |x - 2| = 2 First assume x > 2. x + x - 2 = 2 2x = 4 x = 1/2 Since we assumed that x > 2, we can't use this solution.Next assume x > 0 but x <= 2. x + |x - 2| = 2 |x - 2| = 2 - x x - 2 = 2 - x OR x - 2 = x - 2 In the first case, 2x = 4, so x = 1/2 (valid solution) The second case yields 0 = 0, which gives us infinitely many solutions (so any value of x that is > 0 but <= 2 is a solution)Lastly, assume that x <= 0 -x + -x + 2 = 2 -2x = 0 x = 0 (valid solution)If we combine all these answers, we learn that the value of x is anything from 0 to 2 (i.e. the closed interval [0, 2]). I guess this was actually a bad example because the solution to your problem is simpler than this one (it only has two distinct solutions, not infinitely many.) But I hope this example at least shows you how to proceed. [Quote] [Link]
 Blake Webmaster2082 Posts12 Cresco 14:4 - 10.75.5445.757 days ago jaxxie said:I have to solve this equation with absolute value: |x+3|+|x-1,5|=5 I am not so sure about how to go about this, my teacher didn't explain absolute values very well and the book we have in class mentions almost nothing on the subject. For the general approach for these, let's start with a simpler example: |x + 1| = 2 For each absolute value, compute the answer by removing the absolute value and also compute it again by flipping the sign of everything else. valid answers are: x + 1 = 2 x + 1 = -2 x = 1 or -3 Flipping the sign of everything else is the most intuitive, but flipping the sign of the absolute value expression is essentially the same thing x + 1 = 2 -(x + 1) = 2 --> -x - 1 = 2 If there are multiple aboslute value expression, then you need to flip the signs for each possible combination. That's 2n possible combinations. |x+3|+|x-1,5|=5 creates the following 4 possible x + 3 + x - 1.5 = 5 -(x + 3) + x - 1.5 = 5 x + 3 + -(x - 1.5) = 5 -(x + 3) + -(x - 1.5) = 5 simplify each: 2x + 1.5 = 5 0x + 1.5 = 5 (invalid, no solution for this combination) 0x - 1.5 = 5 (also invalid, no solution for this combination) -2x - 1.5 = 5 solutions: x = 1.75 x = -3.25 double-check: |x+3|+|x-1,5|=5 |4.75| + |-.25| = 5 (yup) |-.25| + |-4.75| = 5 (yup) [Quote] [Link]
 Hydrogen777 Administrator5987 Posts12 Cresco 14:4 - 12.67.87445.66 days ago Yeah, that's probably the better approach. [Quote] [Link]
 Even though Blake's methods were more what I was looking for, you managed to explain something that I believe is what the teacher was trying to explain at the black-board that one time. Thank you both very much. That cleared up the situation and explained everything I needed to know about this type of equations for now. I don't know what I would've done without you. [Quote] [Link]
 So I cannot, for the life of me, solve this simple problem. I need to find the limit of sin(x)/((2x^2)-x) as x approaches 0. I can tell graphically that it is negative one. But I need to prove algebraically with the properties of limits and the limit of sin(x)/x which equals one. Is that understandable? [Quote] [Link]
 Factor the x out of the denominator, use the lim sin(x)/x property, then replace x with 0, as normal. [Quote] [Link]
 If you factor it out, don't you still have an x in the denominator, so why doesn't that make it undefined? I think I need a step by step to see how this works. [Quote] [Link]
 SporeInsanity said:So I cannot, for the life of me, solve this simple problem. I need to find the limit of sin(x)/((2x^2)-x) as x approaches 0. I can tell graphically that it is negative one. But I need to prove algebraically with the properties of limits and the limit of sin(x)/x which equals one. Is that understandable? limx->0 sin(x)/((2x^2)-x) limx->0 sin(x)/(x(2x-1)) limx->0 1/(2x-1) = -1 [Quote] [Link]
 Now I see it, I don't know why I couldn't before. EDIT: Also, when is the Sandwich theorem applicable? I'm just curious. [Quote] [Link]
 Blake Webmaster2082 Posts12 Vigeo 0:1 - 9.19.68442.834 days ago I would have just used l'Hopital's for this sin(x)/(2x^2 - x) --> cos(x)/(4x - 1) --> -1 [Quote] [Link]
Page: 1 2 3 ... 16 17 18 19 20 ... 30 31 32
The Forum > Math & Science > Math Problem Thread