Skip to content

Instantly share code, notes, and snippets.

@angadsinghsandhu
Last active September 20, 2022 11:44
Show Gist options
  • Save angadsinghsandhu/10f6f2d3f23b4f8e614d6df24a1aabe7 to your computer and use it in GitHub Desktop.
Save angadsinghsandhu/10f6f2d3f23b4f8e614d6df24a1aabe7 to your computer and use it in GitHub Desktop.
# Full Code at : https://colab.research.google.com/gist/angadsinghsandhu/2b329be4e90e51eef457997d1a72ec81/esel3d_beta-demo-colab.ipynb
'''
Func : AndhaBT
A function that calculates the number of
instagram stories that one person studying
in 7th semester MIT might see over the course
of this year. This function takes into account
the number of people in your college as well as
the factions of people that would not post
something such as this
Input :
tot - total number of people from the instagram-placement social circle. range - [0, inf]
alpha - the percentage of people who post stories online. range - [0.0, 1.0]
groups - the total number of subgroups that may be present in the social circle. range - [1, (tot/2)]
Output :
tot_posts - total number of instagram stories (counting reshares) one would see online. RIP.
'''
def AndhaBT(tot, alpha, groups):
# number of people in 1 group
group = (tot*alpha)/groups
# numbers of posts shared and reshared by the members of a group
posts_reshares_per_person = 2 * group * (group -1)
# total number of shares/reshares
tot_posts = groups * posts_reshares_per_person
# returning value
return tot_posts
# storing in variable
stories = AndhaBT(6, 1, 2)
print("Wow I have seen '{}' number of #AndhaPaise #BTkhatam posts.".format(int(stories)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment