Given, a = 3, r = 1/2, n = 10
%r is common ratio
%n is number of terms
%a is the first term of the series
Sum = 0;
a = 3;
r = 1/2;
for i = 0 : 1 : 10;
Sum = Sum + a * r ^ i;
end
Sum
A.
-HomeTaey
(ask anytime)
if I get it wrong, sorry
Answer:
import random
def calc_birthday_probability(num_people):
num_tries = 1e6
num_duplicates = 0
tries = 0
while tries < num_tries:
total_birthday = {}
for i in range(1, 366):
total_birthday[i] = 0
for count in range(num_people):
birthday = random.randint(1, 365)
if total_birthday[birthday] != 0:
num_duplicates += 1
break
total_birthday[birthday] += 1
tries += 1
return num_duplicates/num_tries
def main():
num_people = 10
p = calc_birthday_probability (num_people)
print(p)
num_people = 20
p = calc_birthday_probability (num_people)
print(p)
return
if __name__ == "__main__":
random.seed(2020)
main()
Explanation:
-
Run the loop until the value of tries is less than num_tries to do number of trials.
- Run the loop to create the desired number of birthdays by generating random numbers.
- Increase the num_duplicates variable by 1, if the birthday has already occurred.
- Lastly define and then call the main function.
Answer: B. ISO 38500
Explanation:
ISO 38500 is an international Standard specifically developed by the International Organization for Standardization to oversee corporate governance of Information Technology. It lays down principles to guide directors and leaders of organizations on how to comply with regulatory requirements in the use of Information Technology within the firm.
The framework consists of six guiding principles in the use of I.T and they include; establishing responsibilities, planning or strategizing on how best to support the organization, acquisition of validity, ensuring performance, conformity with rules and respect of the human factor or behavior.
It was derived from the Australian Standard for Corporate Governance of Information and Communication Technology - AS 8015 - 200.