Discuss Scratch

IMPULSS
Scratcher
100+ posts

Nth Root Block

Many people have been suggesting a block like this:
()^() :: reporter operators
To be added in. Conversely, I think we should also have an Nth root block like this:
()√() :: reporter operators
To be added in. It's purpose would be self explanatory: calculate the Nth root of X.
Support
Semi-Support
No support

Last edited by IMPULSS (Jan. 2, 2017 06:20:34)

rgl0000
Scratcher
91 posts

Nth Root Block

um, alright, I'm going to ask a stupid question now… what does calculate the Nth root of X mean?
theonlygusti
Scratcher
1000+ posts

Nth Root Block

IMPULSS wrote:

Many people have been suggesting a block like this:
()^() :: reporter operators
Which would also give us an nth root:

(()^((1)/(n)) :: reporter operators)

Last edited by theonlygusti (Jan. 2, 2017 06:33:50)

sakafitrady
Scratcher
100+ posts

Nth Root Block

rgl0000 wrote:

um, alright, I'm going to ask a stupid question now… what does calculate the Nth root of X mean?
Cube roots and Hypercube roots (I made that one up ) Cube root = 3rd Root and Hypercube root = 4th Root. It means the number if cubed (or hypercubed) it will be that number. For example: 3rd Root of 8 = 2 because 2*2*2 = 8
IMPULSS
Scratcher
100+ posts

Nth Root Block

rgl0000 wrote:

um, alright, I'm going to ask a stupid question now… what does calculate the Nth root of X mean?
The value N is equal to what's inputted into the first box
The value X is equal to what's inputted into the second box
So what number do we need to multiply itself N amount of times to get X
For example, if I wanted to know what 3√5 is, I would use
(3)√(5) :: reporter operators
to figure out the 3rd root of 5, where N is equal to 3 and X is equal to 5.
IMPULSS
Scratcher
100+ posts

Nth Root Block

theonlygusti wrote:

IMPULSS wrote:

Many people have been suggesting a block like this:
()^() :: reporter operators
Which would also give us an nth root:

(()^((1)/(n)) :: reporter operators)

That's a workaround, but it's also assuming that the first suggestion will get accepted (Although it probably will if this one is implemented), and further to the point, the workaround isn't as accurate as the block. According to the workaround, the cube root of 8 is 2.82842712474619, while the block should report 2.
theonlygusti
Scratcher
1000+ posts

Nth Root Block

IMPULSS wrote:

the workaround isn't as accurate as the block. According to the workaround, the cube root of 8 is 2.82842712474619, while the block should report 2.
Then you did something wrong





And btw, the rounding error in the final image is caused by Scratch's inaccurate exponentiation workaround, not the method used for obtaining the nth root.
IMPULSS
Scratcher
100+ posts

Nth Root Block

theonlygusti wrote:

-snip-
The workaround is accurate (I messed up my math), but there's still the issue of the majority of Scratchers knowing it.
theonlygusti
Scratcher
1000+ posts

Nth Root Block

IMPULSS wrote:

theonlygusti wrote:

-snip-
The workaround is accurate (I messed up my math), but there's still the issue of the majority of Scratchers knowing it.
I just think that the style of block you suggested is ambiguous, maybe there could be a better naming scheme.
IMPULSS
Scratcher
100+ posts

Nth Root Block

theonlygusti wrote:

IMPULSS wrote:

theonlygusti wrote:

-snip-
The workaround is accurate (I messed up my math), but there's still the issue of the majority of Scratchers knowing it.
I just think that the style of block you suggested is ambiguous, maybe there could be a better naming scheme.
Maybe a
() root of () :: reporter operators
block?
SquirreIstar
Scratcher
1000+ posts

Nth Root Block

Support based on the reasons in this duplicate of mine
ACE2_0
Scratcher
11 posts

Nth Root Block

Any of these options would be much easier and more compact than the workaround. Personally, I would like both options for the same reason that we have both addition and subtraction. Not necessary to have both, but much easier.
accountcraft123
Scratcher
100+ posts

Nth Root Block

okay.

Lets sort through this one at a time.

sakafitrady wrote:

rgl0000 wrote:

um, alright, I'm going to ask a stupid question now… what does calculate the Nth root of X mean?
Cube roots and Hypercube roots (I made that one up ) Cube root = 3rd Root and Hypercube root = 4th Root. It means the number if cubed (or hypercubed) it will be that number. For example: 3rd Root of 8 = 2 because 2*2*2 = 8
Okay so, A 4th root is actually called a quartic root and when you say hypercube I believe you are referring to a tesseract.

Next,

to answer to your question

IMPULSS wrote:

Many people have been suggesting a block like this:
()^() :: reporter operators
To be added in. Conversely, I think we should also have an Nth root block like this:
()√() :: reporter operators
To be added in. Its purpose would be self-explanatory: calculate the Nth root of X.

is in order to calculate the nth root of something you need logarithms which ARE in the scratch editor. THe (nth root) of 2 = 3, for instance, = 2^(1/n) = 3. Next, you convert this to a logarithm, log<base 2> of 3 = 1/n. Although logarithms in the editor are only base 10, so you use the change of base formula. log<base b> of x = (log<base d> of x)/(log<base d> of b), so log<base 2> of 3 = 1/n is log(3)/log(2)= 1/n. Now simple algebra can tell you the answer.
In this example log(2)/log(3) = n. While nth root of x = y is log(x)/log(y) = n.

Please tell me if I made a mistake or if you are confused.

ALGEBRA II BABY!!!!!!

Last edited by accountcraft123 (March 25, 2020 23:57:22)

accountcraft123
Scratcher
100+ posts

Nth Root Block

(([log] of (x)) / ([log] of (y)))
Cash737
Scratcher
62 posts

Nth Root Block

Like @theonlygusti said, you can make this by using the equation shown, and then use the
 (round ()) 
block to round it to the nearest 1, 10 or whatever.

In conclusion, we don't need this block.
SquirreIstar
Scratcher
1000+ posts

Nth Root Block

Cash737 wrote:

Like @theonlygusti said, you can make this by using the equation shown, and then use the
 (round ()) 
block to round it to the nearest 1, 10 or whatever.

In conclusion, we don't need this block.
Right? So we don't need the minus block, because it has an easy workaround! We don't need the change var block, because it has an easy workaround too! heavy sarcasm intended

The point is, the presence of a workaround doesn't make a block not needed.

Last edited by SquirreIstar (March 26, 2020 12:09:13)

accountcraft123
Scratcher
100+ posts

Nth Root Block

If this post has been answered, could the author report it as resolved.
Za-Chary
Scratcher
1000+ posts

Nth Root Block

accountcraft123 wrote:

If this post has been answered, could the author report it as resolved.
This is a suggestion, not a question. So, it is not resolved since it is not implemented or rejected yet.
accountcraft123
Scratcher
100+ posts

Nth Root Block

My apologies. I completely forgot about that.
sathvikrias
Scratcher
500+ posts

Nth Root Block

<(this makes no sense... v )>

Last edited by sathvikrias (Oct. 16, 2020 13:59:34)

Powered by DjangoBB