Std XII Computer Science

Total Page:16

File Type:pdf, Size:1020Kb

Std XII Computer Science J.H. TARAPORE SCHOOL WORKSHEET NO- 5 STD XII :A/B/C COMPUTER SCIENCE (2020-2021) Topic : Java Practical Programs General Instructions: • Give the program name as “yournameQ1” eg : “SamikshaQ1,Samiksha Q2” • Execute the programs in your laptop. • Save the program and output together in a Microsoft Word File. • Submit the pendrive on the first day of the school reopening. Question 1. Write a program to check whether the given number is a Prime Adam Number or Not. Prime Number:A number which has only two factors,i.e 1 and the number itself. Adam Number : The square of a number and the square of its reverse are reverse to each other.Example,if n=31 and reverse of n=13,then 312=961 and 132= 169,which is reverse of 961.Thus ,31 is an Adam Number. So, 31 is a Prime Adam Number. Question 2. Write a program to check whether the given number is a Evil Number or Not. An Evil number is a positive whole number which has even number of 1’s in its binary equivalent. Example: Binary equivalent of 9 is 1001, which contains even number of 1’s. Thus, 9 is an Evil Number. A few Evil numbers are 3, 5, 6, 9.... Question 3. Write a program to check whether the given number is a Smith Number or Not. A Smith Number is a composite number,the sum of the digits of a number is equal to the sum of the digits of its prime factors (excluding 1). Example: 666 Prime factors of 666 : 2,3,3 and 37. (2+3+3+3+7)=18 666=6+6+6=18 Thus,666 is a Smith Number. Question 4. Write a program to check whether the given number is a Odious Number or Not. An Odious number is a positive whole number which has odd number of 1’s in its binary equivalent. Example: Binary equivalent of 8 is 1000, which contains odd number of 1’s. Thus, 8 is an Odious Number. A few Odious numbers are 1,2,4,7,8,... Question 5. Write a program to check whether the given number is a GoldBach Number or Not. A GoldBach number is a positive even integer that can be expressed as the sum of two odd primes.So,all even integers greater than 4 are GoldBach numbers. Example : Input: n = 10 Output: Prime Pairs are 5,5(5+5=10) 3,7(3+7=10) .
Recommended publications
  • Input for Carnival of Math: Number 115, October 2014
    Input for Carnival of Math: Number 115, October 2014 I visited Singapore in 1996 and the people were very kind to me. So I though this might be a little payback for their kindness. Good Luck. David Brooks The “Mathematical Association of America” (http://maanumberaday.blogspot.com/2009/11/115.html ) notes that: 115 = 5 x 23. 115 = 23 x (2 + 3). 115 has a unique representation as a sum of three squares: 3 2 + 5 2 + 9 2 = 115. 115 is the smallest three-digit integer, abc , such that ( abc )/( a*b*c) is prime : 115/5 = 23. STS-115 was a space shuttle mission to the International Space Station flown by the space shuttle Atlantis on Sept. 9, 2006. The “Online Encyclopedia of Integer Sequences” (http://www.oeis.org) notes that 115 is a tridecagonal (or 13-gonal) number. Also, 115 is the number of rooted trees with 8 vertices (or nodes). If you do a search for 115 on the OEIS website you will find out that there are 7,041 integer sequences that contain the number 115. The website “Positive Integers” (http://www.positiveintegers.org/115) notes that 115 is a palindromic and repdigit number when written in base 22 (5522). The website “Number Gossip” (http://www.numbergossip.com) notes that: 115 is the smallest three-digit integer, abc, such that (abc)/(a*b*c) is prime. It also notes that 115 is a composite, deficient, lucky, odd odious and square-free number. The website “Numbers Aplenty” (http://www.numbersaplenty.com/115) notes that: It has 4 divisors, whose sum is σ = 144.
    [Show full text]
  • Impartial Games
    Combinatorial Games MSRI Publications Volume 29, 1995 Impartial Games RICHARD K. GUY In memory of Jack Kenyon, 1935-08-26 to 1994-09-19 Abstract. We give examples and some general results about impartial games, those in which both players are allowed the same moves at any given time. 1. Introduction We continue our introduction to combinatorial games with a survey of im- partial games. Most of this material can also be found in WW [Berlekamp et al. 1982], particularly pp. 81{116, and in ONAG [Conway 1976], particu- larly pp. 112{130. An elementary introduction is given in [Guy 1989]; see also [Fraenkel 1996], pp. ??{?? in this volume. An impartial game is one in which the set of Left options is the same as the set of Right options. We've noticed in the preceding article the impartial games = 0=0; 0 0 = 1= and 0; 0; = 2: {|} ∗ { | } ∗ ∗ { ∗| ∗} ∗ that were born on days 0, 1, and 2, respectively, so it should come as no surprise that on day n the game n = 0; 1; 2;:::; (n 1) 0; 1; 2;:::; (n 1) ∗ {∗ ∗ ∗ ∗ − |∗ ∗ ∗ ∗ − } is born. In fact any game of the type a; b; c;::: a; b; c;::: {∗ ∗ ∗ |∗ ∗ ∗ } has value m,wherem =mex a;b;c;::: , the least nonnegative integer not in ∗ { } the set a;b;c;::: . To see this, notice that any option, a say, for which a>m, { } ∗ This is a slightly revised reprint of the article of the same name that appeared in Combi- natorial Games, Proceedings of Symposia in Applied Mathematics, Vol. 43, 1991. Permission for use courtesy of the American Mathematical Society.
    [Show full text]
  • Single Digits
    ...................................single digits ...................................single digits In Praise of Small Numbers MARC CHAMBERLAND Princeton University Press Princeton & Oxford Copyright c 2015 by Princeton University Press Published by Princeton University Press, 41 William Street, Princeton, New Jersey 08540 In the United Kingdom: Princeton University Press, 6 Oxford Street, Woodstock, Oxfordshire OX20 1TW press.princeton.edu All Rights Reserved The second epigraph by Paul McCartney on page 111 is taken from The Beatles and is reproduced with permission of Curtis Brown Group Ltd., London on behalf of The Beneficiaries of the Estate of Hunter Davies. Copyright c Hunter Davies 2009. The epigraph on page 170 is taken from Harry Potter and the Half Blood Prince:Copyrightc J.K. Rowling 2005 The epigraphs on page 205 are reprinted wiht the permission of the Free Press, a Division of Simon & Schuster, Inc., from Born on a Blue Day: Inside the Extraordinary Mind of an Austistic Savant by Daniel Tammet. Copyright c 2006 by Daniel Tammet. Originally published in Great Britain in 2006 by Hodder & Stoughton. All rights reserved. Library of Congress Cataloging-in-Publication Data Chamberland, Marc, 1964– Single digits : in praise of small numbers / Marc Chamberland. pages cm Includes bibliographical references and index. ISBN 978-0-691-16114-3 (hardcover : alk. paper) 1. Mathematical analysis. 2. Sequences (Mathematics) 3. Combinatorial analysis. 4. Mathematics–Miscellanea. I. Title. QA300.C4412 2015 510—dc23 2014047680 British Library
    [Show full text]
  • Eureka Issue 61
    Eureka 61 A Journal of The Archimedeans Cambridge University Mathematical Society Editors: Philipp Legner and Anja Komatar © The Archimedeans (see page 94 for details) Do not copy or reprint any parts without permission. October 2011 Editorial Eureka Reinvented… efore reading any part of this issue of Eureka, you will have noticed The Team two big changes we have made: Eureka is now published in full col- our, and printed on a larger paper size than usual. We felt that, with Philipp Legner Design and Bthe internet being an increasingly large resource for mathematical articles of Illustrations all kinds, it was necessary to offer something new and exciting to keep Eu- reka as successful as it has been in the past. We moved away from the classic Anja Komatar Submissions LATEX-look, which is so common in the scientific community, to a modern, more engaging, and more entertaining design, while being conscious not to Sean Moss lose any of the mathematical clarity and rigour. Corporate Ben Millwood To make full use of the new design possibilities, many of this issue’s articles Publicity are based around mathematical images: from fractal modelling in financial Lu Zou markets (page 14) to computer rendered pictures (page 38) and mathemati- Subscriptions cal origami (page 20). The Showroom (page 46) uncovers the fundamental role pictures have in mathematics, including patterns, graphs, functions and fractals. This issue includes a wide variety of mathematical articles, problems and puzzles, diagrams, movie and book reviews. Some are more entertaining, such as Bayesian Bets (page 10), some are more technical, such as Impossible Integrals (page 80), or more philosophical, such as How to teach Physics to Mathematicians (page 42).
    [Show full text]
  • Using Formal Concept Analysis in Mathematical Discovery
    Using Formal Concept Analysis in Mathematical Discovery Simon Colton and Daniel Wagner sgc, [email protected] Combined Reasoning Group Department of Computing Imperial College, London http://www.doc.ic.ac.uk/crg/ Abstract. Formal concept analysis (FCA) comprises a set of powerful algorithms which can be used for data analysis and manipulation, and a set of visualisation tools which enable the discovery of meaningful re- lationships between attributes of the data. We explore the potential of combining FCA and mathematical discovery tools in order to better fa- cilitate discovery tasks. In particular, we propose a novel lookup method for the Encyclopedia of Integer Sequences, and we show how conjectures from the Graffiti discovery program can be better understood using FCA visualisation tools. We argue that, not only can FCA tools greatly en- hance the management and visualisation of mathematical knowledge, but they can also be used to drive exploratory processes. 1 Introduction Formal Concept Analysis (FCA) consists of a set of well established techniques for the analysis and manipulation of data. FCA has a strong theoretical un- derpinning, efficient implementations of fast algorithms, and useful visualisation tools. There are strong links between FCA and machine learning, and the con- nection of both fields is an active area of research [8,12,13]. We concentrate here on the combination of FCA tools with systems developed to aid mathemat- ical discovery. In particular, we are interested in addressing (i) whether FCA algorithms can be used to enhance the discovery process and (ii) whether FCA visualisation tools can enable better understanding of the discoveries made.
    [Show full text]
  • Numbers 1 to 100
    Numbers 1 to 100 PDF generated using the open source mwlib toolkit. See http://code.pediapress.com/ for more information. PDF generated at: Tue, 30 Nov 2010 02:36:24 UTC Contents Articles −1 (number) 1 0 (number) 3 1 (number) 12 2 (number) 17 3 (number) 23 4 (number) 32 5 (number) 42 6 (number) 50 7 (number) 58 8 (number) 73 9 (number) 77 10 (number) 82 11 (number) 88 12 (number) 94 13 (number) 102 14 (number) 107 15 (number) 111 16 (number) 114 17 (number) 118 18 (number) 124 19 (number) 127 20 (number) 132 21 (number) 136 22 (number) 140 23 (number) 144 24 (number) 148 25 (number) 152 26 (number) 155 27 (number) 158 28 (number) 162 29 (number) 165 30 (number) 168 31 (number) 172 32 (number) 175 33 (number) 179 34 (number) 182 35 (number) 185 36 (number) 188 37 (number) 191 38 (number) 193 39 (number) 196 40 (number) 199 41 (number) 204 42 (number) 207 43 (number) 214 44 (number) 217 45 (number) 220 46 (number) 222 47 (number) 225 48 (number) 229 49 (number) 232 50 (number) 235 51 (number) 238 52 (number) 241 53 (number) 243 54 (number) 246 55 (number) 248 56 (number) 251 57 (number) 255 58 (number) 258 59 (number) 260 60 (number) 263 61 (number) 267 62 (number) 270 63 (number) 272 64 (number) 274 66 (number) 277 67 (number) 280 68 (number) 282 69 (number) 284 70 (number) 286 71 (number) 289 72 (number) 292 73 (number) 296 74 (number) 298 75 (number) 301 77 (number) 302 78 (number) 305 79 (number) 307 80 (number) 309 81 (number) 311 82 (number) 313 83 (number) 315 84 (number) 318 85 (number) 320 86 (number) 323 87 (number) 326 88 (number)
    [Show full text]
  • Discriminators of Integer Sequences
    Discriminators of Integer Sequences by Sajed Haque A thesis presented to the University of Waterloo in fulfillment of the thesis requirement for the degree of Master of Mathematics in Computer Science Waterloo, Ontario, Canada, 2017 c Sajed Haque 2017 I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. I understand that my thesis may be made electronically available to the public. ii Abstract The discriminator of an integer sequence s = (s(n))n≥0, first introduced by Arnold, Benkoski and McCabe in 1985, is the function Ds(n) that maps the integer n ≥ 1 to the smallest positive integer m such that the first n terms of s are pairwise incongruent modulo m. In this thesis, we provide a basic overview of discriminators, examining the background literature on the topic and presenting some general properties of discriminators. We also venture into various computational aspects relating to discriminators, such as providing algorithms to compute the discriminator, and establishing an upper bound on the discriminator growth rate. We provide a complete characterization of sequences whose discriminators are themselves, and also explore the problem of determining whether a given sequence is a discriminator of some other sequence with some partial results and algorithms. We briefly discuss some k-regular sequences, characterizing the discriminators for the evil and odious numbers, and show that k-regular sequences do not necessarily have k- regular discriminators. We introduce the concept of shift-invariant discriminators, i.e.
    [Show full text]
  • Dynamical Generalizations of the Prime Number Theorem And
    Dynamical generalizations of the Prime Number Theorem and disjointness of additive and multiplicative semigroup actions Vitaly Bergelson Florian K. Richter February 11, 2020 Abstract We establish two ergodic theorems which have among their corollaries numerous classical results from multiplicative number theory, including the Prime Number Theo- rem, a theorem of Pillai-Selberg, a theorem of Erd˝os-Delange, the mean value theorem of Wirsing, and special cases of the mean value theorem of Hal´asz. By building on the ideas behind our ergodic results, we recast Sarnak’s M¨obius disjointness conjec- ture in a new dynamical framework. This naturally leads to an extension of Sarnak’s conjecture which focuses on the disjointness of additive and multiplicative semigroup actions. We substantiate this extension by providing proofs of several special cases thereof. Contents 1 Introduction 1 1.1 Dynamical generalizations of the Prime Number Theorem ................ 2 1.2 A wider framework for Sarnak’s conjecture ........................ 9 2 Distribution of orbits along Ω(n) 16 2.1 Proof of Theorem A .................................... 16 2.2 Proofs of Proposition 2.1 and Lemmas 2.2 and 2.3 .................... 19 3 Finitely generated and strongly uniquley ergodic systems 23 3.1 A counterexample ..................................... 23 3.2 Proof of Theorem B .................................... 23 3.3 Proof of Proposition 3.2 .................................. 25 4 Applications of Theorems A and B 32 5 Disjointness of additive and multiplicative semigroup actions 36 arXiv:2002.03498v1 [math.DS] 10 Feb 2020 5.1 Nilsystems, nilsequences, and a proof of Theorem C ................... 36 5.2 Horocyclic flow and a proof of Theorem D .......................
    [Show full text]
  • GEMATRIA: a Preliminary Investigation of the Cabala
    Update: February 13th, 2005 GEMATRIA A Preliminary Investigation of The Cabala contained in the Coptic Gnostic Books and of a similar Gematria in the Greek text of the New Testament SHOWING THE PRESENCE OF A SYSTEM OF TEACHING BY MEANS OF THE DOCTRINAL SIGNIFICANCE OF NUMBERS, BY WHICH THE HOLY NAMES ARE CLEARLY SEEN TO REPRESENT AEONIAL RELATIONSHIPS WHICH CAN BE CONCEIVED IN A GEOMETRIC SENSE AND ARE CAPABLE OF A TYPICAL EXPRESSION OF THAT ORDER. BY FREDERICK BLIGH BOND, F.R.I.B.A. AND THOMAS SIMCOX LEA, D.D. First Published 1917 Annotated and Transcribed for the WorldWideWeb by Peter Wakefield Sault 2002-2003 1 EPIGRAPH. ‘... numbers are the thoughts of God ... The Divine Wisdom is reflected in the numbers impressed upon all things ... the construction of the physical and moral world alike is based upon eternal numbers.’ St Augustine 2 CONTENTS Preface The Method of Gematria Chapter I A Brief Outline of the Gematria II The Existence of the Gnosis III The Uses of Gematria IV The Key Applied Note on Digamma Appendix A The Number 485 B Of the Square and Circle Contained C Names of Christ as Multiples of 37 D Schema of the Numbers of Jesus E The Decree of the First Mystery F Of the Three Primary Figures G Cabala of the Cosmos H The Cube of Light Supplement I On the Symbolism of Numbers II On Geometric Truth The Geometric Cubit as a Basis of Proportion in the Plans of Mediaeval Buildings IIIby Frederick Bligh Bond F.R.I.B.A. (From The Builder, Third Series, Vol.
    [Show full text]
  • Hockey Line Nicknames Based on Jersey Numbers
    The Mathematics Enthusiast Volume 14 Number 1 Numbers 1, 2, & 3 Article 21 1-2017 Numberlines: Hockey Line Nicknames Based on Jersey Numbers Egan J. Chernoff Follow this and additional works at: https://scholarworks.umt.edu/tme Part of the Mathematics Commons Let us know how access to this document benefits ou.y Recommended Citation Chernoff, Egan J. (2017) "Numberlines: Hockey Line Nicknames Based on Jersey Numbers," The Mathematics Enthusiast: Vol. 14 : No. 1 , Article 21. Available at: https://scholarworks.umt.edu/tme/vol14/iss1/21 This Article is brought to you for free and open access by ScholarWorks at University of Montana. It has been accepted for inclusion in The Mathematics Enthusiast by an authorized editor of ScholarWorks at University of Montana. For more information, please contact [email protected]. TME, vol. 14, nos1,2&.3, p. 371 Numberlines: Hockey Line Nicknames Based on Jersey Numbers Egan J Chernoff1 University of Saskatchewan, Canada Abstract: The purpose of this article, in general, is to expound Chernoff’s (2016) notion of numberlines, that is, hockey line nicknames based on jersey numbers. The article begins with a brief discussion of the history of hockey line nicknames, which allows for the parsing of numberlines and quasi-numberlines (nicknames based on numbers associated with hockey players). Focusing, next, on jersey number restrictions for the National Hockey League (NHL), a repeated calculation of the number of possible numberlines winnows down the number from a theoretical upper bound to a practical upper bound. Moving beyond the numbers, the names of natural numbers – those with a certain panache (e.g., Untouchable, McNugget, Frugal, Hoax, Narcissistic, Unhappy, Superperfect and Powerul numbers) – act as a gateway to the notion of numberlining, the process of attempting to coin a numberline.
    [Show full text]
  • A Note on Browkin's and Cao's Cancellation Algorithm Uwagi O
    TECHNICAL TRANSACTIONS 7/2018 MATHEMATICS DOI: 10.4467/2353737XCT.18.106.8801 SUBMISSION OF THE FINAL VERSION: 24/04/2018 Andrzej Tomski ([email protected]) Institute of Mathematics, Faculty of Mathematics, Physics and Chemistry, University of Silesia Maciej Zakarczemny ([email protected]) Institute of Mathematics, Faculty of Physics, Mathematics and Computer Science, Cracow University of Technology A note on Browkin’s and Cao’s cancellation algorithm Uwagi o algorytmie sitowym Browkina i Cao Abstract In this paper, we follow our generalisation of the cancellation algorithm described in our previous paper [A. Tomski, M. Zakarczemny, On some cancellation algorithms, NNTDM. 23, 2017, p. 101–114]. For f being a natural-valued function defined on s , s ≥1 we remove the divisors of all possible values of f in the points in which the sum of coordinates is less than or equal to n. The least non-cancelled number is called the discriminator Df(n). We find formulas, or at least an estimation for this discriminator, in the case of a broad class of sequences. Keywords: discriminator, sequence, congruence, odious numbers, Thue-Morse sequence Streszczenie Kontynuujemy badania nad generalizacją algorytmu sitowego Browkina i Cao, [A. Tomski, M. Zakarczemny, On some cancellation algorithms, NNTDM. 23, 2017, p. 101–114]. Niech f będzie funkcją o wartościach w zbiorze liczb naturalnych, określoną na s , s ≥1. Usuwamy dzielniki wszystkich możliwych wartości funkcji f, w punktach, w których suma współrzędnych nie przekracza n. Najmniejszą niewykreśloną liczbę naturalną nazywamy dyskryminatorem Df(n). W artykule uogólniamy pojęcie dyskryminatora. Znajdujemy jawne wzory lub oszacowania na dyskryminator dla szerokiej klasy ciągów.
    [Show full text]
  • Varieties of Irish History
    LIBRARY OF THE UNIVERSITY OF ILLINQS AT URBANA-CHAMPAICN 941.5 G21v The person charging this material is re- sponsible for its return to the library from which it was withdrawn on or before the Latest Date stamped below. Theft, mutilation, and underlining of books are reasons for disciplinary action and may result in dismissal from the University. To renew call Telephone Center, 333-8400 UNIVERSITY OF ILLINOIS LIBRARY AT URBANA-CHAMPAIGN 1? OCT 3 1 ik L161—O-1096 — 8, Grafton-street, Do Buy. Nov., ]809. I PRICE LIST OF W. B. KELLY'S PUBLICATIONS. KUHNER'S Elementary Greek Grammar and Exer- cises, translated, with Greek-English and English-Greek Lexicon. By C. W. Bateman, LL.B., Scholar, Trinity College. 12mo, bound, C63 pages. 63. 6d. LIVES OF THE ENGLISH SAINTS; projected and partly edited by the Very Rev. John Henry Newman, and others, of the Oxford School, original editions, published by ' Mr. Toovey, of London, viz. : ST. AUGUSTINE OF CANTERBURY, Apostle of the English, and his Companions, St. Mellitus, St. Lawrence, St. Peter, St. Justus, and St. llonorius ; together with some ac- count of the early British Church. 2 vols, in ouo, cloth, elegant, 38. Cd. T. GERMAN, Bishop of Auxerre in Burgundy. s 2 vols, in one, cloth, elegant, 3s. 6d. STEPHEN LANGTON, Arcl'bishop of Canterbury. 12mo, "cloth, elegant, 2s. 6d. 1" ECTURES on some subjects of Modern History and _i Biography ; History of S]>ain, in the Eighteenth Century. ;»(!ligious and Political Institutions of Spain. Reply to Mr. iucklc's Civilisation in Spain. Life, Writings, and Times of Chateaubriand.
    [Show full text]