When to stop being greedy and just park | Optimal stopping and dynamic programming

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ต.ค. 2024

ความคิดเห็น • 16

  • @steevkeyes
    @steevkeyes ปีที่แล้ว +2

    I would analyze the situation differently.
    In reality, we don't know the probability that any following spot will be open. However, we are collecting data as we drive by previous spots; this data allows us to estimate the probability based on previous observations. Although, we can continually update that probability as we continue to pass over more spots.
    Often in this situation, there is a favoring of close spots by previously arrived drivers. As such, the distribution of available spots is not evenly distributed over the queue of all spots. Instead, the distribution of occupied spots is favored as the spots are closer to the intended destination (the house). We could assume the distribution to be normally distributed on the approaching half. However, the distribution on the receding half would not be 'normal', rather it would be abrupt. That is, all spots close but after the destination will be occupied up until all previous cars half satisfied their parking demand; after that point, all remaining spots can be understood to be vacant.

  • @tratixmusic8884
    @tratixmusic8884 ปีที่แล้ว +6

    ngl, I actually think about this every time I go into a parking lot. I just end up taking the first spot I see tho because I don't want to deal with the people walking in the parking lot closer to the store and I'm sure someone who is more of a rush would benefit greater from a closer parking spot and I'm too lazy to take the chances and rather walk haha. But I have wondered about this exact thing when I'm parking and I think about it often

  • @AndrewBrownK
    @AndrewBrownK ปีที่แล้ว +9

    cool stuff. Here are some ways to complicate the problem: What if the probability of a spot being taken is not uniform? Is the optimal strategy stable if everyone tries to use the same optimal strategy?

    • @OptWhiz
      @OptWhiz  ปีที่แล้ว +1

      Hey! You can also use dynamic programming to solve the problem when the probability is different for each spot, as well as other variations ("going back" to a previous spot with some chance it's taken, other objective functions). If you want more complexity, you can try to model the cars arriving and leaving at some rate (maybe a poisson process). There should be an optimal threshold strategy for this process.

    • @readjordan2257
      @readjordan2257 ปีที่แล้ว

      ah, what if unknown spots will be rented spots?
      what about that but now with 'disorganized' pricings (like the rented spot midrange is fair, but the one near the home is pricier but for obvious reasons, but the rent near the beginning is absurdly expensive because the owner thinks they can trick the driver that the others will be higher) in other words, what if random parking spots are for rent, and the personality/intentions of the renters may or may not vary , meaning instead of a situation where its more expensive the closer you get, or everyone is charging the maximum market value so its roughly similar pricing everywhere, you may get "nicer" or "trickier" or "typical" renters at different spots?
      what if random spots come at a risk of cottonmouths or rattlers or minotaurs or just dog poop?
      in other words there, what if theres not only cost, but risks to varying degrees?
      (flip that around and have rewards, maybe your friend is that beast youtuber guy and some parking spot has a million dollars in it, so now you have to choose between parking and money) lol a lot of that is pretty complicated, but i think the simple version with rented spots might suffice.

    • @whebon7266
      @whebon7266 ปีที่แล้ว

      ​@@readjordan2257The addition of rented spots turns this problem into multi objective optimization, which introduces the problem of defining what is optimal. There needs to be made a trade-off between distance and money. This trade-off is very subjective and differs per person. You could try to combine distance and money into a single objective loss:
      For example, you could set up a linear correlation, like 1km = €0.50. Then we need to minimize the loss "dist+2*cost".
      But in reality, this trade-off is likely not linear. For example, paying anything at all compared to nothing also adds weight, because it requires you to go and buy a ticket instead of directly heading for your destination. Or maybe you have a higher cost/distance rate as you exceed your budget of €5. Then we need to minimize a much uglier expression:
      dist + w*[cost>0] + (2+2*[cost>5])*cost
      In both cases, each parking lot gets assigned a single objective loss. The calculations are then the same as in the video. But instead of using the just the distance in the loss function, we use our user specific trade-off loss function.
      If the trade-off loss is not known beforehand, you could alternatively calculate the pareto front and let the user make the trade-off after the calculations. But this likely requires a more complicated algorithm.

  • @bryansentertainmenttrivia
    @bryansentertainmenttrivia 11 หลายเดือนก่อน

    Great video, thanks for this :)

  • @SandeepShandilyaKatna
    @SandeepShandilyaKatna 10 หลายเดือนก่อน

    can someone please explain about the (Average distance until open spot) part at 8:15? also do we know the probability that the spot is full or not before hand because we are using 10% and 90% each time.

  • @zeldaandTwink
    @zeldaandTwink ปีที่แล้ว

    I just started this video, but I am assuming it has something to do with the constant e

  • @YouLoseSir
    @YouLoseSir ปีที่แล้ว +2

    model is flawed because in reality you can see more that one parking spot and not just the one beside you.

  • @mrstephanwehner
    @mrstephanwehner ปีที่แล้ว +1

    So you get an estimate of the probability from the first ten you pass, then follow your calculation.

    • @BenAlternate-zf9nr
      @BenAlternate-zf9nr ปีที่แล้ว +1

      You could even dynamically adjust your estimate with each new spot you see and recalculate the threshold accordingly.

  • @pedrosso0
    @pedrosso0 ปีที่แล้ว

    Here's my solution:
    Stop the moment you see a spot and your risk becomes x^100. Quite small imo.

  • @hurktang
    @hurktang ปีที่แล้ว

    A) I disagree with your solution. First, if I don't stop at 93, I have a substantial 5% chance to walk 22 or more parking space. Actually I'd run a one in a million chance to have to walk 108 spot. Do I really want that risk?
    B) All the fun is to try to estimate the probability based on what you saw so far. As you reach the space 90, chances are you only saw 1 spot open, at best 2. There is a high probability that the real chance is 95+% and that missing your spot at 93 would send you 20 space away. Unless you saw 2 or more empty space, you shouldn't really take the risk pasr ~87

  • @mahendrakergaurav7760
    @mahendrakergaurav7760 ปีที่แล้ว

    Pls don't stop making videos

  • @ezrachua1317
    @ezrachua1317 ปีที่แล้ว

    bad example