• 0 Posts
  • 3 Comments
Joined 1 year ago
cake
Cake day: June 5th, 2023

help-circle
  • Modeling a single pair of pants

    For the sake of the calculation, lets model the pants as a prism, where:

    • The top and Bottom surfaces are the front and back sides of the Pants with a surface of area A_t each.
    • The Prism would have some depth that d depends on how thicc the binary tree is. For this calculation, I assume that d is constant for all pants
    • The Pants have some outline that gives the circumference U of the prism

    Total fabric for a given pair of pants p would then be A_p = A_tp * 2 + U_p * d

    Nomenclature

    Lets denote the two ways of wearing the pants as:

    • W_1 | For a single pair of pants that covers the entire tree
    • W_c | For many smaller pants that each cover a single node and its outgoing edges

    First comparison

    We can already note that the amount of fabric that is used, for the two possible ways to wear the pants, will depend on how densely the branches of the tree are packed. Assuming a maximally densely packed tree (if such is possible), where there is no space in between any branches, we’d get a the same area for A_t on the single pants for W_1 and the sum of all A_tp over all little pants in W_c:

    A_tW1 = sum( A_tp ) for all pants p in W_c

    It’s clear then, that the area difference between W_1 and W_c then only depends on the circumference U_1 in W_1 VS the circumferences U_p in W_c. In this case, the sum of all U_p for each pair of pants p in W_c must be higher than U_1 in W_1, as long as the binary tree has a depth of at least two. This is because the pants would have to have to cover an exterior outline of at least U_1 and in addition there would interior borders between the pants.

    Therefore, for a maximally packed tree, W_1 would use less fabric than W_c. On the other hand, given a tree where the siblings would be far away from each other, there would be a lot of space between the siblings. This would then diminish the areas A_tp for the pants in W_c in comparison to A_1 in W_1. (I know this isn’t very rigorous here, but I don’t want to go into too much depth here)

    From this, we learn that the comparison of W_1 and W_c depends on the packing density of the pants.

    Packing density

    The packing density depends on the difference in branch length between children and parents within the tree. It also depends on the angle of the bottom branches to each other. For higher nodes, I’d assume that a node will always be horizontally aligned in the middle between it’s child nodes. Therefore, the angle is only dependent on the length of the legs for non-bottom nodes.

    I need to stop now as I’m hungry

    Maybe I’ll pick up where I left later.


  • It’s indeed a lot like powershell, but I found it to be much less painful to use for everyday tasks. I can’t really put my finger on it, but powershell always felt very clunky and unpredictable to use. With Nushell, I can write pipelines that usually have the desired behavior on the first try. Also, its more convenient in so many different aspects that I can’t go back anymore.

    The biggest downside is, that it hasn’t had a stable release yet. While I haven’t encountered any bugs yet, there are often breaking changes with new releases that may break your scripts.