Showing posts with label SAT. Show all posts
Showing posts with label SAT. Show all posts

Saturday, May 1, 2021

TI-84 Plus CE and Casio fx-CG50: Confusion Matrix, Practice SAT Questions with Mometrix

TI-84 Plus CE and Casio fx-CG50:  Confusion Matrix, Practice SAT Questions with Mometrix 

Confusion Matrix

Introduction


In statistical applications, particularly in medicine, we hear about the infection rates of a disease and tests that are created to designate whether people are infected with the disease.  No test, at least not any that I heard of, is 100% accurate in detecting whether a person is infected with a certain virus.  


Tables can be used to summarize the accuracy of a test, measuring one of four outcomes:


true positive (TP):  the person is infected with a virus and the test detects the virus


false negative (FN):  the person is infected with a virus but the test fails to detect it


false positive (FP):  the test states the person is infected when in reality the person does not have the virus


true negative (TN):  the person is not infected and the test accurate detects the person is healthy (does not have the virus)



One of the common names for this type of table is a confusion matrix. 


Two of the many measurements that can be made from a confusion matrix are called sensitivity and specificity.



Sensitivity is the ratio of true positive results against all of the population that is infected.  


Sensitivity = true positive / (true positive + false negative)




Specificity is the ratio of true negative results against all fo the population that is not infected.  


Specificity = true negative / (false negative + true positive)



The program CONFUSE creates two 3 x 3 matrices (see the illustration below):




Matrix A:  Theoretical confusion table.  This takes into consideration the infection rate and test rate and calculates the expected values.


Matrix B:  Simulated confusion table.  The test uses a random number generator to simulate the chance of whether a person is infected by using the infection rate and whether a person's test is correct by using the test rate.  The results will vary.  



TI-84 Plus CE Program: CONFUSE


"EWS 2021-03-10"

ClrHome

DelVar [A]

DelVar [B]

{3,3}→dim([A])

{3,3}→dim([B])

Disp "CONFUSION MATRIX"

Input "POPULATION? ",N

Input "INFECTION RATE? ",C

Input "TEST RATE? ",T

N*C→[A](3,1)

N*(1-C)→[A](3,2)

[A](3,1)+[A](3,2)→[A](3,3)

[A](3,1)*T→[A](1,1)

[A](3,1)*(1-T)→[A](2,1)

[A](3,2)*(1-T)→[A](1,2)

[A](3,2)*T→[A](2,2)

[A](1,1)+[A](1,2)→[A](1,3)

[A](2,1)+[A](2,2)→[A](2,3)

For(I,1,N)

rand→R

[B](3,1)+(R≤C)→[B](3,1)

[B](3,2)+(R>C)→[B](3,2)

End

[B](3,1)+[B](3,2)→[B](3,3)

For(I,1,[B](3,1))

rand→R

[B](1,1)+(R≤T)→[B](1,1)

[B](2,1)+(R>T)→[B](2,1)

End

For(I,1,[B](3,2))

rand→R

[B](1,2)+(R>T)→[B](1,2)

[B](2,2)+(R≤T)→[B](2,2)

End

[B](1,1)+[B](1,2)→[B](1,3)

[B](2,1)+[B](2,2)→[B](2,3)

ClrHome

Disp "THEORY [A]"

Pause [A]

ClrHome

Disp "SIMULATION [B]"

Pause [B]

Disp "SENSITIVITY",[B](1,1)/[B](3,1)

Disp "SPECIFICITY",[B](2,2)/[B](3,2)


Casio fx-CG50 Program:  CONFUSE


"EWS 2021-03-13"

ClrText

{3,3}->Dim Mat A

{3,3}->Dim Mat B

"CONFUSION MATRIX"

"POPULATION"?->N

"INFECTION RATE"?->C

"TEST RATE"?->T

N*C->Mat A[3,1]

N*(1-C)->Mat A[3,2]

Mat A[3,1]+Mat A[3,2]->Mat A[3,3]

Mat A[3,1]*T->Mat A[1,1]

Mat A[3,1]*(1-T)->Mat A[2,1]

Mat A[3,2]*(1-T)->Mat A[1,2]

Mat A[3,2]*T->Mat A[2,2]

Mat A[1,1]+Mat A[1,2]->Mat A[1,3]

Mat A[2,1]+Mat A[2,2]->Mat A[2,3]

For 1->I To N

Ran#->R

Mat B[3,1]+(R<=C)->Mat B[3,1]

Mat B[3,2]+(R>C)->Mat B[3,2]

Next

Mat B[3,1]+Mat B[3,2]->Mat B[3,3]

For 1->I To Mat B[3,1]

Ran#->R

Mat B[1,1]+(R<=T)->Mat B[1,1]

Mat B[2,1]+(R>T)->Mat B[2,1]

Next

For 1->I To Mat B[3,2]

Ran#->R

Mat B[1,2]+(R>T)->Mat B[1,2]

Mat B[2,2]+(R<=T)->Mat B[2,2]

Next

Mat B[1,1]+Mat B[1,2]->Mat B[1,3]

Mat B[2,1]+Mat B[2,2]->Mat B[2,3]

ClrText

"_Mat _A: THEORY" ⊿

Mat A ⊿

"_Mat _B: SIMULATION" ⊿

Mat B ⊿

"SENSITIVITY:"

Mat B[1,1]/Mat B[3,1] ⊿

"SPECIFICITY:"

Mat B[2,2]/Mat B[3,2]


Example


Population:  N = 200

Infection Rate:  5%  (enter 0.05)

Successful Test Rate: 80%  (enter 0.80)


Theoretical Matrix (Matrix A):

[[ 8 38 46

2 152 154

10 190 200  ]]


Some simulated results (Matrix B, your results will vary):


Simulation 1:

[[ 7 40 47

1 152 153

8 192 200 ]]


Sensitivity ≈ 0.8750

Specificity ≈ 0.7917


Simulation 2:

[[ 5 34 39

1 160 161

6 194 200 ]]


Sensitivity ≈ 0.8333

Specificity ≈ 0.8247


Sources:


"Confusion Matrix" Wikipedia.  Last Edited February 27, 2021. https://en.wikipedia.org/wiki/Confusion_matrix   Retrieved March 9, 2021. 


Texas Instruments "Webinar:  Modeling as a Tool To Make Sense of the World Around Us" Presented by Gail Burrill and Tom Dick, Ph.D.  https://education.ti.com/en/professional-development/teachers-and-teams/online-learning/on-demand-webinars/2021/mar-09-2021-modeling-as-a-tool-to-make-sense  March 9, 2021


University of Nottingham.  "Accuracy Table" https://www.nottingham.ac.uk/nursing/sonet/rlos/ebp/sensitivity_specificity/page_four.html  Retrieved March 9, 2021


SAT Practice Problems with Mometrix


In 2018, I mentioned that I was going to practice some SAT questions (http://edspi31415.blogspot.com/2018/02/).  If you are taking the SAT or want to practice, a place to go is Mometrix Test Preparation.  Mometrix has online practice tests for reading, writing, and mathematics, as well as official Sample tests.  

Check them out here:  https://www.mometrix.com/academy/sat-practice-test/

Their math page which includes a free online practice test:  https://www.mometrix.com/academy/sat-math-practice-test/

Many thanks to George Bigelow for the information and site.


Disclaimer:  This is not a paid advertisement.  


Eddie


All original content copyright, © 2011-2021.  Edward Shore.   Unauthorized use and/or unauthorized distribution for commercial purposes without express and written permission from the author is strictly prohibited.  This blog entry may be distributed for noncommercial purposes, provided that full credit is given to the author. 


Sunday, March 4, 2018

Eddie Tackles the SAT – 23 Years Later


Eddie Tackles the SAT – 23 Years Later

For the week of February 26 to March 2, 2018, I tackled some of the problems from the SAT Math Level II practice tests.  I want to find out if I could still solve the problems that is presented to college hopefuls.  I took the SATs, I believe if memory serves me correctly, 23 years ago.

A lot has changed since.  When I took the SATs, graphing calculators were still in its early years.  Now, graphing calculators are a mainstay in mathematical education and mathematicians.  Just look at my blog, most of the posts concern programs for graphing calculators (HP Prime and TI-84 Plus CE mostly). 

I think the SAT is now designed with the expectation that students will use a graphing calculator. 

Since the College Board does not allow reproduction of material from the Official SAT Study Guide except to be used by students in an educational, noncommercial setting, I will exercise caution and not reproduce questions on this blog (though I do not make money off this blog).  (See this page for details:  https://www.collegeboard.org/request-form/instructions )

I will say that the Official SAT Subject Study Test Guide is an excellent source is to consider if you are a college-bound student who is considering taking the SAT.  I bought the guide at a local Barnes and Noble for $20.  The book I purchased has four practice tests of 50 questions.  Each test has an answer key, with detailed explanations for each answer. 

During a lunch break, I took a practice test.  The real test is 60 minutes, but I only could use 30 minutes.  I got 17 questions correct and 3 wrong (2 off of stupid mistakes because I was going too fast). After scaling the results, I got 690, no too bad for a 40 year old. 

To get an 800, a student will need to only answer 43 net questions correct.  Yes, the SAT still carries a 0.25 penalty for incorrect answers. 

Eddie

This blog is property of Edward Shore, 2018

Sunday, February 25, 2018

Happy Sunday - HP Prime Update (Firmware 13441), Next Week

Happy Sunday - HP Prime Update (Firmware 13441), SAT

Happy Sunday! 



HP Prime Update – Firmware 13441

The current firmware is now version 13441.  According to the release notes, Firmware 13441 addresses and corrects any problems that were present in version 13333, including empty lists in geometry, EXPR and nested arguments, and DIMGROB issues.

Links to get the new firmware and Connectivity Kit:




Next Week – I Tackle the SAT

I am going to tackle some practice SAT math questions, particular from the Mathematics Level 2.  It’s been about 23 since I took the SAT (for real), so a lot has changed over the years.  The SAT now allows graphing calculators on the test, and if you check out the SAT page, the College Board is really open to what type of calculator students can use now.  Only calculators with QWERTY keyboards, using styluses (on the Casio Classpad or Sharp EL-9600c), and calculator apps are no-nos.  (No iOS, Android, TI-92 Plus)

 .

Graphing calculators are now allowed on the SAT (on the tests that allow calculators) (L-R: TI-84 Plus CE, HP Prime, Casio fx-CG50)
Also the SAT is now offered seven times year.  I don’t remember if the SAT was offered that frequently back in the early 1990s when I was in high school. 

This is a challenge for me to see if I still can answer some SAT level questions. 

To all those who are taking the SAT (and/or other college entrance exams) this year: best of luck and much success! 


Spam:  It Sucks

Lately the comments section of this blog has been hit by a lot of spam.  I am policing the comments sections posted on the blog.  If you are going to comment, please keep your comments about the topic.  If people were interested in casinos or printer repairs, they would look for that instead of coming here. 

Much thanks to those who post legitimate comments, it is much appreciated.

Thank you,

Eddie


This blog is property of Edward Shore, 2018

HP 20S: Acoustics Programs

HP 20S: Acoustics Programs Program A: Speed of Sound in Dry Air cs = 20.05 × √(273.15 + T°C) Code: 01: 61, 41, A: LBL A 02: ...