topic Re: Problem with a list/sort function for a formula problem in Canvas Question Forum
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56605#M3065
<HTML><HEAD></HEAD><BODY><P> <LI-USER uid="105160"></LI-USER> , thank you, thank you, <STRONG><EM>thank you</EM></STRONG>! I did as you suggested, and it worked perfectly! I'm so thrilled. I *love* being able to create meaningful/useful practice AND graded quizzes via Canvas, and this is one that I really wanted to make work! I'm going to take this and run with it now and I foresee lots of awesome Normal Distribution questions in my students' Canvas future! <IMG id="smileywink" class="emoticon emoticon-smileywink" src="https://community.canvaslms.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /></P><P></P><P>I am, officially, tickled pink!</P><P></P><P>It would be great if the Modern Quizzing Engine would address this - or just have some of the frequently used statistical functions built-in!</P></BODY></HTML>Sat, 30 Jan 2021 00:16:04 GMTdmg342021-01-30T00:16:04ZProblem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56603#M3063
<HTML><HEAD></HEAD><BODY><P>I was very eager to try applying some of the techniques in <LI-USER uid="105160"></LI-USER> 's post, <A href="https://community.canvaslms.com/migration-blogpost/1415" target="_blank">Looking up Values in Formula Questions</A>. I'm trying to write problems for a stats class, and I think my case is actually even a little bit easier than the one addressed in the blog post. My list is the areas to the left of z, over a range of z-scores (for this question, the z scores can range from z=0.10 to z=1.50).</P><P></P><P>I believe I understand everything in the blog post and felt ready to tackle designing my question. I have produced the comma-delimited list (I use Excel for the values and then pasted into Word and cleaned it up). But, when I try to enter it into Canvas per the directions in James' post, I get the following error:</P><P><SPAN class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"><IMG src="https://community.canvaslms.com/t5/image/serverpage/image-id/24218i1D7FB25779E5C177/image-size/large?v=1.0&px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /></SPAN></P><P></P><P>I have tried to determine the issue by test-entering a short list, such as list=sort(5,3,4) or even just sort(5,3,4), and various permutations and variations thereof. Nothing works, I always get this error. I also tried the "reverse" function. I am at a loss for why this isn't working, and obviously, it has stopped me dead in my tracks for the result I am trying to accomplish! I will be tickled pink if I can get this question to work the way I want it to (it opens up soooo many possibilities for using Canvas to test this topic!) but I don't know what to do now. Any help would be greatly appreciated!</P></BODY></HTML>Sat, 30 Jan 2021 00:16:01 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56603#M3063dmg342021-01-30T00:16:01ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56604#M3064
<HTML><HEAD></HEAD><BODY><P>That error is one that started popping up when Canvas decided to redo the way they formatted numbers. That is the same fiasco that added a .0 to the end of integers so 5 comes out as 5.0</P><P></P><P>They are checking for a method called .toPrecision() when they display a number. The problem is that sort() and reverse() don't return numbers, they return an array (list) of numbers of the .toPrecision() method doesn't exist for the list type.</P><P></P><P>The error is telling you that it doesn't know how to format a list of numbers with the indicated number of decimal places.</P><P>That's what the error means, now the real question is what should you do?</P><P></P><P>Your real issue is that you're missing the at() function, which tells it which item in the list to return. Once you give it a value to return, then it is able to correctly format it and doesn't return the error.</P><P></P><P><span class="lia-inline-image-display-wrapper" image-alt="204751_pastedImage_0.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24205i57461CBDEC819DA9/image-size/large?v=v2&px=999" role="button" title="204751_pastedImage_0.png" alt="204751_pastedImage_0.png" /></span></P><P></P><P>at() is a 0-based pointer into the list. So my value of x is 1, but starting with 0, 1 is the 2nd number in my list, which is why it returns a 2.</P><P></P><P>Note that the list still was defined even if the error message shows up. I can't guarantee that, just mentioning it.</P><P></P><P>Unless you need the list multiple times, I try to just use the at() function around the list itself. Instead of <EM>list=sort(1,2,3,4)</EM> followed by <EM>at(list,x)</EM> I just combine them and use <EM>at(sort(1,2,3,4),x)</EM></P><P></P><P><span class="lia-inline-image-display-wrapper" image-alt="204758_pastedImage_9.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24206iF3550E8F2036341C/image-size/large?v=v2&px=999" role="button" title="204758_pastedImage_9.png" alt="204758_pastedImage_9.png" /></span></P><P>That's a little harder to read but will avoid the TypeError message.</P><P></P><P>In my opinion, users shouldn't see this error message. A much more appropriate one would be something like "Not a single value" or "List". It used to be that it showed the list so you could see what was happening, and that was nice too. Their code should probably check to see if there is a .toPrecision() method and not call it when there isn't. The current approach lets someone know that something isn't working - although it's a false positive in this case. That should really be handled in development code, not in production code that is released to the public.</P><P></P><P>Hopefully it will get fixed in the Modern Quizzing Engine.</P></BODY></HTML>Fri, 30 Sep 2016 13:38:25 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56604#M3064James2016-09-30T13:38:25ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56605#M3065
<HTML><HEAD></HEAD><BODY><P> <LI-USER uid="105160"></LI-USER> , thank you, thank you, <STRONG><EM>thank you</EM></STRONG>! I did as you suggested, and it worked perfectly! I'm so thrilled. I *love* being able to create meaningful/useful practice AND graded quizzes via Canvas, and this is one that I really wanted to make work! I'm going to take this and run with it now and I foresee lots of awesome Normal Distribution questions in my students' Canvas future! <IMG id="smileywink" class="emoticon emoticon-smileywink" src="https://community.canvaslms.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /></P><P></P><P>I am, officially, tickled pink!</P><P></P><P>It would be great if the Modern Quizzing Engine would address this - or just have some of the frequently used statistical functions built-in!</P></BODY></HTML>Sat, 30 Jan 2021 00:16:04 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56605#M3065dmg342021-01-30T00:16:04ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56606#M3066
<HTML><HEAD></HEAD><BODY><P>Ack.... <LI-USER uid="105160"></LI-USER> (or anyone else who knows), now I have a new and different problem. This was going so well - I have a basic P(X<k) problem and a P(X>k) problem, but now I'm trying to do a P(m<X<k) problem. Look at what is happening.</P><P></P><P>Here is the question text and variable definitions:</P><P><SPAN class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"><IMG src="https://community.canvaslms.com/t5/image/serverpage/image-id/24207i38E1D5703C3D3B2E/image-size/large?v=1.0&px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /></SPAN></P><P>Obviously, I carefully limited my "upper bound" and "lower bound", so that the upper bound would always be higher than the lower bound. Everything worked find with the example values.</P><P></P><P>But now look at my generated values:</P><P><SPAN class="lia-inline-image-display-wrapper" image-alt="Capture2.PNG"><IMG src="https://community.canvaslms.com/t5/image/serverpage/image-id/24208i8E5DE5D737507400/image-size/large?v=1.0&px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /></SPAN></P><P></P><P>In the very first set of values, the upper bound is BELOW the minimum allowed by my variable definitions! What the what?? There are several others in the generated values which are like this - either UB or LB outside the allowed values - causing the final answer to be negative! This is no good, no good at all. I don't understand why it's doing this. I've never seen the values for the variables in a formula question not adhere to the stated limits. Any thoughts? Did I do something stupid that I'm just not seeing??</P><P></P><P>Just when everything was going so well.... lol.</P></BODY></HTML>Sat, 30 Jan 2021 00:16:07 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56606#M3066dmg342021-01-30T00:16:07ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56607#M3067
<HTML><HEAD></HEAD><BODY><P>Here is one more piece of weirdness that I don't understand.... in trying to debug the above, I went in to edit the first problem I did. Now I see this:</P><P><span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24209i109FAFAF7C4E17D4/image-size/large?v=v2&px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /></span></P><P>Now, I don't think it's a problem for this particular questions, since I already generated the possible solutions. But if I try to re-generate solutions, I get an error ("The system could not generate any valid combinations for the parameters given"). So I can't make any changes to the question (or I guess I would have to re-enter the "at(sort..." line to do so). I don't know why this would be.</P></BODY></HTML>Fri, 30 Sep 2016 16:30:58 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56607#M3067dmg342016-09-30T16:30:58ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56608#M3068
<HTML><HEAD></HEAD><BODY><P>Did you change something after problem was set up?</P><P></P><P>I ask because I notice that the question text has [mu], [LB], and [UB] in that order. However, the variable definitions and the table have the order mu, UB, and LB. When I go through and edit the question text and change the order, it changes the order in the Variable Definitions section but the order in the Generate Possible Solutions section remains the same until I generate a new sample and then it matches the variable definitions section.</P><P></P><P>Your order is different from the text to the definitions but the same in the definitions as the possible solutions, so it looks like something got off somewhere, although I'm not sure where.</P><P></P><P>You're probably going to have to do some level of recreating the question until it works. If regenerating doesn't fix it, then try redoing the question text and see if it changes the order. You may need to refresh the page or recreate the question.</P><P></P><P>I imagine it's a one-off rather than an actual error and so you probably don't need to file a bug report. Something probably just got out of sync somewhere.</P></BODY></HTML>Fri, 30 Sep 2016 16:55:20 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56608#M3068James2016-09-30T16:55:20ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56609#M3069
<HTML><HEAD></HEAD><BODY><P>Thank you AGAIN! What a great observation. When I reloaded the question, the variable restrictions were in the same order as they are listed in the question, and all seems to have worked properly now. I did have to re-enter the two "at(sort(...." lines due to the other glitchy thing described below, but then when I generated solutions, they all have the correct bounds on the variables! I think I'm back on track! </P></BODY></HTML>Fri, 30 Sep 2016 17:12:18 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56609#M3069dmg342016-09-30T17:12:18ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56610#M3070
<HTML><HEAD></HEAD><BODY><P>I think your formula got cut off. If you look closely, you can see the very last line contains a 0 and nothing else. The formula is incomplete and that's causing it problems. Don't worry about e and d, those aren't your variables, those are the JavaScript variables used to process what you put in.</P><P></P><P>To double check, I pasted a similar formula, going farther than your 0.9131, and it took the whole thing:</P><P><span class="lia-inline-image-display-wrapper" image-alt="204762_pastedImage_2.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24210iB7C8B9A5FF9514B3/image-size/large?v=v2&px=999" role="button" title="204762_pastedImage_2.png" alt="204762_pastedImage_2.png" /></span></P><P>Now, if you don't put spaces, it limits any one sequence of characters to 1024 characters, so don't try to run the values together without spaces. You didn't do this, I'm just putting the heads up for someone else who tries it.</P><P></P><P>There are formulas available for approximating the cumulative probability for a standard normal score. You might want to look into one of those. The simplest won't give you 4 decimal place accuracy, but there are several listed on Wikipedia's <A href="https://en.wikipedia.org/wiki/Normal_distribution" title="https://en.wikipedia.org/wiki/Normal_distribution">Normal distribution</A>. Look in the "Numerical approximations for the normal CDF" section. The Zelen and Severo (1964) provides a fifth order polynomial approximation with an error of less than 7.5e-8, which should be more than sufficient for your need.</P></BODY></HTML>Fri, 30 Sep 2016 17:34:55 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56610#M3070James2016-09-30T17:34:55ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56611#M3071
<HTML><HEAD></HEAD><BODY><P>Hmmm.... I noticed that it was cut off at the end, but I don't know what's causing that. When I originally enter the line, it is definitely all there - it's when I re-open the question in "edit" mode that it's a problem (which is an annoyance, because I copy the question into the question bank several times and go in and tweak each version; because of this error, I need to delete and re-enter the at(sort... line).</P><P>Here is what I entered, from formulas down to the bottom of the list:</P><P><span class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24211iBDC60D5005855CD3/image-size/large?v=v2&px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /></span></P><P><span class="lia-inline-image-display-wrapper" image-alt="Capture2.PNG"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24212i55FD797D24797C34/image-size/large?v=v2&px=999" role="button" title="Capture2.PNG" alt="Capture2.PNG" /></span></P><P></P><P>Then I saved the question, and then clicked edit, and I see this:</P><P><span class="lia-inline-image-display-wrapper" image-alt="Capture3.PNG"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24213iA6C195CA943E2243/image-size/large?v=v2&px=999" role="button" title="Capture3.PNG" alt="Capture3.PNG" /></span></P><P>So there is definitely something that Canvas is not liking about that line, after I exit and return to the problem. As I said, I can work around it, since it doesn't appear to affect the solutions that I have already generated; but it is still quite curious. It is definitely imposing a 1024 character limit, so that's the problem, though I'm not sure what is triggering it.</P><P></P><P>Thank you for your tip on the approximation formula. I will try playing around with that as well! And thank you again for all of your time and help! I'm very grateful! <img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://community.canvaslms.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /></P></BODY></HTML>Fri, 30 Sep 2016 18:06:43 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56611#M3071dmg342016-09-30T18:06:43ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56612#M3072
<HTML><HEAD></HEAD><BODY><P>Aaaannnnd.... I'm back! I've spent quite a lot of time working on making this work with the approximation formula that <LI-USER uid="105160"></LI-USER> directed me to. I ran into a couple of small problems along the way, but was able to work through each one:</P><P>1. The formula result was actually TOO precise. Meaning, my students are working from a cumulative standard normal distribution table, which gives the area to 4 decimal places, left of z-values to 2 decimal places. I realized that the results were usually slightly different from the table value, since Canvas was using z to 4 decimal places. Workaround: multiply z*100 and round to integer, then divide by 100. This forces the z to 2 decimal places.</P><P>2. The formula is for positive z values only. So I used a zsign variable which is =1 or =-1, compute the area for |z|, and then use an if() statement to get the area, depending on whether the original z is positive or negative.</P><P></P><P>All of this worked well! And since the formula takes away the limitation on my z-values (using the list approach, I was only allowing -2.5<z<2.5), I can also let sigma be random.</P><P></P><P>So then I tackled the "between" probability problem, which basically just required 2 lines of each formula - one for z1 and z2. I generated a few sample values to make sure everything was working the way I thought it was. What I found is, <EM>occasionally</EM>, the final result is off +/- 0.0001! Here is all of my formulas, with example values illustrating the problem:</P><P></P><P><SPAN class="lia-inline-image-display-wrapper" image-alt="Capture.PNG"><IMG src="https://community.canvaslms.com/t5/image/serverpage/image-id/24214i7B3AB3EBE302A762/image-size/large?v=1.0&px=999" role="button" title="Capture.PNG" alt="Capture.PNG" /></SPAN></P><P>Notice that left2-left1=0.5714 - 0.0384 = 0.5331, should be 0.5330. I saw at least one other example where the result was -0.0001. I guess this is some quirk in Canvas where something in the rounding beyond the 4 decimal places is (sometimes) throwing off the final answer? I suppose I can just set the margin of error to +/- 0.0001. But still puzzled by this! Just when I think I have it allllll figured out! <IMG id="smileywink" class="emoticon emoticon-smileywink" src="https://community.canvaslms.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /></P></BODY></HTML>Sat, 30 Jan 2021 00:16:09 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56612#M3072dmg342021-01-30T00:16:09ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56613#M3073
<HTML><HEAD></HEAD><BODY><P>I took formula 26.2.17 from <A href="http://people.math.sfu.ca/~cbm/aands/page_932.htm">Abramowitz and Stegun, p932</A>, and converted it into a Canvas formula.</P><P></P><P>It will give you almost 7 decimal place accuracy (|error| < 7.5e-8). As confirmation, I went from z=0 to z=7.19 (I had to stop somewhere) by 0.01 and compared the value returned from the formula to the value returned by Excel, the largest error was 7.45061e-8</P><P></P><P>The formula they gave is only for positive values of x, but I modified it to work positive or negative values. I also used z instead of x, which frees people up to use x in the problem and compute z separately (to 4 decimals at least).</P><P></P><P>There was a formula directly above it that was simpler and would guarantee 4 decimal place accuracy. However, I have my students use a probability calculator that I wrote instead of the tables in the back of the book and it gives 6 decimal places. I did generate 200 possible solutions involving positive and negative z scores between -5 and 5 and then copy/pasted those into Excel where I compared to the value Excel gave (also rounded to four decimal places). There were no errors, so I feel pretty good about the formula.</P><P></P><P>Just to be clear, the formula does return the area to the left of the z-score.</P><P></P><P>If you want them to have answers that compare to Minitab or other software that don't round until the very end, then paste this formula into another calculation.</P><P></P><P>if(z,if(1+z/abs(z),1-(0.31938153/(1+0.2316419*z)-0.356563782/(1+0.2316419*z)^2+1.781477937/(1+0.2316419*z)^3-1.821255978/(1+0.2316419*z)^4+1.330274429/(1+0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi),(0.31938153/(1-0.2316419*z)-0.356563782/(1-0.2316419*z)^2+1.781477937/(1-0.2316419*z)^3-1.821255978/(1-0.2316419*z)^4+1.330274429/(1-0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi)),0.5)</P><P></P><P>If you want them to have answers rounded to 4 decimal places like they would get from the back of a textbook, then you need to force rounding of the numbers. I originally thought that generating it with 4 decimal places would round it to 4 decimal places, but it seems that now Canvas only displays it to 4 decimal places and keeps the full number rather than actually rounding it to 4 decimal places. I'm not sure if this is a change, but I'm pretty sure it is and I'm also pretty sure it's going to mess up some people's formulas who are counting on Canvas rounding.</P><P></P><P>round(10000*if(z,if(1+z/abs(z),1-(0.31938153/(1+0.2316419*z)-0.356563782/(1+0.2316419*z)^2+1.781477937/(1+0.2316419*z)^3-1.821255978/(1+0.2316419*z)^4+1.330274429/(1+0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi),(0.31938153/(1-0.2316419*z)-0.356563782/(1-0.2316419*z)^2+1.781477937/(1-0.2316419*z)^3-1.821255978/(1-0.2316419*z)^4+1.330274429/(1-0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi)),0.5))/10000</P></BODY></HTML>Sat, 01 Oct 2016 01:20:35 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56613#M3073James2016-10-01T01:20:35ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56614#M3074
<HTML><HEAD></HEAD><BODY><P>The problem with your approach is that you're rounding some of the intermediate steps to 4 decimal places, but missed the important one.</P><P></P><P>Unaware of what you were writing, I took some time and converted the formula to be an all-in-one so there is no rounding issue. After I had saved it, I saw this message and realized I had just answered the next problem.</P><P></P><P>If you want to mimic the behavior of looking up values in a book, then save the result to a variable with 4 decimals and then use that variable.</P><P></P><P>There is still a potential issue - if your calculations yield a z-score with more than 4 decimals, it might be off. So, you might have to tell your students to round z-scores to 2 decimals (you're probably doing this anyway if you're making them use tables). Then make sure when you compute z that you round it to 2 decimal places in Canvas.</P><P></P><P>For the in-between numbers, you can just reassign z before doing the calculation</P><P><span class="lia-inline-image-display-wrapper" image-alt="204772_pastedImage_0.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24215i18D082399303A982/image-size/large?v=v2&px=999" role="button" title="204772_pastedImage_0.png" alt="204772_pastedImage_0.png" /></span></P><P></P><P>However, even though the probabilities will match the back of the textbook to 4 decimal places, that doesn't mean that they will come out right.</P><P></P><P>Consider the following:</P><P><span class="lia-inline-image-display-wrapper" image-alt="204842_pastedImage_1.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24216iEA1B404EB3CABD66/image-size/large?v=v2&px=999" role="button" title="204842_pastedImage_1.png" alt="204842_pastedImage_1.png" /></span></P><P>The formula correct returned 0.4090 for the area to the left of z=-0.23 and 0.9545 for the area to the left of z=1.69.</P><P>However, Canvas subtracted 0.9545-0.4090 and got 0.5454 instead of 0.5455</P><P></P><P>However, if you don't round, then the actual value is 0.545440138, which rounds to 0.5454 - the value that Canvas returned.</P><P></P><P>It looks like Canvas is not using the rounded value, only rounding for display purposes. That's good, but it throws off the people who want their student's to look up values from a table.</P><P></P><P>I added a round statement to the check to force rounding to 4 decimal places.</P><P></P><P>round(10000*if(z,if(1+z/abs(z),1-(0.31938153/(1+0.2316419*z)-0.356563782/(1+0.2316419*z)^2+1.781477937/(1+0.2316419*z)^3-1.821255978/(1+0.2316419*z)^4+1.330274429/(1+0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi),(0.31938153/(1-0.2316419*z)-0.356563782/(1-0.2316419*z)^2+1.781477937/(1-0.2316419*z)^3-1.821255978/(1-0.2316419*z)^4+1.330274429/(1-0.2316419*z)^5)*e^(-0.5*z^2)/sqrt(2*pi)),0.5))/10000</P><P></P><P>Now the formula correctly matches what's in the table from the textbook and uses the rounded values in the subtraction.</P><P></P><P><span class="lia-inline-image-display-wrapper" image-alt="204843_pastedImage_3.png"><img src="https://community.canvaslms.com/t5/image/serverpage/image-id/24217i696923E9FB684D30/image-size/large?v=v2&px=999" role="button" title="204843_pastedImage_3.png" alt="204843_pastedImage_3.png" /></span></P><P></P><P>I'll fix my other post to reflect that Canvas does not round the other values.</P></BODY></HTML>Sat, 01 Oct 2016 01:49:04 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56614#M3074James2016-10-01T01:49:04ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56615#M3075
<HTML><HEAD></HEAD><BODY><P>In tracking this down, I found the problem, but forgot to go back and fix the first sentence. It's not that you're rounding to 4 steps, it's that you're only rounding <EM>some</EM> of the results. Your issue with it not coming out right was that you didn't rounding a1left and aleft2 and Canvas doesn't round variables like I'm pretty sure that it used to. I'll edit my first sentence to reflect the change.</P></BODY></HTML>Sat, 01 Oct 2016 01:57:50 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56615#M3075James2016-10-01T01:57:50ZRe: Problem with a list/sort function for a formula problem
https://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56616#M3076
<HTML><HEAD></HEAD><BODY><P> <LI-USER uid="105160"></LI-USER> , I know I sound like a broken record, but thank you again! This approach is so much more slick and concise than mine. And gives the exact result that I'm trying to achieve! I had originally tried to enter the Zelen and Severo formula in one line, but I was getting errors and having trouble tracking down the problem, so I broke it up into pieces. (Ironic, since I often harp on my students about rounding in intermediate steps.... lol.) Your use of the if statement to both check for z=0 and also account for z<0 or z>0 is much more efficient, and the round() element should take care of the table-matching problem. I only have them use the table at this point. I do show them how to use their calculator function to get the area, but I find that only a small handful of students actually prefer to do it that way.</P><P></P><P>Have a great weekend!</P></BODY></HTML>Sat, 30 Jan 2021 00:16:12 GMThttps://community.canvaslms.com/t5/Canvas-Question-Forum/Problem-with-a-list-sort-function-for-a-formula-problem/m-p/56616#M3076dmg342021-01-30T00:16:12Z