Posts

The Baton Pass Problem: A computational approach via Python

The Baton Pass Problem: A computational approach via Python   Problem: In a circular line of 100 people everyone has been attached to a unique number that starts from 1 and ends with 100. They are now standing side by side making a loop, i.e., now player no. 1 is between player no. 2 and player number 100. A baton must be given to a random player. The player who has the baton has the power to eliminate one player from the ring and pass the baton to the next active player. Active in the sense that the player is not eliminated. The elimination must be done in the following manner. In a group of five people suppose that no. 1 has the baton. No. 1 will eliminate No. 3 (the player second next to no. 1) and pass the baton to no. 2. Next no. 2 will eliminate no. 5 and pass the baton to no. 4. No. 4 then eliminate no. 2 and this gives our finalists 1 and 4. You can visualize it as: Trial 1 1 2 3 4 5 Trial 2 ...

A Poem: র দায়িত্ব-গুরুদায়িত্ব

Image
  কয়েকদিন আগে আমাদের বিশ্ববিদ্যালয়ের গণিত বিভাগে শিক্ষক দিবস উপলক্ষ্যে একটি অনুষ্ঠান হয়। ছাত্র-ছাত্রীদের অতুলনীয় শিল্পী সত্তার প্রদর্শন দেখে কেবল আমি নয় বিভাগের সবাই যথেষ্ট আশ্চর্য। এইদিন আমি একটি কবিতা লিখে নিয়ে আসি যা সময়ের অভাবে সেখানে তুলে ধরা হয়নি। আজি হতে শতবর্ষ পরে, কেউ যদি আমার লেখা কবিতাখানি পড়ে তবে ভাববো লেখা সার্থক হয়েছে। গুরুর দায়িত্ব-গুরুদায়িত্ব আজকে আমি লোকের কাছে হলাম বড় মানী, কারণ আমার গুরু ছিলেন ভীষণ রকম দানী। আমায় তুলে ধরতে গিয়ে নিজের পাকলো চুল, তবু প্রশ্নের উত্তর দিতে কভু করেননি ভুল। কিশোর থেকে যুবক কিংবা যুবক থেকে বৃদ্ধ, মানুষ থেকে মনীষ গড়তে তিনি হস্তসিদ্ধ। এই গুরু কোনো একজন নয়, নয়কো পুরুষ-স্ত্রী, এই গুরু এক দিব্যজ্যোতি, অপূর্ব তার শ্রী। সেই জ্যোতি কে তীব্র করতে কারা তৎপর জানো? যাদের কে তোমরা পার্থিব রূপে 'শিক্ষক' বলে মানো। নতশিরে আজ জানিয়ে প্রণাম গুরুদের চরণে, চলো আবারও পুনরায় ফিরি জ্ঞানের আহরণে। ফুরালে সময় তাদের একদা ছাড়তে হবে ভার, তবে সে জ্যোতিকে তীব্র করার দায়িত্ব হবে কার? কিছু কি বুঝেছো তোমাদের তবে কাজটা হলো কী? গুরুর স্থানে গুরু হয়ে বসবে, আবার কী। নিতে...

Python Project: Havel-Hakimi Algorithm

Image
 Hey guys, this project in on Havel-Hakimi theorem. I have written a simple program to check whether a given degree sequence is graphical or not. Here's the code: # First we take the length of the initial sequence n = int(input("Enter length of the sequence: ")) # Next we enter the elements of the sequence print("Enter the sequence d_n: ") d = [] for i in range(n): v = int(input()) d.append(v) # next we run a loop, which is basically the algorithm. while True: d.sort(reverse=True) m = d[0] if m==0 and d[len(d)-1] == 0: print("The sequence is graphical.") break elif m>len(d)-1: print("The sequence is not graphical") else: for x in d: if x<0: print("The sequence is not graphical.") break d.pop(0) for i in range(m): d[i] = d[i]-1 print(d)

Python Project: Finding Adjacency Matrix from a Graphic Sequence

Image
 Hey everyone. In this blog I would like to share a very small project in python. In this project we can calculate the adjacency matrix of a graphic sequence in a simple algorithm. The code is here: #Enter the sequence in the array gseq. It has to be a graphic sequence gseq = [4,4,2,2,2,1,1,0] n = len(gseq) #Next we define the number of rows and columns of the adjacency matrix. rows, cols = (n, n) arr = [[0 for i in range(cols)] for j in range(rows)] #starting algorithm for i in range(n): for j in range(n): if i==j: arr[i][j]=0 else: if gseq[i]>0 and gseq[j]>0: arr[i][j] = 1 arr[j][i] = 1 gseq[i] -= 1 gseq[j] -= 1 print(arr) ================================= I hope you will understand the program. If there is any error let me know in the comments.

আবেগ (Emotion), ভাবপ্রবণতা (Sentiment) এবং তাদের নিয়ন্ত্রণ

Image
Image by  Gordon Johnson  from  Pixabay Emotion অর্থাৎ আবেগ এবং Sentiment অর্থাৎ ভাবপ্রবণতা দুটি এমন শব্দ যা আমাদের জীবনের সাথে ওতোপ্রতো ভাবে জড়িত। আবেগী মন কে নিয়ন্ত্রণ করা সম্পর্কে অনেকের অনেক মতামত আছে, কিন্তু এই বিষয়ে আমার অভিজ্ঞতা অন্য রকম। আমি বরাবর একটু ভাবুক প্রকৃতির ছেলে। সামান্য কথায় অনেক উচ্চ চিন্তা ভাবনায় চলে যেতাম। কিন্তু এই বিশেষ ব্যবহার আমার কাছে আশীর্বাদ না অভিশাপ তা বুঝলাম যেদিন আমার এক বন্ধু কে ধীরে ধীরে পালটে যেতে দেখলাম। তার সাথে আমার পরিচয় স্কুল থেকেই, আমরা দুজনেই ঠিক করি আমরা গণিত নিয়ে পড়াশোনা করবো। সেই মতো আমরা কলেজের ফর্মও ফিলাপ করি। আমাদের মধ্যে বরাবরই চিন্তা আদান প্রদান হত। সে তার নানান চিন্তার কথা আমাকে বলতো আমিও তাকে আমার নানা আবিষ্কারের কথা শোনাতাম। কিভাবে এক ফর্মুলার মধ্যে অন্য ফর্মুলা বসিয়ে নতুন ফর্মুলা বানানো যায়, কি করে আমরা নানা গ্রাফের ছবি আঁকতে পারি এবং তাদের দ্বারা দ্বিঘাত সমীকরণের বীজ সম্পর্কে ধারণা করা যায় এইসব। কলেজে ভর্তি হওয়ার পর আমরা আলাদা স্যারের কাছে টিউশন পড়তাম। যার বাড়ি যে স্যারের কাছে ছিলো সে তার কাছেই পড়তো। আমি খেয়াল করতে থ...

My philosophy on research

I was always a big enthusiastic student of mathematics. I never thought that this enthusiasm will take me to the research level of this beautiful subject. I am happy and glad that I have made this far. But now there are several different problems starts to appear. Problems that relates human mind and mathematical research work. One day I was reading a note on Research Ethics and Philosophy and I found a remarkable section that helped me developing my own philosophy on research. As soon as the thought was developed I wrote it and I never expected that I will get a platform to share it with everyone. I do not know if my philosophy works or not for others but they still makes sense to me whenever I read them. I hope everyone will enjoy it.