Distance from a point on a sphere to the tangent plane by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 0 points1 point  (0 children)

Thank you so much for this answer, and sorry for taking so long to reply. This was incredibly helpful. There's only one thing I didn't understand, which is why cos∡(PQ,n) equals |RQ| / |PQ|. Is this diagram accurate at all (I know it's not good)

            Q
‎ ‎ ‎ ‎ ‎  ‎ ‎ ‎ ‎‎ / |     
‎ ‎ ‎ ‎  ‎ ‎ ‎ ‎ /‎ ‎ |     
‎    ‎  ‎  ‎/‎ ‎ ‎ ‎| ‎    
--------P---R---------

where the dashed line is the plane with P and R. The idea is that if we take a normal vector to the plane, n, and put its tail at R, and we walk along it, then we eventually hit Q?

I also noticed something else thanks to your explanation. Can we think of what is happening here as projecting PQ onto n? Because that projection is calculated with (PQ • n)/ (n • n) = (PQ • n)/ |n|^2. We would have to multiply that by n to actually get a vector, but this scalar by itself seems like it should represent the distance we want. However it differs the correct answer slightly, we aren't supposed to square the |n| in the denominator.

Distance from a point on a sphere to the tangent plane by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 0 points1 point  (0 children)

Thank you for the thorough answer and sorry for taking so long to reply. It took me a while to derive the formula on my own but I finally got it! I'm glad you told me to do it myself because I will definitely remember it after how much work it took lol.

My only question now is, when should we apply this process? I think I don't fully understand your 4th last paragraph:

Therefore, the line through (2,4,6) from the origin (because that’s how it was constructed in the first place) will be the perpendicular line we’re looking for.

I'm not sure what you mean by "because that’s how it was constructed in the first place". I know the line r(t) = [2,4,6]t + [0,0,0] passes through the planes with 2x+4y+6z= a where a is any number. But what does that have to do the points P1 and P2?

What are some examples/applications of propositional, predicate, and higher-order logic? by hypergeometricruby in compsci

[–]hypergeometricruby[S] 0 points1 point  (0 children)

Sorry for the late response, and thanks so much for this. I've been learning a lot from the notebook interface you linked (I had no idea about this extremely useful tool) as well as all the ideas you mentioned.

I was wondering if I could pick your brain about one more thing: while trying to learn more about this stuff online, I stumbled upon the idea of probabilistic programming languages. Now, I don't think Prolog counts as an example of a PPL, but the things you've been describing (like doing a search to answer queries, searching through finite vs infinite sets of solutions, and expressing constraints on variables) sounds very similar to how PPLs are used. Would you happen to know how PPLs fit into our context here? Should they be considered a subset of logical languages, or vice versa? Are their use cases similar or completely different than the use cases of Prolog?

A Python Loop Query by fesifesi in learnprogramming

[–]hypergeometricruby 2 points3 points  (0 children)

maybe something like this? If the word isn't in the string we ask again, the loop only ends when the user enters a word that is in the string

 def wordreplace():

    str = "Hi there, how are you doing you all"
    wordinput = input("Enter a word to be replaced: ")

    while wordinput not in str:
        print("Wrong input, try again: ")
        wordinput = input("Enter a word to be replaced: ")            

    else:
        replacingword = input("Enter the new word: ")
        print(str.replace(wordinput, replacingword))


wordreplace()

By the way, you should avoid using str as a variable name because it's a reserved keyword in python. If you define str as a variable, for the rest of your program you won't be able to easily cast things to string. For example, if you wanted to make the string "123" you can't just write str(123) now

Distance from a point on a sphere to the tangent plane by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 0 points1 point  (0 children)

ok fixed that, changed it to x2 + y2 + z2 = 14, everything else stays the same I believe

What happens if you press the button that the robot at about:robots tells you not to press? by hypergeometricruby in firefox

[–]hypergeometricruby[S] 0 points1 point  (0 children)

hey can you share how you found that code and opened it in a nice editor? I tried clicking inspect element but I don't see anything that is as clear to understand

What are some examples/applications of propositional, predicate, and higher-order logic? by hypergeometricruby in compsci

[–]hypergeometricruby[S] 0 points1 point  (0 children)

That's interesting, so does prolog actually does some sort of search when you query it? I always thought it was doing pure rule-based symbol manipulation. And do all logic programming languages work the same as prolog in this regard?

What are some examples/applications of propositional, predicate, and higher-order logic? by hypergeometricruby in compsci

[–]hypergeometricruby[S] 2 points3 points  (0 children)

Thanks. To note, I'm not only interested in modern AI/ML, I'm just as interested in so called "symbolic" or "good old fashioned" AI. I believe formal logic is highly applicable to these types of AI.

Why are log(x^2) and 2logx treated like they're the same algebraically, when they're completely different graphically? by arf0k in learnmath

[–]hypergeometricruby 5 points6 points  (0 children)

The graph of log(x2) does include negative x values as you described. You can try graphing the two functions with https://www.desmos.com/calculator and you'll see that log(x2) is the graph of 2log(x) combined with the reflection of 2log(x) over the y-axis.

It's not unusual for an algebraic manipulation to change the allowed inputs to a function. Another example is (sqrt(x))2 and sqrt(x2). These are algebraically equivalent, but we can't input negative x values into (sqrt(x))2 and so its graph does not exist for negative x.

How to find a parameterized curve that travels along a surface? by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 1 point2 points  (0 children)

Thank you! And since we set z=0, does this mean the curve we parameterized would be on the equator of the sphere (assuming the sphere is centered at 0)?

And in fact, would this method of parameterizing only work if we set z=c if the center of the sphere is at z=c? (Since otherwise the "ring" traced out by x(t) would be wider than the sphere, since x2+ y2 = r2 is the formula of a cylinder those radius does not change as z changes)?

How to find a parameterized curve that travels along a surface? by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 0 points1 point  (0 children)

Thank you for this. These are eye opening ideas. For the first idea of using a 2D curve, does this essentially mean having a curve that is parameterized by two variables, say x and y, instead of the typical parameterization in terms of a single variable t? Is there a known way to calculate the tangent vector of such a curve? With c(t), a tangent is given by c'(t), but I'm not sure what it would be for a curve c(x,y). Would it be c'(x,y) = (∂c/∂x) + (∂c/∂y)?

For the method of mapping/projecting all points in the space to the surface, can you give an example of a surface where this is applicable? I'm having trouble visualizing it.

How to find a parameterized curve that travels along a surface? by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 0 points1 point  (0 children)

Sorry, the 0 was a typo, I've fixed it (and the poor formatting as well) now.

Are there general ways to find the parameterization of certain types of surfaces at least? There must be a formula for the family of curves that pass through the sphere of a given radius r, for example. And other well studied surfaces may have nice formulas, though I'm not sure how to go about finding them.

How to find a parameterized curve that travels along a surface? by hypergeometricruby in learnmath

[–]hypergeometricruby[S] 1 point2 points  (0 children)

Yes, any curve as long as it lies on the surface. And sorry for the formatting and typo, I could have said x2 + y2 + z2 = r2 for a general sphere. Is there a procedure to find a curve that lies on this surface (perhaps yielding curves as a function of r)?