# discrete structures tutorial

Think integers, graphs, and logical statements—things we use a lot in programming. Use the appropriate SET symbol to make the statement is TRUE. Program 20 : Given a full m-ary tree with i internal vertices, write a program to find the number of leaf nodes. Use the observed values to plot a graph to analyse the complexity of algorithm. Program 15 : Write a Program to store a function (polynomial/exponential), and then evaluate the polynomial, (For example store f (x) = 4n3 + 2n + 9 in an array and for a given value of n, say n = 5, evaluate (i.e. (For example, if the given set is {1,2}, the permutations are 12 and 21). Program 3 : Create a class RELATION, use Matrix notation to represent a relation. ; Overhead slides for the book. View Tutorial - SET (1).pdf from ECONS 101 at Tenaga National University, Kajang. a) Subset: Check whether one set is a subset of other or not. Discrete mathematics is the study of mathematical structures that are unique (aka discrete). a) Equivalent, or Program 12 : For any number n, write a program to list all the solutions of the equation x1+ x2 + x3 + …+ xn = C, where C is a constant (C<=10) and x1,x2, x3, … ,xn are nonnegative integers using brute force strategy. Preface Discrete mathematics deals with objects that come in discrete bundles, e.g., 1 or 2 babies. Discrete Structures TUTORIAL: SET 1) Given set A = {1, 2, 4, a, b, c}. Course Hero is not sponsored or endorsed by any college or university. Write a program to use this class. a) ismember (a, A): check whether an element belongs to set or not and return value as true/false. Program 2 : Create a class SET and take two sets as input from user to perform following SET Operations: CS381 Discrete Structures/Discrete Mathematics Web Course Material Last update August 2, 2009 Note: Reasonable efforts have been made to test interactive exercises and tools that have been developed here. e) Cartesian Product of Sets. Program 1 : Write a program to create a SET A and determine the cardinality of SET for an input array of elements (repetition allowed) and perform the following operations on the SET: This preview shows page 1 - 3 out of 3 pages. Validate the following expression either is True or False. and E = {1, a, 2, b, c, d}. Consider a set A = {1, 2, 5, 8, 11}. ; An errata sheet. Get step-by-step explanations, verified by experts. Program 1 : Write a program to create a SET A and determine the cardinality of SET for an input array of elements (repetition allowed) and perform the following operations on the SET: Program 16 : Write a Program to represent Graphs using the Adjacency Matrices and check if it is a complete graph. NPTEL provides E-learning through online Web and Video courses various streams. Find the number of comparisons during each pass and display the intermediate result. Program 19 : Given an adjacency matrix of a graph, write a program to check whether a given set of vertices {v1, v2, v3 … , vk} forms an Euler path / Euler Circuit (for circuit assume vk = v1). (One method is given in Liu). Reasoning and problem-solving capabilities are improved by discrete mathematics. Tutorial - SET (1).pdf - Discrete Structures TUTORIAL SET 1 Given set A ={1 2 4 a b c Validate the following expression either is True or False a 2 \u2208. b) Union and Intersection of two Sets. discrete-structures. compute the value of f(5)). A Course in Discrete Structures Rafael Pass Wei-Lung Dustin Tseng. Dicrete Structures Programs List. Discrete mathematics is mostly applied in the field of mathematics and computer science. Given set A = {1, 2, 3, 4, 5}. Program 13 : Write a Program to accept the truth values of variables x and y, and print the truth table of the following logical operations: Program 14 : Write a program to accept an input n from the user and graphically represent the values of T (n) where n varies from 0 to n for the recurrence relations. b) powerset A): list all the elements of power set of A. Program 17 : Write a Program to accept a directed graph G and compute the in-degree and out-degree of each vertex. Given set A = {1, 2, 4, a, b, c}. Use the observed values to plot a graph to analyse the complexity of algorithm. Validate the following expression either is Program 11 : Write a Program to calculate Permutation and Combination for an input value n and r using recursive formula of nCr and nPr. For a limited time, find answers and explanations to over 1.2 million textbook exercises for FREE! c) Complement: Assume Universal Set as per the input elements from the user.