Jump to content

Ghideon

Senior Members
  • Posts

    2601
  • Joined

  • Days Won

    21

Everything posted by Ghideon

  1. It would help if you post the line numbers for the code when posting error messages referring to line numbers. Hints*: -What does "IndexError: list assignment index out of range" mean? -Does the variable arr contain an element at index i? *) Posted in Homework Help, no solution but hints will be given.
  2. I think more details are needed to make a comment. Otherwise I would have to write a rather long article to cover the topic. For instance, when you say "n" and sorting do you mean that there are n items to sort? Or do you imply that the algorithm is given some number of integers where all integers are less or equal to n? When stating "sorting algorithms like Bubble sort" do you mean a set of impractical algorithms that like bubble sort runs in O(n^2)?
  3. Ok! My opinion* is that if time is removed then the bold line and graph 15 is correct, or as correct as a single frame from graph 14 would be. In other words, there is either one frozen moment (a frame from 14) or everything happening at "the same time" which would require the ball to be everywhere along the path (bold line in graph 15). While writing the above I think I see your point of view regarding "3D object sliding in Time". But I have to think some more before commenting further, not sure yet how to formulate something that makes sense. *) Disclaimer: Not sure this is rigorous enough to have any value in a science discussion
  4. Ok. That algorithm is not something I would consider using in a real case. Why do you think that the algorithm you posted has logarithmic complexity? A simple prime number algorithm can run in O(sqrt(N)). But not the algorithm you posted. Maybe you could post the algorithm you wish to discuss? It's posted in homework section, hence I answer according to the rules in this section.
  5. Thanks! Just so I understand*: By "the entire Observable Universe" you mean "a really large distance", and this distance separates two observers in same frame of reference? *) "Observable universe", to me, implies that GR and other applicable models have to be taken into account.
  6. If someone has the ability to simulate what I currently believe to be "the reality" then I guess they could possess the skills needed to simulate a divine creator if they wanted to. And simulate time travel as well.
  7. Do you take the expansion of universe into account in that case? Or do you use some other model?
  8. The error Means there is no main class stated in the jar file. Have you aquired the software from a reliable official source? Is it supposed to be executed from command line? For specific questions about Cobertura maybe you get the best and quickest answer from the Cobertura community?
  9. Hello! A quick hint: the question is for Jupiter's volume, is the unit of your suggested answer a volume?
  10. Here are some hints: What have you tried so far? Do you have an idea how to start? Does it help to draw a simple picture using time as x-axis and price as y-axis?
  11. @mundane you could use the ideas above in digital tools* if you prefer. Here is an example of chloromethane (did not have time to create an animation of it in rotation) . Here is an example view of two types of But-2-ene. You cant rotate one to get to the other. *) There are free tools available online
  12. Thanks for confirming. Probably a language issue then, I know and understand a few things about arcs, circles and trigonometry. But I have been unable to find anything about "Arc of definition" in math.
  13. Question: By ”arc of definition” Do you mean ”an arc of the unit circle”?
  14. That is the issue from what I’ve read so far about deicing of bridges. It is not very complicated to heat a cable. The problem is to do it efficiently. Most people wants open bridges, not so many are willing to pay for heating. Other methods are prefered but more research needed to find reliable and efficient methods.
  15. Ok. Please post the result and the issue it solvets once you have made progress. In the meantime I’ll continue doing my work, using trigonometry, transforms, straight lines, curves and other mathematical concepts. From what I’ve learned so far there is no need for any new definition of arc or trigonometry. Sorry that you think your own question is a waste of time. (Or maybe translation messed up your comment?)
  16. Can you clarify your question, maybe by providing a picture and/or formulas?
  17. Why? AFAIK value of trigonometric functions are exactly defined. Ability to numerically express a value exactly, using a limited amount of decimals, is not an issue with the definitions. Analogy: pi, defined as circumreference/diameter of a circle, seems to have an non ending sequence of decimals when expressed in base-10: 3.1415... that does not mean that circles, pi or their definitions are approximations.
  18. Ok! Because Table[i][j] Holds the maximum value for a knapsack of capacity j when considering the first i items (out of the total n items). That is one central part of the algorithm*. That means that Table[n][C] Holds the maximum value, the solution to the problem. n=number of items and C=capacity of knapsack That is part of the Dynamic Programming approach, not needing the additional storage. Of course one can use variables to hold the values (that is more of an implementation question) but it is not needed to get the solution. Once the table is filled the list of items that gives the maximum value of the knapsack can be retrieved by examining the table "backwards" from last line. Start on last line (i=n) and max capacity (j=C) repeat: if Table[i,j] != V[i-1,j] then // item i is in knapsack //mark the ith item or add to some list (code not shown) j := j - weight[i] //remove item i from knapsack capacity i := i - 1 //move to previous line else // item i is not in knapsack i := i - 1 end if Note that the this last iteration through the table only visit one element at each line making it rather efficient. *) Note that this a property of the knapsack 0-1; the fact that the problem can be optimally solved by looking at one item at a time and increasing knapsack capacity. It would be off topic to dig into the details of the properties of problems where dynamic programming applies (https://en.wikipedia.org/wiki/Dynamic_programming) and how the class of problems differs from others.
  19. Advice: Wouldn't it be better to try to understand how the algorithm works rather than to try to untangle some specific example out of the many available on the net? The second item, the item having value 4. They are likely talking about the two choices available in the algorithm at that point: Including the item i or not including the item i. Basically the algorithm tests if the total value of the knapsack gets higher if we add item i and remove other items as needed to make item i fit in the knapsack. That is the central part of the algorithm. Have you yet understood how that works? If not, the tutorial(s) and examples will be hard to understand. To allow for the discussion to take place here, without having to follow links, the two choices (selecting or not selecting an item i) can be stated* as: if weight[i] > j //too heavy Table[i][j] := Table[i-1][j] else // can be carried w := weight[i] v := value[i] Table[i][j] := max(v + Table[i][j-w], Table[i-1][j]) end if Where i is the item, 1<= i <= number of items j is the capacity of (current, dynamic) knapsack, 1<= j <= max capacity of knapsack weight[] and value[] holds weights and values of the items table[][] holds the calculated values of the knapsacks To allow for other members to take part easier, here is a description of Knapsack 0-1 problem: -We have a Knapsack that has a weight capacity C. -We want to maximise the value so that the total weight of items in the knapsack is at most C where C is an integer. -0-1 Knapsack problem means we are allowed to either take an entire item or reject it completely. We can not break an item and put parts in the knapsack. -Available items are i1, i2, ..., in. Each item having weight w1, w2, … wn and some value v1, v2, ... vn Also see: https://en.wikipedia.org/wiki/Knapsack_problem#0-1_knapsack_problem *) Disclaimer; I haven't visited these algorithms for some time, room for errors
  20. You seem to be using definitions of spin, color, charge, heat etc not found in mainstream physics. That makes your explanations pointless unless you provide your alternative definitions as well. For instance Are you claiming that electrical current (flow of charges), for instance in superconductor, is actually the same as heat flow? Still waiting.
  21. You said: Those "other research scientists and engineers" found that, according to your link: You seem to be proposing a method that is within a class of methods that is known to technically work but is too inefficient according to the link. What is the cost of installing and running the suggested de-icing method?
  22. Yes please show how. Also please show what this is supposed to be used for in science.
  23. Hello. It is a little tricky to see which numbers you picked from which source. The example at medium.com has 5 rows so the question regarding 4 rows I guess is related to your first link (riptutorial). The first tutorial probably just skipped the trivial first row, since there are no massless and zero-value items to consider. First row only contains the first item so first row has item no 1 in all the knapsacks that have capacity to store that item. Generally a row number i represents the set of all the items from rows 1— i. The example at medium says the following for row 3: From your link https://medium.com/@fabianterh/how-to-solve-the-knapsack-problem-with-dynamic-programming-eb88c706d3cf So in your case the example has weight 3 for item no 2 and therefore will not be used on line 1: |Weight | 1 | 3 | 4 | 5 | Hence the item with weight 3 is considered on lines >= 2 (lines 2,3,...)
  24. It is not "obvious" because of the issues described in the paper at the link you provided. Example:
×
×
  • 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.