Question: in python Analysis Using a deck of cards numbered 1 - 52, shuffle the cards fifteen times using several different methods described below to produce


in python
Analysis Using a deck of cards numbered 1 - 52, shuffle the cards fifteen times using several different methods described below to produce a permutation of the original deck. Calling the original order i and the new deck yi, calculate the following function for each of the fifteen runs. r=250796013782ni=1niyi13782 This is a specific instance of a correlation calculation, which we will learn about in more detail later in the course. The full calculation is given by: r=(ni=1ni2(i=1ni)2)(ni=1ny2(i=1ny)2)ni=1niyi(i=1ni)(i=1nyi) Note that i=1niyi changes from shuffle to shuffle, but all of the other pieces of the formula remain the same since i and y are the numbers 1 through 52, and adding the digits and the squares of the digits produces the same value. i=1ni=i=1nyi=1378 This computation is the correlation coefficient, which we will see in more detail later in the course. The correlation coefficient is a measure of how related two sets of numbers are. If r=0 or if r is close to 0 then the two variables are completely independent. If r=1, then the i values and the yi values are all equal, i=yi. If r=1 then the y values are backward, so that i=y53i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
