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