Jump to content

timo

Senior Members
  • Posts

    3451
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by timo

  1. timo

    Vibration

    Yes, the question was serious. You cannot assume everyone here had his/her physics education in english and knows the common abbrevations. In fact, the use of abbrevations usually is a bad idea when there's a wide target audience. Harmonic motion is the result of movement against a force F = k x, where x is the displacement from some origin and k some constant. I don't see why this should be the case for a combustion engine, but I cannot prove that it isn't the case. If your textbook sais it was the case, then it's probably a reasonably good approximation, at least. It's certainly not true for phases of acceleration (of the car) since harmonic motion implies a constant frequency which clearly isn't the case when you hit the gas pedal.
  2. timo

    Vibration

    - What is "SHM" ? - The 1 is the maximum value that |cos(something)| can have. - |cos(something)| = 1 implies that either cos(something)=1 or cos(something)=-1. Since I don't understand the question, I cannot tell you why it is -1. But you could probably plug in both and see which gives a smaller value for t. I'd guess that cos(something)=1 would be the case for t=0 s and therefore give the smaller time. But then, I don't really understand the question, anyways.
  3. Yes. On the left.
  4. timo

    0/1

    Not sure if you were serious, so I'll make my statement more explicit: 0/1 stands for [math] 0 \cdot 1^{-1} = 0 \cdot 1 = 0 [/math]. 0/0 doesn't stand for anything since [math] 0^{-1} [/math], the multiplicative inverse of 0, does not exist. It has nothing to do with binary: [math] 0/4 = 0 \cdot 4^{-1} = 0 \cdot 0.25 = 0 [/math].
  5. timo

    0/1

    Division [math]a/b[/math] usually (and particularly in the case of the real numbers) means multiplication with the inverse, i.e. [math]a/b= a \, b^{-1} [/math] where the inverse [math]b^{-1}[/math] of [math]b[/math] is defined by [math] b \, b^{-1} = b^{-1} \, b = 1 [/math]. The inverse of 1 is 1 (proof: 1*1 = 1*1 = 1), 0 has no inverse (proof: [math] 0 \, x = x \, 0 = 0 \ \forall \, x \in R [/math]).
  6. I suppose it's "special theory of relativity", even though "theory of special relativity" sounds more familiar to me (probably because that's what it's often called in this forum). Reasons: - The word-by-word translation from german would be special relativitytheory, "special theory of relativity" seems to come closer to that. - The Wikipedia link Cap'n gave also uses that formulation. - It makes more sense: It's a simplification of the theory of relativity for special cases, not a different theory of relativity.
  7. In short: Yes, that's possible. - Strictly speaking, mass is one of the terms that contribute to energy, hence it cannot be converted into it but already is a part of it. What does happen is that heavy particles (e.g. uranium atoms) can decay into pieces which have a combined mass which is less than the mass of the original particle (the uranium atom). To conserve energy you therefore have to have some other form of energy involved, for example kinetic energy of the decay products. You could call that a conversion from mass to kinetic energy if you want. - The reverse process is also possible in general. You could even say that converting kinetic energy to mass is the main idea of particle accelerators. What you do in particle accelerators is colliding relatively light particles with very high kinetic energies. Sometimes, the product of the collision will be a particle that's heavier than the summed masses of the original particles. In practice, the created heavy particle often will not live long (because it can decay into lighter particles again), but it's sometimes possible to tell from the results of the reaction that a certain heavy particle must have existed. Example: At LHC (a particle accelerator that is due to start running at the end of this year) one of the most important experiments is looking for a particle called "Higgs-Boson". This particle is expected to have a mass of ~ 120 GeV/c². What LHC does is colliding protons with a mass of ~ 1 GeV/c² with very high kinetic energies in the order of 1000 GeV/c². What is hoped for is that these kinetic energies (and the number of collisions) will be sufficient to produce enough Higgs-Bosons so that their decays can be seen and distinguished from the decays of other particles (i.e. that the number of Higgs-Bosons is sufficient to make a statistical statement). If that is possible, then this will be considered a proof for the existance of the Higgs-Boson and we will claim that "we have seen" it - even though it's nothing like what you'd normally put in context with the term "I have seen".
  8. @Aeternus: I've only glanced at your code so far. Since this is a programming challenge and not a group programming project (I've thought about making it a group project but then realized to success of past sfn-inspired projects and skipped the idea) I don't want to give out too much information too early. Also, nothing guarantees that my ideas are better than those of others, so I'd also risk shutting down potentially good ideas. So here's just two small remarks on your code: - You can trick the integers of Java into unsigned ones by "long l = ( i & 0xffffffffL)". You might be able to go to base 4*10^9 that way. - What is the biggest factorial you realistically expect being able to calculate? Could that result in some optimization of your code, particlarly the multiplication ?
  9. WEEK 1+ FEEDBACK AND ADDITIONAL INFORMATION -------------------------------------------------- Lost my text due to hitting the page-back button on my mouse . So let's make it short: - The problem stands as is, which particularly includes the restrictions to use Java and not to include the BigNumber class. Pls don't post solutions to different problems - I do know that you can get 100000! very quickly with a single line in Mathematica. - For the basic algorithm to calculate n!, two different styles of solution have been presented. A recursive approach by Bascule and an iterative solution by RocketMan. Both have their own strength and weaknesses: Recursions tend to be more stylish and read more clearly while iterations tend to be faster and less ressource-intensive. It's your choice what you prefer and why. - The basic data structures you are allowed to use only allow calculations up to about 20!. To get the factorial of bigger numbers, you have to write your own structures which support bigger numbers. This is in fact the main objective in this challenge. There's different ways to do so: * You could try operating on the strings directly, starting with "1" and then consecutively multiplying the string by increasing numbers. * You can write your own class supporting big integers. These will probably store the number as digits in a base B. The possible choices of B that come to mind first are either 10^n (which makes conversions to the resulting string relatively easy) or 2^n (which is similar to the base internally used by the computer and therefore seems to be the fastest choice). Aeternus has taken a very interesting choice which basically is a 10^n one, but with a factor of 2 that can be converted to a factor of 1 relatively easy and also slightly decreases the number of digits needed (therefore decreasing the number of steps the computer must make to multiply the number). I do not recommend starting with a base that you don't know how to convert to base 10 afterwards, or at least write the translation to a string first. For storing the different digits of the chosen base, I see two main options. Either use an array like Aeternus or use a linked list. Parsing the different digits (for conversion or the mathematical operations) again can either be done recursively or iteratively with again both methods having the same advantages and disadvatages (although they might weight differently, here). - Since a class for arbitrarily big integers already exist in Java, reusability of the code (for example for YT to get really, really large primes) should not be a major concern. It will add to the "flexibility" criterion of the evaluation criteria but realistically, you're not likely to ever use your structure again (unless you find a really great solution, of course).
  10. Looks very nice. I've implemented and tested it. Seems to work fine so far. I plan to test the different codes against each other by running them from a common main prog similar to the one attached in the zip-file above. To automatically test the various codes against each other, that requires that the code actually returns a string rather than printing it to the console and also that the leading zeros of your result are cleaned up (I could do that in the main code, too - but it's an ugly-looking result, anyways).
  11. timo

    Speed of Light

    Imho, calculations is what makes the difference between thought experiments and thoughts.
  12. - You can increase the range. On modern computers, an integer is either 32 or 64 bit which is quite a lot more than 16 bit range. For even larger numbers, you can either check if the language you use supports types with a longer range, or write structures that do so yourself. - You only need to check if a number N divides by any of the primes <N. There's no need to check if a number divides by 9 if it didn't divide by 3. You could keep a list of the primes already found and only check them. In other words, you could replace B% being all numbers from 2 to A%/3 to being all the primes you already found. - You could try finding a function that gives you the current system time before start and after end => saves you using a stop watch.
  13. You've almost found out what the whole challenge is about. Hint: It's not about your love for some programming language.
  14. - Rewrite both functions to y=f(x)=... . - Plot both functions. You can type in "Plot" in Mathematica and then press F1 on the word to call the description of the command to find out how exactly it is used (note: you can also execute the samples in the help file directly by clicking on then and then executing them with shift+enter). - Plotting the functions should give you an idea what the problem "looks like". It will also show that the two functions do not enclose any region at all. Reconsider your problem again from there.
  15. - To get a real number from an expression, use N[expression], in your case N[Tan[45/Pi+Pi/45]]. Alternatively, tell Mathematica that 45 is a real number by typing "45.0", instead. - For the second one, if you're just looking for the approximate area, then how about plotting the curves? You want to transform the equations into a form y=... for that. - If you want to use Mathematica to take a shortcut on your homework: Better screw the idea. It's usually more work to translate a problem to a computer than to do it by hand, that's especially true for homework problems which are designed to be easily done by hand. - Generally, for the 2nd part, when the two curves enclose an area you'd assume them to meet twice, meaning there's two x-values [math] x_1, x_2 [/math] for which [math] y_1(x_1) = y_2(x_2) [/math] and [math] y_1(x_2) = y_2(x_2)[/math] respecitvely, where y1(x) and y2(x) means the two different curves.
  16. - math.java is just the name I gave to the file. It's a pretty empty class except for returning the string "your code comes here" when the method factorial(string s) is called. - I have several reasons why the language is given. Apart from taking spoiler languages like Mathematica that already implement factorials or a large proportion of the code needed, I don't see where any language should offer much over Java. For me, object-oriented languages are all pretty much the same with the differences lying in details that are not relevant here (you will most likely not need operator overloading, you will most likely not need multiple inheritances, ...). - As long as the codes do not become too complex, I do in general not have a problem to port them to Java, myself. But that opens up the question why I should do the porting and not the coder himself. You could ask around for someone more proficient (or interested) in Java who could do that. - In Java, your code would read int out=1; for (int a=1; a<=fact; a=a+1) out = out*a; In other word: Most (if not all) of the control structures you know from VB exist in Java, too. They only have slightly different notations which shouldn't be too hard to figure out (google for java for loop to find out the structure of the loop, for example). Yes, 17! would be your limit.
  17. Slightly off-topic (not sure what the topic is, anyways): I was under the impression that temperature is a scalar. In fact, I think I even read it as an example of a scalar, so it's probably not only an idea of mine. After all, it's just a label for the energy distribution we expect at a certain point in spacetime. Sure, the individual energies depend on the frame, but that's not really something that's specific to relativity - Newtonian mechanics also has frame-dependent energies.
  18. Depends: Why would the product of an even and an odd number be even? In the end, it all boils down to the question what you already accept as being true and what statements you think needs further comments/steps/proofs. For some, the statement that the product of two or more consecutive naturals is even probably wouldn't need any further comment at all. For you, the statement that a product of an odd and an even number is even seems to be enough. Others might want to know why. The next step beyond my little explanation why this is true would be asking why a pair of consecutive numbers is always {odd,even} or {even,odd}. Sidenote: Of couse, the case 0*1 is covered. It's explicitly mentioned.
  19. Given the lack of reaction in here, two non-valid (no conversion from and to string, not the Math.java file given) contributions and the comments here I think it might be time to give out the first hint: Up to what number n do you expect these two pseudo-codes to be able to calculate n! ? Also, pls refrain from posting pseudo-code or code not compatible with the challenge rules. Code being compatible with the rules will be considered an entry to the challenge.
  20. What exactly is your problem?
  21. You might argue whether 0*1=0 is divisible by 2. Apart from that, every 2nd number is an even number, meaning one of its prime factors is 2. Instead of multiplying the numbers you could multiply their prime factors (in the sense of 8*9 = (2*2*2)*(3*3) = 2*2*2*3*3) => the product will contain at least one prime factor of 2 => the product is divisible by two.
  22. Since people asked what happened to the SFN Brain Challenges and since the number of participants in YT's "build something"-challenges is approximately zero I've thought that a litte JAVA programming exercise might suit the SFN members better. So here we go with a little programming challenge. GOAL: - Create a program that calculates factorials. TARGET AUDIENCE: - Anyone with zero programming experience to experienced programmers. - For complete beginners, I'll post some startup tips so you should at least be able to get a program with limited capabilities running quite easily. RULES: - Challenge will run approximately 4 weeks. - The structure of the main program is already given, so don't worry about it. - Only edit the file Math.java. - No includes may be used, i.e, no "import ..." may appear in the code. - No precomputed lookup-tables (btw, we have a new smiley) - The text returned must contain the complete result as a plain number i.e. no shortcuts like 124E10. EVALUATION CRITERIA: - Working code: The values returned should be the correct ones. - Clean code: Others should be able to read and understand the code, too. This criterion includes clear program structure, usage of understandable algorithms and proper commenting. - Resource saving and flexibility: The biggest number that can sensibly be calculated and the system resources used/needed. - Performance: The faster the better. GENERAL INFORMATION: - A clean Netbeans project is appended to this post. When you are finished, send me the Math.java file (the one you should edit) via PM. You are of course not forced to use the provided interface but I will paste your Math.java file in a similar one for testing, so make it compatible. - There is a simple tool for performace-checks from one of my other programs that I included to the code. Use it or leave it be; usage should be pretty simple/straightforward. - For completely clueless people, I have set up a mini-introduction at WiSci: http://www.wisci.org/wiki/User:Timo/FactorialIntro#Factorial_Guide_for_Dummies. It's a wiki so corrections and improvements by someone else are welcome, but keep in mind that it's only supposed to be a minimal starter. - If you're stuck, or want feedback on your current state (working version only, pls), then post here. Especially in the case of complete beginners wanting to participate, I'd like to have some intermediate feedback - there's a few not-so-completely-trivial issues involved that I (or others) might reveal over time (as soon as you've hit the wall yourself ). SFNFactorial.zip
  23. Some semi-random comments: There's no light cone leading from r<r_s to r>r_s, meaning there is no causal connection from the inside to the outside. I'd assume that also means that none of the intermolecular forces can act from the inside to the outside. I'd really like seeing the calculations behind that statement. You can easily show that a point-sized particle reaches r=0 within finite eigentime (should be possible with slight alterations to the program at the bottom of this page). But without a more sophisticated investigation for an object with finite size that possibly even takes into account a simplified assumption of the intermolecular forces working I would not transfer the result for a point-sized object to an extended one. As a note on the event horizont and the coordinate singularity in the Schwarzschild solution: It is often emphasized that this singularity is only a singularity caused by the coordinate system and had no real physical meaning. -I agree, because the singularity is only in the coordiante system. The physical properties (the metric tensor and its second derivatives which we call curvature) do not pose a problem, there. It's a bit like the north-pole where our coordinate system latitude and longitude causes problems even though there's -topologically- nothing special about that point). -I disagree, because r=r_s seperates two spacetime-volumes via a causal one-way street. I find that a pretty remarkable border, so I always have some gripes when I read people claiming that there was nothing special about r=r_s. Sounds too much like parroting what you learn in the GR lectures (examiners want to hear that you understood that the 1-r_s/r part does not mean a singularity in spacetime at r=r_s).
  24. Electric charge. EDIT: D'oh, should read more than the last three words.
  25. 8.999... = 8 + 0.999... = 8+1 = 9. A similar reasoning goes for your other examples.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.