
Show HN: A basketball hoop to maximize shots that go in [video] - swighton
https://www.youtube.com/watch?v=vtN4tkvcBMA
======
ericvolp12
This was really well explained and interesting.

Funnily enough I'm pretty sure this is a really similar method to urinal
design, so if this whole basketball thing doesn't work out for ya, you could
always work for American Standard...

~~~
rurban
Similar methods exists for all kinds of engineering problems, like
architecture (form follows function), roofs, bridges, city planning, or just
the economy.

The optimal form is always an optimization problem. Just define the
constraints. Maybe the most famous example is Gaudi calculating the form of
the roofs of the Sagrada Familia, and then Frei Otto for the Munich Olympics.
City planning is easier as their is no gravity, just more constraints. Think
of SimCity run in a simulation with feedback loops.

The best planning approach is always prolog-like. Define the facts and rules,
and the forms will fall out eventually by itself. Then optimize the solutions
iteratively according to cost functions. It's called OR, operations research.
I did a lot of that with free-forms, also even simply office layouts, when I
worked as architect. We even sold CAD programs to special manifacturers to
design a good roof or other free-form shapes. Like for Disney.

~~~
dhosek
Speaking of Disney and architecture and parabolic shapes, apparently when the
Disney concert hall was first built, the curved shapes of the building acted
as parabolic reflectors which focused on nearby apartment buildings. They had
to sand the panels to reduce the reflectivity because they were heating the
apartments to as much as 140°F.

~~~
rurban
Good example. You need roughen it also for better sound quality on the inside.
For Disney I had develop lot of linear algebra optimizations for smoothing
which went over my head mostly, so I used symbolic solvers.

We don't have much sound optimization CAD programs, so we worked with light as
replacement for sound, and looked at the reflections with raytracers. For the
big, expensive concert halls and opera houses.

------
hliyan
Really impressed with the use of Monte Carlo method. A while back I ran into
some resistance trying to advocate simpler statistical methods to solve a
problem domain similar to this, while the team in question repeatedly wanted
to reach for a machine learning solution. I'd love to know if I was wrong
here. In my mind, when an algorithmic or heuristic path to a solution is
available, we should attempt it first before reaching for ML.

~~~
Taek
A common trap in tech is to reach for the fanciest tool instead of the
simplest. The best engineering often comes from mastery of the simple tools,
and the most beautiful engineering is the one that makes you say 'that's so
obvious, why didn't anyone ever come up with that before?'

~~~
IgorPartola
One of my favorite software solutions that I came up with was “human learning”
powered. A few years ago I was working as the engineering manager at a small
company. I had 8 other people who I was in charge of and we had moved to a new
office in the middle of this. Our team took up two rooms in the office and I
had to figure out who would be sitting where. I had some preconceived notions
of who would be productive together, who would annoy each other, etc., but
there were enough possible combinations to make this a large enough search
space.

So I wrote a very simple python script that would randomly generate layouts of
who would sit in each room and next to whom. Every time it gave me a result I
scanned it for conditions that would make it not work and add a rule to skip
such configurations. After about six such edits I got a layout I thought was
acceptable. The team as far as I know was happy and nobody questioned it for
the entire time we were there. This saved me time because I didn’t have to
pre-program all the conditions, only add ones I had already seen not work.
Saved both CPU and brain cycles, so to speak.

~~~
paul_f
Is this how sports schedules, NFL, NBA, etc are made?

~~~
maxerickson
They are heavily based on divisions and recent seasons.

(For example, in the NFL, the teams in each division play each other twice,
and then get the rest of their games by rotating through teams from the rest
of the league)

------
jhncls
Did other people also wonder what a French cleat might be? _It is a molding
with a 30–45 degree slope used to hang cabinets or other objects._

[0]
[https://en.wikipedia.org/wiki/French_cleat](https://en.wikipedia.org/wiki/French_cleat)

~~~
dsaavy
I put up a giant wall of these in my home and they're incredibly useful. You
can build any type of contraption and throw a cleat on the back of it and
boom, just put it on the big wall. Reconfigure it every month, build new
things to mount up there, it truly is simple and versatile. French cleats
truly are terrific.

~~~
williamdclt
I like the idea. It's a bit invasive, but if you don't mind would you share a
photo of what this wall looks like?

~~~
IanCal
Someone else below has shared a video on the same kind of thing you might be
interested in:
[https://www.youtube.com/watch?v=65n9h3tFpVg](https://www.youtube.com/watch?v=65n9h3tFpVg)

------
dacohenii
I love this! I was expecting something more like Mark Rober's movign dartboard
[0], which is super cool, but this is even more interesting, because of the
way you used software to come up with a general solution in advance.

Kudos!

~~~
gorgoiler
Mark Rober is an interesting character. It feels like he pitches himself as a
crazy inventor guy but it seems like he’s more akin to the head of a design
laboratory that employs many other talented people.

It’s not like he doesn’t acknowledge the other crazy-inventor people he
commissions though, and I certainly don’t mean to paint him as a fraud.

When he says things like, 1m45s into a video on a steerable bowling ball “in
the spirit of full disclosure this is all down to [named co-collaborator]’s
work” it feels like that use of _full disclosure_ in the sense of _I would
rather not reveal this but I am legally obliged to_.

No offense to Rober or that particular collaborator. For all I know, he just
didn’t want the publicity. Rober is very good and it’s almost like I feel
aggrieved that if only his style was ever so slightly different he’d win my
complete instead of partial admiration.

~~~
imtringued
I don't admire him precisely because his videos are not about him. His videos
are always about someone else and that's why he isn't worth admiring.

------
avilay
That was a pretty cool video! I loved how he used 3D Monte-Carlo and side-
stepped all the complicated math. I wonder if he was using a Physics engine
like Bullet or ODE to calculate the simulated trajectories. Also, a good
intermediate step might've been to build the backboard in something like Unity
and shoot some hoops to catch the radius error before actually machining it
out.

~~~
0-_-0
> complicated math

Is it though? Isn't the final shape just a paraboloid, like a parabolic
antenna with the hoop in the focal point?

~~~
seaish
It's optimizing for an average of shots from more or less arbitrary locations,
so it's not necessarily a perfect parabaloid.

~~~
0-_-0
The average of paraboloids is more or less a paraboloid too

------
kidintech
Very out of left field, but how does one start doing these kind of things?

My background is in CS and math, and I could have come up with and built
everything up to exporting the mesh into triangles, but would have needed
months of google searching and trial and error to do the actual "machining"
part of things.

And then even if I went through the painful process of learning it on the job
for this task, the learned skills would probably not transfer very well into
the next adventure. Additionally, I imagine the machine used in the video is
fairly expensive and not worth purchasing for one experiment.

I'm asking this because I find these kind of builds fascinating, but I'm
always humbled about my skills when I think about the transition from digital
to material.

~~~
chrisco255
YouTube videos are one of the best ways to learn mechanical/material skills.
Just start. You'll suck at first. Keep at it and eventually you'll suck a
little less. One day you'll be mediocre. And if you keep at it you'll be
skilled.

~~~
gnramires
Can confirm. For general knowledge I recommend two fantastic channels: (1)
Click Spring (2) Matthias Wandel. They're always doing interesting things and
usually some technique comes up in the videos that I didn't know of. There are
probably countless others.

Youtube really shines in this because there is much to _see_ happening. Much
of the information is visual and mechanical on how to do things well (or at
all).

You generally need lots of tools to build stuff though (you can sometimes
trade time for tool cost), but these days finding an equivalent to a maker
space or hacker space shouldn't be too difficult.

* ClickSpring's clock series is one of my favorite video series ever.

Wandel is a little unconventional that he builds many of his own tools, but I
find he's quite practical and insightful in doing things.

------
jrockway
This appears to be a massively underrated YouTube channel. I love it when I
find one of these.

I've also never seen someone cut wood on their Tormach CNC. Seems to work
well!

------
jasoncartwright
A non-US perspective: it's quite weird hearing someone younger than about
50-60yo use inches as a measurement. Especially for something scientific.

~~~
gorgoiler
Do you mean the reference to four-by-two timber. It’s not really measurement
when it’s a standard size like that. More like a well known discrete unit like
a pint of beer or a 54” pizza.

~~~
jasoncartwright
No. When he measures the ball to move the hoop

~~~
gorgoiler
Oh right. With a precision caliper no less. Another video posted here the
other day used the word _thou_ (as in thousandth of an inch) which is a word I
haven’t heard in a long time!

~~~
s0rce
Its frustrating. I'm a Canadian born and raised engineer/scientist working at
a US-based medical device startup and I'm constantly converting between thou
and microns and mm. Often stuff will be "in spec" for both, ex. 0.002" = 50um
(assuming some tolerances for the part. Hopefully, we don't destroy any
satellites by mixing the units up.

------
remarkEon
Aside from the Apollo 13 in Real Time website, this is the coolest thing I've
seen on the internet in the last 3 months.

Sent this to my brother, which of course precipitated a huge sibling argument
about which player would've benefited more from this assuming we're talking
about players that tend to shoot jump shots. I'll let you guys know who wins.

Edit: We mostly disagree on the _type_ of shot that certain players make and
which would be more advantageous here. And credit to the creator, he alludes
to this early in the video where he talks about "line drive" vs "arc" shots.

~~~
cmonnow
OMG just found out about this -
[https://apolloinrealtime.org/](https://apolloinrealtime.org/)

------
eagsalazar2
I want before/after shot %. Also someone should totally sell these. We already
have short hero hoops, with this hoop we could all be Kobe every day, circus
shots in the general direction, 55% fg%, legendary!

------
candeira
I wonder if Greg Egan reads HN or whether he learnt about this in some other
way, but this was his analysis of the same problem from five hours ago:

[https://twitter.com/gregeganSF/status/1251390966356795392](https://twitter.com/gregeganSF/status/1251390966356795392)

~~~
Mulpze15
He credits the video as his inspiration in his 2/2 tweet.

~~~
candeira
Ok, I can't read. My excuse is it was late and I was going to bed :)

------
curiousgal
I mean, is it really Monte Carlo? He's iteratively trying to optimize a
function which makes this more like SGD, no?

~~~
jasonheh
It definitely felt that way to me.

When he was finding the optimal angle for a single sampled shot, that's the
partial derivative of his probability of making the basket for that shot wrt
the surface normal at the backboard hit position (or something like that).

If you average all of those you get a gradient descent update.

------
prodigyboi
To say I’m impressed by the video and more specifically the algorithm would be
the understatement of the century. This is amazing. Please let me buy one :)

------
buzzdenver
Next level: a camera and a couple of motors to see the speed/location of the
ball and adjust the backboard accordingly.

~~~
nmca
Like this perhaps?
[https://m.youtube.com/watch?v=MHTizZ_XcUM](https://m.youtube.com/watch?v=MHTizZ_XcUM)

------
yissp
Any physics experts know what the actual optimal shape is? I imagine it would
be a pretty gnarly problem to work out.

~~~
contravariant
If you fix the position of the 'thrower' and just throw them at ridiculous
speeds so gravity doesn't matter you'd end up with a hyperbolic backboard.

So annoyingly for an 'optimal' solution you'd need to specify where people can
throw from and how fast. Frankly you might as well just use a hyperbola with
one foci on the hoop and the other on the middle of the court, or maybe a
point slightly higher than the court itself as the balls will be coming in at
a lower angle (or maybe even a downwards angle?).

~~~
CrazyStat
Wouldn't you rather want an ellipsoid with the thrower at one focus and the
hoop at the other?

~~~
contravariant
I may have gotten things the wrong way around. You definitely want whatever
conic has the foci in the right spots.

------
aj7
Red Auerbach knew something in real life. If you bend the whole rim downward,
even a little bit, it becomes a “sewer,” pro just-miss shots start going in.
He would check the baskets, before each game, to make sure this wasn’t being
used against the Celtics.

------
gorgoiler
Absolutely brilliant. The plot twist requiring the additional metal bracket at
the end was fantastic.

To err is human. To own it on YouTube, divine.

------
mNovak
Does it bug anyone else not to have the analytic solution?

~~~
milesvp
Fun story. I was in college taking differential equations. And I was
faithfully attempting to apply what I'd learned in class, and having a
somewhat hard time at it (this was before I realized how useful matlab was).
When I was doing some research on the side, and I learned that the vast
majority of differential equations are unsolvable, you can only approximate an
answer. After that, I was thouroughly annoyed at wasting time in a class doing
all this math by hand, and having to assume the answer was of a form that was
solvable (and, yes, many useful engineering diff eq are of a solvable form).

So, now to answer your question. I thought this backboard seemed like a
problem that dish makers should be able to trivially solve, but getting to
know the math, and modifying it enough to solve this particular problem can
take more time than setting up a simple probabilistic simulation. And after my
experience with diffeq, I'm happy with a quick and dirty approximate solution,
and then moving on with your life. Then maybe you run into someone who knows
the math and is motivated enough to apply it, and maybe you update your
project then.

~~~
mywittyname
This should be solvable without differential equations, since it is basically
a parabolic antenna with an off-axis feed.

~~~
milesvp
Sorry, I didn't mean to imply it required diff eq to solve these parabolic
equations. I merely meant to give an anecdote about one of the first times I
felt truly betrayed by mathematics. A subject I'd previously held in the
highest regard.

------
mikorym
So I am guessing that the reason why this doesn't look like a sattelite dish
is because 1) the focal point is not in the centre and 2) the ball doesn't
rebound in straight lines.

Oh shoot, he does actually explain this exactly. He also mentions 3) speed of
the ball. And then, 4) for lines that hit at the same point but with different
trajectories and speeds, he takes the "average basketball shot".

The only other thing I am wondering about is what would happen if the ball
were flat.

------
fchu
This is very cool. If you can mass produce such boards (plastic molds maybe?),
It could be a fun novelty gadget/gift

------
jzwinck
The style of presentation, the manner of speaking, seems to be inspired by
This Old Tony [0]. This is no bad thing. I wonder if Tony picked it up from
somewhere else.

[0]
[https://www.youtube.com/user/featony/videos](https://www.youtube.com/user/featony/videos)

~~~
baruch
He needs to do some more monte-carlo simulations on the jokes to get to the
level of ToT. But it was a very nice presentation of the topic and a neat
result.

------
r00fus
Clearly the hoop that minimizes shots is what exists at funfairs all over the
world.

Would making the backboard convex make it near-impossible to hit? What about
making the curve imperceptible so it's hard to notice it's helping/hurting?

~~~
nbardy
The carnival hoops I've examined all have ellipsis shaped rims. Impossible to
distinguish from a circle when observed from the front, but clearly squished
if you walk around and get underneath it.

~~~
sxv
ellipsis shaped rims... will leave you hanging.

------
gordon_freeman
This is pretty cool! I wonder if he could also figure out, which attempted
balls would naturally go in vs through the help from the backboard!

------
Wistar
This is very cool. As I watched the video, I began to think about a stupidly
over-the-top version of the backstop that uses many real-time-deformable
panels similar to the adaptive-optic mirrors used in advanced astronomical
telescopes but informed to guide the ball by a machine vision view of the
inbound ball in flight.

------
asdf21
Isn't it a backboard, not a hoop?

~~~
waterside81
I'm with you. I went in thinking the rim itself would always ensure the ball
goes in.

------
lovetocode
I’m not really impressed. This only applies to shots directly taken from the
free throw line . Make a basketball hoop that moves based on ball flight Now
that would be impressive. I have seen someone on YouTube do that with a dart
board.

------
ForrestN
Did anyone else imagine just a very large hoop?

~~~
jtbayly
I imagined a large funnel.

------
steveads
Really neat project! Loved watching the video. Do you have the code in a
Github repo?

------
nitrogen
I really enjoyed the length and depth of this video. Though I wonder if a good
hybrid strategy for YT popularity is to have a viral-edited video on a main
channel, and more depth linked on a second channel.

------
londons_explore
I think the results would have been much better if he'd taken into account the
rotational inertia of the ball... It turns out that affects the bounce angle
quite significantly...

------
hawos
Can anyone tell me what tablet and app he is using for the drawing?

~~~
slig
Someone else asked in the comments: `I'm using an second gen iPad pro running
the "concepts" app.`

~~~
hawos
Thanks!

------
chombier
nice work! you could probably speed the computation quite a lot by using a
small deformation basis (e.g. using modal analysis) and optimize in this
smaller space instead.

------
paul_f
Do the inverse of this and open a stand at a fair :-)

~~~
someguyorother
He wouldn't have to, he could just use the original one where the ball hits
the rim every time :-)

------
jefftk
Now I want to make a backboard that always misses unless you know the right
amount of spin to put on the ball.

------
yalogin
So do you use only one spot to shoot from for the data collection or do you
shoot from all over the floor?

------
anjc
Can someone briefly eli5 how the Monte Carlo simulations feed into learning
the optimal surface?

~~~
jrockway
You pick a random position and a random shot (angle, speed), see where it hits
the backboard, and then change the angle of the backboard there to direct the
ball through the rim after the bounce. Do this enough times, and you have a
surface. (I don't know how the number work out, so there are probably points
that have multiple values and surfaces with discontinuities. I guess you
average the values at a given point and then smooth the surface, and call that
"as good as possible".)

~~~
nitrogen
_I guess you average the values at a given point and then smooth the surface,
and call that "as good as possible".)_

In the video he mentioned doing a least squares fit to get the final surface,
so that sounds about right.

------
tiffanyh
Does this only work if you’re exactly aligned in front of the hoop? (eg Free-
Throw Line)

~~~
andbberger
No it's optimized to work from anywhere in the court, although he didn't say
what distribution he used.

------
bitxbit
This is so awesome! I love the way you went about solving this problem.

------
tryamtamtam
I thought this was really cool, keep up the good work!

------
hammerton
That was really cool, thank you!

------
imvetri
Good work. thanks for sharing

------
ptrenko
convexity!

------
nabla9
"Who is Monte Carlo?" Monte Carlo is for Europe what Las Vegas is for the US.
The first name that comes to mind when you think gambling.

Monte Carlo method is repeated random sampling to obtain numerical results.

Monte Carlo algorithms are heuristic algorithms that solve problems with
random process that can give wrong answers.

Las Vegas algorithms are algorithms that solve problems with randomness but
get always correct result or knows that it failed. Runtime is finite.

Atlantic City algorithm is a probabilistic polynomial time algorithm that
gives correct answer > 50% of the time (or 75% of the time by some
definition).

~~~
irrational
Is Monte Carlo (I need to look up where that actually is) as gaudy (I might
have said trashy) as the Las Vegas strip?

~~~
nabla9
No. Monte Carlo is located in Monaco. It's very classy place.

It's the type of place where James Bond likes to play in the movies and books.

------
numuliank
Nope, expected something interesting, but this is based on a boring brute-
force simulation.

He did hint at using a parabolic shape, like in satellite dishes. Why not use
some actual calculus and differential equations to figure out the optimal
parabolic-like shape here?

~~~
dang
It's great that you know more, but can you share what you know without putting
others or their work down? Doing the latter really poisons the well here.

A much better pattern than "Nope, expected something interesting" is to first
affirm something that the author got right or did well, and then build on that
with suggestions for refinement, further development, learning. There's plenty
of opportunity to show how much you know that way, plus you won't also come
across as an internet jerk.

Keep in mind that project creators and authors are often reading these
threads, and one nasty comment makes more of an impression than the rest of a
thread put together. A single bee sting is more memorable than a field of
butterflies. It's too bad that it doesn't work the other way around, but the
pattern is super clear. Even the thread the other day with the C Committee
guys, which was one of the best technical threads HN has ever hosted, made
this impression on them: "Wow, I had no idea people were so mad about locales"
(not a direct quote). I hadn't noticed, and when I found the comments they
didn't even seem that mad.

------
Animats
The first 10 seconds pretty much covers the subject.

It's not the hoop, it's the shape of the backboard, which is a reflector
formed to focus the ball on the target.

Now, the really cool thing would to build a flat backboard with controlled
bounce properties. Interesting 3D printing problem. That would look like an
ordinary backboard but still focus bounces.

~~~
jansan
Another idea would be a hoop controlled by servos that always moves the hoop
where the ball is going.

~~~
Animats
People would see. Something that just works, invisibly, though.

------
soheil
Is this not something that just an optics equation in Physics would give you?
Specially if not taking the radius of the ball into effect.

~~~
hencq
Maybe, but as he explains a normal parabola (like a satellite dish) wouldn't
work, since the shots themselves are arced because of pesky gravity. I thought
using a Monte Carlo analysis and finding a fixed point was actually a very
clever way to solve it.

~~~
carlob
Yeah but the acceleration from gravity is constant so maybe there is just a
(possibly non linear) change of coordinates that can be applied to the regular
paraboloid.

Also a paraboloid would work only for rays that are parallel to one another.

~~~
mannykannot
Another difference from optics is that the vlocity is not fixed, and that
affects the extent to which gravity modifies the trajectory.

------
nogabebop23
Who uses the back board? This doesn't help at all with "nothin' but net"

~~~
philwelch
No respect for Tim Duncan.

~~~
quickthrower2
[https://www.coachup.com/nation/articles/bank-shots-in-
basket...](https://www.coachup.com/nation/articles/bank-shots-in-basketball)

