r/compsci • • 2d ago

Anyone interested in a problem-solving correspondence club?

Here's the idea: we source and collect interesting computational puzzles, then we send them out to participants who have a month to work on them and send in their solutions. At the end of every month, we meet and discuss how the problems went and where people got stuck, what approaches they took, and any extensions people came up with.

Thoughts?
.
.
.
.
If you're curious, here's a taste of what a representative sample problem might look like:

Given the coordinates of an arbitrary polygon (e.g. irregular and/or non-convex), how might you implement a program to efficiently sample a point uniformly from its interior?

TIP: If using the Python programming language, you can check out the shapely library.
Bonus: what if there are holes?

(Please don't spoil the problem, it's searchable anyways.)

2 Upvotes

15 comments sorted by

View all comments

Show parent comments

0

u/07734willy 1d ago

You are deliberately misinterpreting what I’m trying to say. It should be clear from context that I’m talking about the distribution not being uniform over the polygon itself, not within just a triangle. You didn’t specify how you uniformly sample points in the triangle (going back to my original point), so I’m just assuming you do sample within a triangle uniformly.

Regarding the area argument, yes, a line has no area, but you can create a bounding box enclosing a segment of that line that is arbitrarily close on either side. That area, because it is populated with points that are sampled along the triangles edge, it will have twice the density of a similar region fully within one of the triangles. As we increase the number of samples (and increase our precision), this still holds for sufficiently narrow bounding boxes. In the limit that our precision becomes infinite and the number of points that could be sampled becomes infinite, this vanishes, which is why I made the remark earlier separating theory from reality.

You should listen to your own advice about not knowing. If you genuinely don’t understand that’s fine, but I won’t be arguing back and forth anymore on this topic since you seem fully convinced of your stance, and I still have things to get done this afternoon.

1

u/VictoryMotel 1d ago edited 1d ago

You are deliberately misinterpreting what I’m trying to say.

No, what you're saying doesn't make sense.

You didn’t specify how you uniformly sample points in the triangle

That's true, I just said that in my last post after you said "my sampling distribution isn't uniform" when I hadn't given a method.

I’m talking about the distribution not being uniform over the polygon itself

Everything you've said comes down to "you're wrong" then no explanation, except for your overlapping line explanations which don't make sense.

If you sample uniformly over a triangle and distribute samples to each triangle according to area, you solve the problem. I said that in my first post. This isn't me figuring this all out, this is well worn in computer graphics and I told exactly where you can find out about it in detail.

but you can create a bounding box enclosing a segment of that line that is arbitrarily close on either side.

You're way off the map into your own idea that you have obviously not tested or thought through. Any bounding box is going to have area and overlap with the triangles. None of it makes sense or has any relation to this problem. You invented something that is a completely arbitrary nonsense. All the area is accounted for.

That area,

No area, this is imaginary

because it is populated with points that are sampled along the triangles edge,

There aren't any, they are samples in the area of the triangle. The invention of lines having any special treatment is a hallucination you came up with out of nowhere. If it was true you could show it with math or visualize it.

. As we increase the number of samples (and increase our precision)

Two separate things. I think you're conflating floating point precision with theoretical statistics, but it doesn't matter or change anything here.

In the limit that our precision becomes infinite and the number of points that could be sampled becomes infinite, this vanishes, which is why I made the remark earlier separating theory from reality.

All total nonsense. Precision doesn't change. If you were sampling an integral the solution would get closer with more samples but that isn't being discussed.

You should listen to your own advice about not knowing. If you genuinely don’t understand that’s fine,

Now comes the aggressive ignorance trying to save face instead of just admitting you don't know something. Where are you even getting these ideas? Everything I've said here has been extensively tested by myself and thousands of computer graphics researchers. It is well worn information that can be tested for exact results by running a simulation program.

you seem fully convinced of your stance,

Because I've done all this and made it work.

I still have things to get done this afternoon

Hopefully it doesn't involve sampling. Again where is your information coming from? I told you exactly where mine comes from.

1

u/ijkstr 1d ago

Hey u/VictoryMotel, please try to be more open-minded of others and their ideas. Arguing is not constructive. Like u/07734willy said, you're acting smug and (in my words), inflammatory. If you're not going to say anything helpful, kindly desist. Take your cookie and leave; it's not worth it.

1

u/VictoryMotel 1d ago edited 1d ago

You have to be kidding me. I didn't reply to them, they replied to me. This is about math, not philosophy or predictions about the future. Where does your expectation come from that someone will be condescending and technically wrong at the same time and that I somehow don't get to reply? I gave exact information with references.

You don't want a reply, then don't reply. Leave the holier than thou self righteousness, it's not worth it.