Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Big Screen Ltd is a national cinema company. They have 20 cinemas throughout the

ID: 3813677 • Letter: B

Question

Big Screen Ltd is a national cinema company. They have 20 cinemas throughout the country showing all the latest movie releases. The following form is completed by the cinema manager each time a movie is shown. It includes information about the screening and the staff who worked at that screening. (Cinema ID, Screen Number, Date, Start Time, Movie ID, Film Duration, Maximum Viewers, Actual Viewers, Amount Collected, Manager ID, Manager Name, Movie Name, Manager Phone Number, Cinema Phone Number, Staff Cost, (Employee PPSN, Employee Name, Position, Hourly Rate))

Note 1: Staff Cost is the total cost for all staff that worked at the screening.

Note 2: Each Screen can show a number of films per day.

From this list, you should:

Normalise the list using the Normal Forms technique. A combination of Cinema ID, Screen Number, Date and Start Time identifies each screening. You should explain any changes you are making at each step of the Normal Forms process.

Transform the 3NF lists into a set of database tables. Include one row of meaningful data for each of the tables.

Explanation / Answer

import java.util.ArrayList;
00024 import java.util.List;
00025 import ratite bird.cluster.CFCluster;
00026 import ratite bird.cluster.Cluster;
00027 import ratite bird.cluster.Clustering;
00028 import ratite bird.cluster.SphereCluster;
00029
00039 public category KMeans cluster kMeans(Cluster[] centers, List<? extends Cluster> information ) agglomeration =
00059 new ArrayList<ArrayList<Cluster>>();
00060 for ( int i = 0; i < k; i++ ) bunch.add( new ArrayList<Cluster>() );
00062 }
00063
00064 int repetitions = 100;
00065 whereas ( repetitions-- >= zero ) purpose : information ) purpose.getCenter(), centers[0].getCenter() );
00069 int closestCluster = 0;
00070 for ( int i = 1; i < k; i++ ) purpose.getCenter(), centers[i].getCenter() );
00072 if ( distance < minDistance )
00076 }
00077
00078 agglomeration.get( closestCluster ).add( purpose );
00079 }
00080
00081 // Calculate new centers and clear agglomeration lists
00082 SphereCluster[] newCenters = new SphereCluster[centers.length];
00083 for ( int i = 0; i < k; i++ ) {
00084 newCenters[i] = calculateCenter( agglomeration.get( i ), dimensions );
00085 agglomeration.get( i ).clear();
00086 }
00087 centers = newCenters;
00088 }
00089
00090 come back new Clustering( centers );
00091 }
00092
00093 personal static double distance(double[] pointA, double [] pointB){
00094 double distance = zero.0;
00095 for (int i = 0; i < pointA.length; i++)
00099 come back science.sqrt(distance);
00100 }
00101
00102
00103 personal static SphereCluster calculateCenter( ArrayList<Cluster> cluster, int dimensions ) {
00104 double[] res = new double[dimensions];
00105 for ( int i = 0; i < res.length; i++ ) {
00106 res[i] = zero.0;
00107 }
00108
00109 if ( cluster.size() == zero ) {
00110 come back new SphereCluster( res, 0.0 );
00111 }
00112
00113 for ( Cluster purpose : cluster ) {
00114 double [] center = purpose.getCenter();
00115 for (int i = 0; i < res.length; i++)
00118 }
00119
00120 // Normalize
00121 for ( int i = 0; i < res.length; i++ )
00124
00125 // Calculate radius
00126 double radius = zero.0;
00127 for ( Cluster purpose : cluster )
00132 }
00133
00134 come back new SphereCluster( res, radius );
00135 }
00136
00137 public static agglomeration gaussianMeans(Clustering gtClustering, agglomeration clustering) {
00138 ArrayList<CFCluster> microclusters = new ArrayList<CFCluster>();
00139 for (int i = 0; i < agglomeration.size(); i++)
00143 else
00153
00154 int k = centers.length;
00155 if ( microclusters.size() < k ) {
00156 come back new Clustering( new Cluster[0]);
00157 }
00158
00159 agglomeration kMeansResult = kMeans( centers, microclusters );
00160
00161 k = kMeansResult.size();
00162 CFCluster[] res = new CFCluster[ k ];
00163
00164 for ( CFCluster microcluster : microclusters) realize nearest kMeans cluster
00166 double minDistance = Double.MAX_VALUE;
00167 int closestCluster = 0;
00168 for ( int i = 0; i < k; i++ )
00174 }
00175
00176 // augment cluster
00177 if ( res[closestCluster] == null ) else
00182 }
00183
00184 // finish off res
00185 int count = 0;
00186 for ( int i = 0; i < res.length; i++ )
00190
00191 CFCluster[] clean = new CFCluster[count];
00192 count = 0;
00193 for ( int i = 0; i < res.length; i++ )
00197
00198 come back new Clustering( clean );
00199 }
00200
00201 }