6 kyu
Will it balance?
140 of 158marbiru
Loading description...
Fundamentals
View
This comment has been reported as {{ abuseKindText }}.
Show
This comment has been hidden. You can view it now .
This comment can not be viewed.
- |
- Reply
- Edit
- View Solution
- Expand 1 Reply Expand {{ comments?.length }} replies
- Collapse
- Spoiler
- Remove
- Remove comment & replies
- Report
{{ fetchSolutionsError }}
-
-
Your rendered github-flavored markdown will appear here.
-
Label this discussion...
-
No Label
Keep the comment unlabeled if none of the below applies.
-
Issue
Use the issue label when reporting problems with the kata.
Be sure to explain the problem clearly and include the steps to reproduce. -
Suggestion
Use the suggestion label if you have feedback on how this kata can be improved.
-
Question
Use the question label if you have questions and/or need help solving the kata.
Don't forget to mention the language you're using, and mark as having spoiler if you include your solution.
-
No Label
- Cancel
Commenting is not allowed on this discussion
You cannot view this solution
There is no solution to show
Please sign in or sign up to leave a comment.
Should have just given the formula for center of mass,
mass1position1 + mass2position2 ... / mass1 + mass2 ...
or at least a better hint
Interesting finding out how it works.
Haskell translation
Nice educational kata!
JS translation
Please use new python test framework.
Done.
Are we supposed to solve this using moments?
Nice kata:)
This comment has been hidden.
each 1 is a support of width 0, but all space between two supports is also a support (on the later images there are two 1s, creating a support of width 1). How would you represent that? This kata is quite simple, ultimately, but I haven't been able to describe the task to anyone's satisfaction
I think it's OK, but then the third case on the first picture is incorrect. In this picture any mass assigned to the first item is to the right of the first support. Also, I looked at positions relative to the grid initially, but it looks like the grid is just a background.
I'm afraid I'm not sure what you mean -- any mass at the extreme left end of the stick would be directly above the extreme left end of the support, no?
yeah, the grid is just background because I screenshotted from a drawing programme. I could redo it but... honestly I'm just not sure this kata is worth the trouble/effort
Interesting one
thanks!
This comment has been hidden.
Thanks! Have added your suggested alterations. But I'm still confused what the non-physical interpretation people are having is: can you explain? It seems very common but nobody will tell me what they thought the problem meant
Pretty much the summing of two halves I guess and not calculating the COM
Ohhhhhhhhh so they're finding the point where half the mass is on one side of the stick and the other half is on the other side of the stick, but not taking into account the distribution of that mass -- finally, thank you, I think I understand the situation now & what I need to illustrate.
Yes thats the intutive way
hahaha yes I can see that now! And I can see now that ZED.CWT's comment below was getting at the same thing, I just didn't understand it at the time. This is the most fascinating thing about writing katas, to be honest: figuring out how to translate your ideas into instructions that actually make sense to anybody else ;)
Hi,
Interesting one. But the description is quite obscur compared to what you want... Maybe a hint about the fact that we're dealing with a "somewhat real mechanic problem" might help?
Seeing the messages below, maybe you should give a representation of the space, or explain that the indexes values are acutally coordinates on an axe?
yes I can see my current description has totally failed! Let me rework it.
.
This comment has been hidden.
Nope. We're dealing with """real""" physics here. The center of mass is at 2.0
@marbiru: flag this if you think it's too much. Btw: this kata is really hard to rank... Not sure yet... :/
.
I think I'm missing something here -- what other definition of centre of mass is there? Clearly the one I had in mind is not the one everyone else is thinking of!
if I embed something like this in the description, would that be better?
http://hyperphysics.phy-astr.gsu.edu/hbase/imgmec/cm.gif
I originally thought that would be making things too easy, but that's certainly better than making it almost-impossible.....
This comment has been hidden.
it's not really a problem of definition of center of mass, I guess. It's rather that the current desccirption of the ground, using indexes, leads to several question for the user:
Going this way, you leave the physical aspect aside very quickly and begin to think about the problem using arrays and not a stick on a table, and useres will begin to seek for relations with "brutal sums" instead of searching for a physical center of mass.
As a matter of fact, the ground has almost nothing in common with an array representation of blocks, since the indexes represent actually the coordinates of the beginning and the end of the support on a horizontal axe. The support becoming actually a point if there is only one
1
on the ground. I really believe that you should put a draw in the description, making clear the meaning of the indexes.sure! Can you explain to me what you were meaning by centre of mass? That way I can figure out how to change the description to avoid that misunderstanding. If you and ZED.CWT both had the same idea then my description clearly isn't good enough
@Blind4Basics, same about ranking. I think if I just embed that image and fully explain the problem then the ranking will be pretty low -- after that it's just a simple calculation, after all. I'd prefer to avoid that and make a slightly harder kata, but I can't figure out how to edit the description appropriately. If you have any ideas please feel free to edit the description directly (if you'd like to)
crossed messages, see above, please.
For me, just put the image in the desc would be enough
I believe so. Maybe just insist a bit on the fact that it's a psysical problem to solve, not a computational task about arrays.
ah, great, yes -- will do
btw, you should talk about a "support", not just a "peak" (clearer, when you have several ones).
Great, have completely redone the description -- hope that works. Thanks so much for all the help, really appreciate it.
Maybe you should still add that indexes are actually coordinates on an axe? Because there are still several interpretations that are possible about the way the ground is "working", for now.
and maybe:
thanks, have added. I'll try to get a picture uploaded when I have time
Why
What's the different with
if I'm not mistaken, in your example
sum([2, 1, 1, 5, 8, 6, 7, 2]) == 32 == sum([5, 6, 2, 8, 8, 3])
the centre of mass would therefore be just to the right of the peak (in between the 8th and 9th elements of the stick and the terrain, therefore just to the right of the final 1 of the terrain), therefore the stick would not balancewhereas in the example
the centre of mass is betweent the 2nd and 3rd elements of the stick, therefore directly above a peak, therefore the stick will balance
does that make sense? it's a brand new kata so there might still be a mistake here
So the center would be to the left of the first 1, and the stick would not balance?
Nope, you have to really calculate the center of mass. "Phisically speaking".
.
No sample tests. You should probably add some.
sorrrry, forgot to copy them over from the main tests -- done now, thanks so much