@SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jScrollPane2 = new javax.swing.JScrollPane();
        jTextPane1 = new javax.swing.JTextPane();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTextPane3 = new javax.swing.JTextPane();
        jLabel1 = new javax.swing.JLabel();
        jPanel3 = new javax.swing.JPanel();
        btnLearning = new javax.swing.JButton();
        btnDisability = new javax.swing.JButton();
        btnMaths = new javax.swing.JButton();
        btnHome = new javax.swing.JButton();
        btnGoBack = new javax.swing.JButton();
        lblBackground = new javax.swing.JLabel();

        jScrollPane2.setViewportView(jTextPane1);

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setBounds(new java.awt.Rectangle(450, 200, 400, 500));
        setMinimumSize(new java.awt.Dimension(400, 500));
        setResizable(false);
        getContentPane().setLayout(null);

        jTextPane3.setEditable(false);
        jTextPane3.setText("\nNational College of Ireland\nBSc. (Hons) in Computing, Year 1 (BSHC1)\nBSc. (Hons) in Computing, Evening, Year 1 (BSHCE1)\nBSc. (Hons) in Business Information Systems, Year 1 (BSHBIS1)\nBSc. (Hons) in Business Information Systems, Evening, Year 1 (BSHBISE1)\nHigher Certificate in Computing Applications and Support, Year 1 (HCC1)\nHigher Certificate in Computing Applications and Support, Evening, Year 1 (HCCE1)\nSemester 1 Examinations – 2011/2012\nWednesday 11th January, 2012\n2.00pm – 3.30pm\n______________________________________________________________________\nIntroduction to Mathematics for Computing\nMr. Tom Nolan\nMr. Ciaran O’Leary\nDr Ronan Flatley\nDr Caroline Sheedy\nFull marks will be awarded to complete answers to FIVE questions.\nDuration of exam: 90 minutes\nAttachments: N/A\n\n\n1. Sets\na) Let A = {1, 2, 3, 4, 5}, B = {3, 5} and C = {2, 6}.\n(i) Write down the elements of A ∩ B.\n(ii) Write down the elements of A U C.\n(iii) Is B a subset of A? Give a reason for your answer.\n(iv) Is C a subset of A? Give a reason for your answer.\n(v) Compute | A U B U C |. [5 x 1 mark]\nb) Let A be the set of letters in the word MISSISSIPPI.\nLet B be the set of letters in the word MASSACHUSETTS.\nList the elements in:\n(i) A U B\n(ii) A ∩ B\n(iii) A – B\n(iv) B – A. [4 x 1 mark]\nc) Of 160 students of computing, 100 studied Java, 50 studied C++ and 30 studied both\nlanguages.\n(i) Draw a Venn diagram to represent the situation above. [2 marks]\n(ii) How many students studied Java but not C++? [3 marks]\n(iii) How many students studied neither language? [3 marks]\n(iv) How many studied only one language? [3 marks]\n2. Relations and functions\na) Let f(x) = x + 1 and g(x) = x2 – 1, where x is a real number.\n(i) Compute f(3) and g(4). [2 marks]\n(ii) Compute g(1) and g(-1). Is g(x) injective? Give a reason for your answer. [3 marks]\n(iii) What is the range of f(x)? Is f(x) surjective? Give a reason for your answer. [3 marks]\n(iv) Calculate the composite function g o f(x). [2 marks]\nb) Suppose L is the set of lecturers {Tom, Dick, Harriet}. Suppose M is a set of modules\n{Databases, Java, Mathematics, XML} and S is the set of semesters {1, 2}.\nWe have the relation “teaches”, R: L → M with\nR = {(Tom, Databases), (Dick, Java), (Dick, XML), (Harriet, Databases), (Harriet,Mathematics)}.\nWe also have the relation “is taught during”, T: M → S with\nT = {(Databases, 1), (Java, 1), (Java, 2), (Mathematics, 1), (XML, 2)}.\n(i) Draw a digraph of the relation R. [3 marks]\n(ii) Write down the elements of R-1. [2 marks]\n(iii) Draw a digraph of the composite relation S o R. [3 marks]\n(iv) Does Dick teach during semester 2 ? Give a reason for your answer. [2 marks]\n\n\n3. Logic\na)\n(i) Explain in one sentence what is meant by a tautology. [2 marks]\n(ii) Give an example of a logical expression that is a tautology. [3 marks]\nb) Construct the truth table for the following logical expressions:\n(i) p ^ q [3 marks]\n(ii) ~(~p v ~q) [3 marks]\nDecide whether or not the in expressions in (i) and (ii) are logically equivalent,\ngiving reasons for your answer. [2 marks]\nc) Consider the following logical propositions:\nP: x is an integer greater than 8.\nQ: x is an integer greater than 3.\n(i) Show that P => Q has value TRUE. [3 marks]\n(ii) What is the converse of P => Q ? Decide if the converse is TRUE, showing your\nworkings. [2 marks]\n(iii) What is the contrapositive of P => Q ? Decide if the contrapositive is TRUE,\nshowing your workings. [2 marks]\n4. Calculus\na) A bus leaves a bus stop and accelerates linearly for 30 seconds up to a speed of 10m/s. It then\ncruises at 10 m/s for one minute. Finally, it decelerates linearly for 10 seconds and comes to a\nhalt at the next bus stop. Calculate the acceleration of the bus during:\n(i) the first 30 seconds\n(ii) the final 10 seconds. [2 x 4 marks]\nb) Calculate dy/dx for the following functions:\n(i) y = f(x) = (x3 – 2x)(2x2 + 9)\n(ii) y = (x3 + 2)4 . [2 x 3 marks]\nc) Find the slope of the equation of a tangent to the curve y = 3x2 – 12x + 6 at the point (4, 2).\nAlso, find the turning point and state if it is a maximum or a minimum.\n[6 marks]\n\n\n5. Probability and statistics\na) Give one example of qualitative data and one example of quantitative data. [2 marks]\nb) For the data set\n2, 2, 2, 3, 3, 4, 5, 6, 6, 9, 9, 9\ncalculate the following statistics:\n(i) mean\n(ii) mode\n(iii) median\n(iv) standard deviation. [4 x 2 marks]\nc) The country Ruralia has ten regions. The population density has the following distribution:\nDensity (per km2) Frequency\n0 – 20 4\n20 – 50 2\n50 – 100 3\n100 – 200 1\ni.e., four regions have a density of 0–20 people per square km,\ntwo regions have density of 20–50 people per square km, etc.\nCalculate:\n(i) the mean population density [4 marks]\n(ii) the variance of the distribution [4 marks]\n(iii) the standard deviation of the distribution. [2 marks]\n6. Counting\na) In how many ways can the letters of the following words be arranged?\n(i) ANSI (ii) HTTP (iii) BANANA [3 x 2 marks]\nb) Given 5 black skittles and 6 red, in how many ways can the 11 skittles\nbe placed in a line if:\n(i) any colour skittle may be next to any other?\n(ii) two skittles of the same colour may not be next to each other?\n(iii) all 6 red skittles must be next to each other? [3 x 2 marks]\nc) From a class of 4 women and 6 men, how many possible project teams can be made\nif each team requires:\n(i) 5 people [2 marks]\n(ii) 5 people, at least 1 of whom must be a woman [3 marks]\n(iii) 5 people, at least 2 of whom must be men. [3 marks]\n");
        jTextPane3.setCaretPosition(0);
        jScrollPane1.setViewportView(jTextPane3);

        jScrollPane1.setBounds(20, 90, 360, 320);
        jLayeredPane1.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", 0, 36)); // NOI18N
        jLabel1.setForeground(new java.awt.Color(255, 255, 255));
        jLabel1.setText("Exam Paper");
        jLabel1.setBounds(160, 20, 210, 50);
        jLayeredPane1.add(jLabel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jPanel3.setOpaque(false);

        btnLearning.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnLearning.setForeground(new java.awt.Color(102, 153, 255));
        btnLearning.setText("Learning");
        btnLearning.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnLearningActionPerformed(evt);
            }
        });

        btnDisability.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnDisability.setForeground(new java.awt.Color(102, 153, 255));
        btnDisability.setText("Disablity");
        btnDisability.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDisabilityActionPerformed(evt);
            }
        });

        btnMaths.setFont(new java.awt.Font("Tahoma", 0, 10)); // NOI18N
        btnMaths.setForeground(new java.awt.Color(102, 153, 255));
        btnMaths.setText("Maths");
        btnMaths.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnMathsActionPerformed(evt);
            }
        });

        btnHome.setIcon(new javax.swing.ImageIcon(getClass().getResource("/studentservices/home.png"))); // NOI18N
        btnHome.setContentAreaFilled(false);
        btnHome.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnHomeActionPerformed(evt);
            }
        });

        btnGoBack.setIcon(new javax.swing.ImageIcon(getClass().getResource("/studentservices/backbutton.png"))); // NOI18N
        btnGoBack.setContentAreaFilled(false);
        btnGoBack.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnGoBackActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addComponent(btnHome, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnGoBack, javax.swing.GroupLayout.PREFERRED_SIZE, 56, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btnMaths, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnLearning, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDisability, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(btnGoBack, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
            .addComponent(btnDisability, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btnLearning, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(btnMaths, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE)
            .addComponent(btnHome, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );

        jPanel3.setBounds(10, 430, 370, 50);
        jLayeredPane1.add(jPanel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        lblBackground.setIcon(new javax.swing.ImageIcon(getClass().getResource("/studentservices/background.png"))); // NOI18N
        lblBackground.setBounds(0, 0, 400, 500);
        jLayeredPane1.add(lblBackground, javax.swing.JLayeredPane.DEFAULT_LAYER);

        getContentPane().add(jLayeredPane1);
        jLayeredPane1.setBounds(0, -1, 400, 500);

        pack();
    }// </editor-fold>//GEN-END:initComponents