Eternity Async Tutoring

Some of the main data types in programming are:

binary (true/false)
numbers (usually with separate data types for integers and for inexact real numbers)
strings (typically put in quote marks, like “hello”)
arrays (basically lists)
hash tables (key/value stores)
symbols (kind of like names for internal use)

In some languages, when you create a variable, you have to say what type it is. Like:

integer x = 3

In ruby you don’t specify types and you can (but usually shouldn’t) switch a variable to a different type.

x = 4
x = 3
x = "hello"
x = :symbol

You can keep changing what x is, including to different types.

Similarly, some languages make you specify data types for function inputs and outputs. Ruby doesn’t.

Ruby has introspection features where you can ask questions to your data, e.g. what type it is.

image

Hashes (key/value storages) work like this:

image

Both the key and value can be any type, and they can be different types than each other. In some languages, all the keys would have to be the same type, and all the values would have to be the same type.

Play around with this a little. If it doesn’t make sense, look it up some. I’m giving very brief explanations so it’s totally understandable if you need more information.

Look up and play around with arrays (lists) a bit.

Ruby also has functions for converting between data types.

image

The to_a function can convert a hash to an array, and to_h can convert an array to a hash. Try those out. You’ll likely get an error message at some point and need to look up how to use those functions successfully.

Do you need help with something?

1 Like

Nah. Just busy. The next three days I have off so I should be posting. Taking a train to New York for an event. Two eight hour spans where I was planning on working on stuff (going and coming bacK). Tomorrow and Thursday I should definitely be posting some stuff. Wednesday maybe.

Two things to share here actually:
First, I’ve noticed that things like trips and stuff throw me off quite a bit. From planning, to expenses, to how it affects my schedule, etc. It just kind of messes me up quite a bit. I have no trips coming up next year and I think I’m going to leave it at that. It makes it hard for me to work on stuff when I know I won’t be at home for a bit. I remember this being kind of an issue when I went to Korea recently and I wanted to work on quitting caffeine a bit sooner but instead delayed plans so I could go to Korea. I think for now I’m going to work on better planning trips out and stuff without feeling like it messes up my momentum.

Second, the other part of being busy is just family related matters. I don’t mind sharing and I think it was kinda bad how my extended family does stuff (my immediate family has issues but they feel normal growing up with those issues). Long story short:

aunt wants her brother to immigrate here. my dad wanted to do it for the longest time but for a bunch reasons no longer wants to do it. she told him he would get a large amount of cash and they would house him. my aunts husband doesn’t want to sponsor him for immigration but said they would house him. mom and dad do the whole process. now my aunt and her husband backtrack and say they can’t take him. her husbands like hes your family he should live with you. a bunch of stuff happened where we out of nowhere (kinda) have a new family member in the house. a lot of time and energy has been spent this past week on this from budgeting, to where hes staying (we had no room initially), to planning out some other stuff, very annoying. *

*note: me and my brother both were against this sponsorship considering our parents (primarily my mom) didn’t care for this and its a huge liability. however, she trusted my aunt because she’s family and the same race and she wanted my aunt off her back.

I rewatched the arithmetic tree video. I’m pretty sure I’m fine with that. Here’s the one tree I did:

I also looked over the systems of equations stuff and I still remember how to do it in concept for any number of variables. If desired I could do a problem.

Will look over your Multi factor math article next and the number line stuff we did. Hmm. Should I try and link to your articles in our tutoring thread too?

Oh yeah. Question: how do you solve the below using a tree?

3x + 2 = 6

In the video you mentioned all math can be tree’d. The process for solving, however, will differ. If this is irrelevant to philosophy then ok. I was just curious.

So (does this need to be quoted too?):

def g(x,y)
  return x+3*y
end

is the same as g(x,y) = x+3y

Hmm. So I’ll do f(x,y,z) = 2 + xyz.

I did:

def f(x,y,z)
    return 2+x*y*z
end


puts f(3,4,5)

quoting is good, ya

good

you have an error or typo. the 6 and 2 in the tree should be swapped.

you could add “-2” (as 2 nodes) to both sub-trees of the = node.

then you could add the nodes for dividing by 3 to both sides of the equals.

and then you can simplify the subtrees on both sides of the equals.

in other words, every step of the regular way of solving it can be expressed with trees.

1 Like

your tree will get the right answer but FYI it’s a little different than what the equation says. you basically did a little bit of simplifying the expression for convenience.

the equation says to subtract 7, not to add negative 7.

try making a tree for doing it that way.

So you would solve it the regular way just using a tree. Ok. That makes sense.

Like this?:


I’m a little confused on where to put the dividing by 3s on both sides to make it look normal. I’m not even sure its representing what I want correctly.

That’s not a valid tree. For example, division nodes should have exactly two children.

Try writing out a step normally like

3x + 2 - 2 = 6 - 2

and then converting that to a tree.

Then you could simplify but you could also do this:

(3x + 2 - 2) / 3 = (6 - 2) / 3

Then convert that to a tree.

yes, good

Did you change how the outline for your article shows on your website? I think I like it on the side more but an issue I just noticed (or it could just be me) is that long outlines don’t fully show. From the Multi-Factor Decision Making Math article:

I know some websites have a feature where you can scroll through there outline thing but it doesn’t seem like I can do that here. Is it a me issue or a site issue?

No, it changes automatically based on the width of the browser window.

If your window is wide but not tall enough, you can make it less wide so the whole ToC isn’t on the side and will show, or you can shrink your font. The tool I added to the site doesn’t have scrolling inside the ToC.

1 Like

Ok. I see that now. I haven’t really messed with the size of my browser window before so I was confused. Maybe something changed in a mac update?