Beginners Guide to Code Algorithms
Beginners Guide to Code Algorithms
Beginners Guide to Code Algorithms
Experiments to Enhance Productivity and Solve Problems
by Deepankar Maitra
First edition published 2022
by CRC Press
6000 Broken Sound Parkway NW, Suite 300, Boca Raton, FL 33487-2742
and by CRC Press
2 Park Square, Milton Park, Abingdon, Oxon, OX14 4RN
CRC Press is an imprint of Taylor & Francis Group, LLC
2022 Deepankar Maitra
Reasonable efforts have been made to publish reliable data and information, but the author and publisher cannot assume responsibility for the validity of all materials or the consequences of their use. The authors and publishers have attempted to trace the copyright holders of all material reproduced in this publication and apologize to copyright holders if permission to publish in this form has not been obtained. If any copyright material has not been acknowledged please write and let us know so we may rectify in any future reprint.
Except as permitted under U.S. Copyright Law, no part of this book may be reprinted, reproduced, transmitted, or utilized in any form by any electronic, mechanical, or other means, now known or hereafter invented, including photocopying, microfilming, and recording, or in any information storage or retrieval system, without written permission from the publishers.
For permission to photocopy or use material electronically from this work, access www.copyright.com or contact the Copyright Clearance Center, Inc. (CCC), 222 Rosewood Drive, Danvers, MA 01923, 978-750-8400. For works that are not available on CCC please contact mpkbookspermissions@tandf.co.uk
Trademark notice: Product or corporate names may be trademarks or registered trademarks and are used only for identification and explanation without intent to infringe.
Library of Congress CataloginginPublication Data
Names: Maitra, Deepankar, author.
Title: Beginners guide to code algorithms : experiments to enhance productivity and solve problems / Deepankar Maitra.
Description: First edition. | Boca Raton : CRC Press, [2022] |
Includes bibliographical references and index. |
Summary: This book takes you on a problem-solving journey to expand your mind and increase your willingness to experiment with code Provided by publisher.
Identifiers: LCCN 2021044911 (print) | LCCN 2021044912 (ebook) |
ISBN 9781032080642 (hbk) | ISBN 9781032102382 (pbk) | ISBN 9781003214335 (ebk)
Subjects: LCSH: Computer algorithmsAmateurs manuals. | Application softwareDevelopmentAmateurs manuals. | Computer programmingAmateurs manuals.
Classification: LCC QA76.9.A43 M34 2022 (print) | LCC QA76.9.A43 (ebook) | DDC 005.1dc23
LC record available at https://lccn.loc.gov/2021044911
LC ebook record available at https://lccn.loc.gov/2021044912
ISBN: 978-1-032-08064-2 (hbk)
ISBN: 978-1-032-10238-2 (pbk)
ISBN: 978-1-003-21433-5 (ebk)
DOI: 10.1201/9781003214335
Typeset in Times
by Newgen Publishing UK
Additional eResources for this book are available for download at: https://www.routledge.com/Beginners-Guide-to-Code-Algorithms-Experiments-to-Enhance- Productivity/Maitra/p/book/9781032102382
For my parents
Mr. Priyanath and Mrs. Geeta Maitra
Dr. Amiya Prosad and Mrs. Durga Majumdar
Contents
Preface
People talk about AI, VR, AR, etc. these days. Each term has a deep scientific meaning and sociopolitical connotation for the user of these words and the people they are directed to. It is simply amazing to see how loosely these terms are used and interpreted today. For example, the A in the AI stands for artificial. While people generally understand that AI is artificial intelligence, I have come across a variety of ways that people perceive artificial. Is it the capability of a machine to figure out a problem? Or is it an ability for a device to do a task? The fact is neitherAI is a computer science term intended to mean the ability of machines to develop intelligence much the same way as humansthe capability to learn.
In this book, I want to introduce a new conceptaugmented common sense (ACS). This is in effect the opposite of AI in some senseit is the ability of humans to develop common sense with the help of machines! Simple concept. Powerful implications for your specific universeI deliberately chose the word universe because I did not want to limit the vast number of situations the average human goes through. Work. Leisure. Entertainment. Exercise. Nurture. Innovate. Contribute. These are all situations that require humans to apply their common sense.
The materials presented here will help you to strengthen your logic and develop your ability to write simple programs to automate your tasks. While there are innumerable ways that a human endeavor can be improved, I will be discussing how this can be achieved through the use of spreadsheets. You will need:
- A computer
- Microsoft Office (any version)
- Your basic skill in working with a spreadsheet
- Your desire to learn programming
The last one is scary for some and easy for others. This book is intended for those who want to be inspired to develop their ACS through programming and discover the beauty of logicthe happiness of solving a riddle.
After reading this book, I hope to have elevated your appreciation of programming. But that is just a side effect. My main objective is to entertain. To help you see the beauty of common sense and to appreciate how simple computing can make mundane tasks interesting.
I am going to begin with a discussion on algorithms and quickly transition into some real-life examples that are both entertaining and useful. Starting with a program on how to play Tic Tac Toe with the computer, I am going to describe a few other interesting problems hoping to inspire you to try your own. The last chapter is a more complex discussion on writing a program to draw a COVID graph of USAdeveloped from the common question that we found ourselves hurled into in 2020, during the tough pandemic days.
Albert Einstein had two famous quotes.
Two things are infinite: the universe and human stupidity; and Im not sure about the universe.
Albert Einstein
I am enough of an artist to draw freely upon my imagination. Imagination is more important than knowledge. Knowledge is limited. Imagination encircles the world.
Albert Einstein
This book is to help you discover the world of smart applications through the power of your limitless imagination.
Let the fun begin!
Acknowledgments
I am grateful to Dr. Anil Bhowmick for his continued encouragement and support.
I thank Dr. Ananda Datta, Venki Krishnamoorthy, and Satish Badgi for their constructive comments and suggestions.
I want to recognize my daughtersAparajita for the illustration in and Amrapali for reviewing the initial chapters.
I appreciate my son-in-law Lahiru for the infinite snacks and granddaughter Anika for her inspiring smiles.
For editing my manuscript and keeping my dream aliveI thank my wife Saswati.
Author Biography
Deepankar Maitra is a leader in business software solution architecture, focused on Human Capital Management. For the past 30 years, he has managed the implementation of enterprise applications in multinational corporations, providing digital solutions to a userbase of over 2,000,000.