<jupyter_start><jupyter_text>【Problem.1] The Number of grains of rice on the 100th day.<jupyter_code>import numpy as np
arr =[1]
total_num_days = 100
for i in range(1,total_num_days):
    arr.append((arr[i-1])*2)
arr=np.array(arr)
num_grains=np.sum(arr)
print("Total number of rice grains = {}".format(num_grains))
#Drawing a line graph to represent the change in the number of rice grains you received
import matplotlib.pyplot as plt

num_days = 101
days = range(1, num_days)

sum_arr=[]
for i in range(100):
    sum_arr.append(np.sum(arr[:i+1]))

plt.plot(days, arr, 'g-o', linewidth=5, markersize=10, markeredgewidth=5, markeredgecolor='orange')
plt.plot(days, sum_arr, 'b^', linewidth=5, markersize=10);
plt.title('Number of Rice grains')
plt.xlabel('Days'); 
plt.ylabel('Number of Rice grains');
plt.legend(['Number of rice grains you receive on that day', 'The total number of rice grains you receive by that day'])
plt.show()<jupyter_output><empty_output><jupyter_text>【Problem.2] The Number of rice grains outside of the 100th day.<jupyter_code>def compute_sorori_shinzaemon(day=100):
    list_n_grains=arr[:day]
    list_total_grains=sum_arr[:day]
    print("Total number of rice gains after {} days is : {} ".format(day,np.sum(list_n_grains)))
  
    days = range(1, day+1)    
    plt.plot(days, list_n_grains, 'g-o', linewidth=5, markersize=10, markeredgewidth=5, markeredgecolor='orange')
    plt.plot(days, list_total_grains, 'r--o', linewidth=5, markersize=10,);
    plt.title('Number of Rice grains')
    plt.xlabel('Days'); 
    plt.ylabel('Number of Rice rice grains');
    plt.legend(['Number of rice you receive on that day', 'The total number of rice you receive by that day'])
    return list_n_grains,list_total_grains
list_n_grains,list_total_grains=compute_sorori_shinzaemon(day=40)
plt.show()<jupyter_output>Total number of rice gains after 40 days is : 1099511627775<jupyter_text>```` This is formatted as code```` 【Problem.3] The calculation of how many people can live for how many days with the rice we get.<jupyter_code>#Let's take 250 the number of grains of rice required per one people to live one day
def number_of_days_to_live(number_of_grains,number_of_people):
    
    #by calculating the number of days to live for one people for the given number of grains
    days_to_live_per_one_people = number_of_grains/250
    
    #hence calculate the number of days to live for the given number of people
    num_days_to_live = days_to_live_per_one_people/number_of_people


#Research source = Wikipedia 
#Organisation = WHO 
#It takes 400grams which is approxmitaly 19200grains of rice to feed an adult human a day.

    return num_days_to_live
n=number_of_days_to_live(19200,5)
print("Number of days to live = {} days".format(n//1))<jupyter_output>Number of days to live = 15.0 days
{'fraction_non_alphanumeric': 0.10657193605683836, 'fraction_numerical': 0.02984014209591474, 'mean_word_length': 5.257777777777778, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '287263', 'license': 'Apache-2.0', 'n_tokens_mistral': 1051, 'n_tokens_neox': 961, 'n_words': 294, 'path': 'Week1_assignment_1_Sorori_Shinzaemon_problem_.ipynb', 'repo_name': 'ibrahimsesay/griddb', 'size': '2815'}