The post Server On Space appeared first on BYTE-MAN.

]]>With enhanced use of cyberspace and an increase in the pace of digitalization, the number of cybercrimes is also increasing at an exponential rate in India and around the globe. Also, in today’s world, it is not necessary that the terrorist attackers will come only through air, land or water, but also through the internet.

Providing the best quality equipments and training for security personnels is a must. For technical & security upgrade, both, Rashtriya Raksha University (specialization in national security and police training) and National Forensic Sciences University (specialization in cyber security and forensic) in each state are the need of the hour. Recently, last month, RRU handed over innovative rooster drones developed in partnership with a Hyderabad-based company to the Indian Army. RRU at present has five campuses & NFSU has ten campuses, including one international campus in Africa. RRU & NFSU are the institutions of National Importance of India. Both central & all state governments should work in tandem in the direction of creating both institutes per state.

The post Need for More RRU, NFSU appeared first on BYTE-MAN.

]]>On November 12, 2023, 41 construction workers were trapped inside the tunnel, near Silkyara in Uttarakhand. After huge and collective efforts by NDRF, NDMA, military, government, international tunnelling experts and all rescue teams to save all 41 trapped workers in the Silkyara tunnel, Uttarkashi had finally succeeded on November 28, 2023, after 17 days. Special kudos go to rat-hole miners for doing this mammoth dangerous task manually.

“Even when machines fail, men’s efforts prevail.”

In this technology era, we are becoming more & more machine-dependent. But, we shouldn’t forget they can be failure too sometimes. Machines are being upgraded every day, and so we also have to ourselves. A college degree is a good thing but knowledge and technical skills are the most important.

The post Uttarakashi Tunnel Rescue appeared first on BYTE-MAN.

]]>As well as giving the world the concept of zero, Indian mathematicians made significant contributions to the study of algebra, arithmetic, trigonometry, and numbers. In my view, spirituality has no religious overtones. That’s why some ancient Indian temples & scriptures are also well-known sources of knowledge and attract research scholars around the world. In mathematics, a square array of numbers is called a magic square if the sums of the numbers in each row, each column, and both main diagonals are the same.

Let’s take the examples of two temples that are also part of UNESCO World Heritage Sites in India and their mathematical magic square connections.

**Parshvanath temple, Khajuraho, Madhya Pradesh**

Parshvanath temple, Khajuraho is believed to have been constructed by a prominent Jain family in the 10th-century, during the reign of the Chandela king Dhanga and is a part of the Khajuraho Group of Monuments. The monuments at Khajuraho were inscribed on the UNESCO World Heritage List in 1986. There is a 4×4 magic square consisting of all numbers from 1 to 16 inscribed on the entrance pillar of this Jain temple. The numbers are arranged inside the square such that the sum of the numbers in every horizontal row, every vertical column, and every diagonal is 34. Not only that, the sum of the four numbers in any 2 by 2 sub-squares inside the big square is also 34. Because of these properties, this square is called the Most Perfect 4×4 Magic Square and is one of the world’s oldest and most perfect magic squares. It is also known as ‘Chautisa Yantra’ or ‘Jaina Square’.

**Kuldevi Temple, Kumbhalgarh Fort, Rajasthan**

The Hill Forts of Rajasthan are six forts, spread across Rajasthan state in northern India and have been clustered as a series and designated as a UNESCO World Heritage Site in 2013. One of them is Kumbhalgarh Fort, also known as the Great Wall of India. The credit for the construction of Kumbhalgarh Fort goes to Maharana Kumbha, who established it in the Vikram Samvat year 1515 (15th century, 1458 AD.)(Source:https://amritmahotsav.nic.in/district-reopsitory-detail.htm?24308). This fort is also the birthplace of the legendary Maharana Pratap.

There is a Kuldevi temple in the fort where, inside the Akhand Deep (a wicker lamp that is never allowed to go off) is kept. At the entrance of this temple I discovered one perfect 3×3 magic square and another almost perfect 3×3 magic square and the last one flower type arrangement.

The first magic square consists of numbers 1 to 9 and the sums of the numbers in each row, each column, and both main diagonals are 15.

The last flower type arrangement consists of numbers 2 to 8 in such a way that the sums of the numbers of all three sides/diagonals are 15.

The second magic square and middle arrangement consists of numbers 2 to 11, excluding 1,5 and the sums of the numbers in each row, each column and one diagonal are 20, except one diagonal is 21.

I haven’t found anything related to this magic square written or mentioned by anyone on the internet or offline. Anyway, hope you found this interesting.

If possible, do visit both UNESCO World Heritage sites and get the experience of Incredıble !ndia – अतुल्य! भारत.

I have constructed a very unique magic square and named it “MILLENIUM MAGIC SQUARE” and published it in my original puzzle book “COMPUTATIONAL PUZZLES TO FLEX YOUR BRAIN”. For more: https://byte-man.com/millenium-magic-square/

The post Indian Temples and Magic Squares appeared first on BYTE-MAN.

]]>**Why is it important to invest in domain for any online business?**

For any online business, a domain is an asset like a property. Suppose you buy a property and start a shop on it and after a few years, in the worst scenario, if your shop business fails, then you can shut down your shop & can sell your property. While selling your property, you also calculate your investment with interest (property price appreciation). The same case can be applicable to domains too.

**Difference between Domain Squatting and Domain Investing**

There is a huge difference between domain squatting and domain investing.

Domain Squatting means purchasing and misusing any domain name which negatively impacts other entity’s reputation, identity or business.

Domain Investment means purchasing undervalued domains and reselling them at a higher price based on market demand and trends.

Why is it important to invest in domain for any online business?

For any online business, a domain is an asset like a property. Suppose you buy a property and start a shop on it and after a few years, in the worst scenario, if your shop business fails, then you can shut down your shop & can sell your property. While selling your property, you also calculate your investment with interest (property price appreciation). The same case can be applicable to domains too.

Difference between Domain Squatting and Domain Investing

There is a huge difference between domain squatting and domain investing.

Domain Squatting means purchasing and misusing any domain name which negatively impacts other entity’s reputation, identity or business.

Domain Investment means purchasing undervalued domains and reselling them at a higher price based on market demand and trends.

Genuine domain investors don’t support domain squatting.

The post Domain Name Investment appeared first on BYTE-MAN.

]]>Recently, India has celebrated Children’s Day on 14th November. Keeping a neutral and unbiased short view regarding ongoing international conflicts, I would say, every child’s life matters including both, Israeli or Palestinian. Hope for a peaceful solution for both.

India truly believes in वसुधैव कुटुम्बकम् (Vasudhaiv Kutumbakam, which means “The World Is One Family”) and supports the development of children of other developing partner countries too. We are all familiar with African kids impacted by the past or present conflicts in Africa. That’s why India isn’t just setting up the campuses of our premier public technical universities in our developed partner countries like the UAE & the UK etc, but also in Africa. India’s efforts to bring world-class education to Africa are showing India’s willingness to ensure that Africa has access to the best education opportunities, facilities and development available, paving the way for a brighter future for kids across Africa.

Apart from a reputed private US university, Carnegie Mellon University, I don’t know if any other reputed private or public technical university of any other country (outside Africa) has a campus in Africa. In my view, India is the only country whose government-funded premier public technical universities have set up campuses in Africa.

The post India-Africa Educational Ties appeared first on BYTE-MAN.

]]>Few companies ask the below brain teaser to the candidates during the interview.

There are 40 students in the class. What is the possibility that at least 2 students share the same day of birth?

But what if it is a coding challenge:

There are N students in the class. What is the possibility that at least 2 students share the same day of birth? (Provided condition: No student is born in a leap year.)

Write a code that calculates the required probability.

Buy & review my coding puzzle books “**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “**Computational Puzzles To Flex Your Brain: 50 original puzzles to sharpen computing mind and mathematical skills**” at Amazon. For purchasing my books, feel free to contact me.

Solution:

General Formula:

**Required probability = 1 – ( 365! / ((365-N)! * 365 ^{N} ))**

Where N = Number of students in a class

Coding Solution:

```
# N Number of Students in Class
N = int (input('Enter Number of Students(N):'))
mul1 = 1
for x in range(365-N+1,366):
mul1 = mul1 * x
base = 365
exponent = N
mul2 = pow(base, exponent)
print('Probability of any two share same birthday:',1-(mul1/mul2))
```

Note : (Keeping non-coder readers in mind, code optimization is not fully utilized.)

```
Test Output 1:
Enter Number of Students(N):40
Probability of any two share same birthday: 89.1231809817949 %
Test Output 2:
Enter Number of Students(N):100
Probability of any two share same birthday: 99.99996927510722 %
```

The post Birthday Match Problem appeared first on BYTE-MAN.

]]>N pirates of different ages have a treasure of 100 gold coins.

On their ship, they decide to split the coins using this scheme:

The oldest pirate proposes how to share the coins, and all pirates (including the oldest) vote for or against it.

If 50% or more of the pirates vote for it, then the coins will be shared that way. Otherwise, the pirate proposing the scheme will be thrown overboard, and the process is repeated with the pirates that remain.

As pirates tend to be a bloodthirsty bunch, if a pirate would get the same number of coins if he voted for or against a proposal, he will vote against so that the pirate who proposed the plan will be thrown overboard.

Assuming that all N pirates are intelligent, rational, greedy, and do not wish to die, (and are rather good at math for pirates) what will happen? (Provided condition: N<50)

Buy & review my coding puzzle books “**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “**Computational Puzzles To Flex Your Brain: 50 original puzzles to sharpen computing mind and mathematical skills**” at Amazon. For purchasing my books, feel free to contact me.

Solution:

(Keeping non-coder readers in mind, code optimization is not fully utilized.)

Let’s take N=5 for example.

Let us name the pirates (from oldest to youngest): ‘A’, ‘B’, ‘C’, ‘D’ and ‘E’.

Working backwards:

If N=2 (‘D’ & ‘E’ only)

2 Pirates: ‘D’ splits the coins 100 : 0 (giving himself all the gold). His vote (50%) is enough to ensure the deal.

If N=3 (‘C’, ‘D’ & ‘E’)

3 Pirates: ‘C’ splits the coins 99 : 0 : 1. ‘E’ will accept this deal (getting just 1 coin), because he knows that if he rejects the deal there will be only two pirates left, and he gets nothing.

If N=4 (‘B’, ‘C’, ‘D’ & ‘E’)

4 Pirates: ‘B’ splits the coins 99 : 0 : 1 : 0. By the same reasoning as before, ‘D’ will support this deal. ‘B’ would not waste a spare coin on ‘C’, because ‘C’ knows that if he rejects the proposal, he will pocket 99 coins once ‘B’ is thrown overboard. ‘B’ would also not give a coin to ‘E’, because ‘E’ knows that if he rejects the proposal, he will receive a coin from ‘C’ in the next round anyway.

If N=5 (‘A’, ‘B’, ‘C’, ‘D’ & ‘E’)

5 Pirates: ‘A’ splits the coins 98 : 0 : 1 : 0 : 1. By offering a gold coin to ‘C’ (who would otherwise get nothing) he is assured of a deal.

(Note: In the final deal ‘A’ would not give a coin to ‘B’, who knows he can pocket 99 coins if he votes against ‘A’s proposal and ‘A’ goes overboard. Likewise, ‘A’ would not give a coin to ‘D’, because ‘D’ knows that if he votes against the proposal, ‘A’ will be voted overboard and ‘B’ will propose to offer ‘D’ the same single coin as ‘A’. All else equal, ‘D’ would rather see ‘A’ go overboard and collect his one coin from ‘B’.)

Working forwards:

What if, 6 pirates(‘A’, ‘B’, ‘C’, ‘D’, ‘E’ & ‘F’)

If N=6

The oldest pirate splits the coins 98 : 0 : 1 : 0 : 1 : 0

What if, 7 pirates(‘A’, ‘B’, ‘C’, ‘D’, ‘E’, ‘F’ & ‘G’)

If N=7

The oldest pirate splits the coins 97 : 0 : 1 : 0 : 1 : 0 : 1

Thus, if N is odd number than the youngest one gets 0 gold coin else he gets 1 gold coin.

If N is odd then

The oldest pirate splits the coins (100-((N-1)/2) ) : 0 : 1 :0 … : 0 : 1

If N is even then

The oldest pirate splits the coins (100-((N-1)/2) ) : 0 : 1 :0 … : 1 : 0

```
import math
no_of_pirates = int(input('Enter number of pirates:'))
if (no_of_pirates % 2 == 0):
oldest_pirate_coins = 100 - ((no_of_pirates - 1) / 2)
print(math.ceil(oldest_pirate_coins))
for i in range(no_of_pirates-1,0,-1):
if(i % 2):
print('0')
else:
print('1')
else:
oldest_pirate_coins = 100 - ((no_of_pirates - 1) / 2)
print(math.ceil(oldest_pirate_coins))
for i in range(no_of_pirates - 1, 0, -1):
if (i % 2):
print('1')
else:
print('0')
```

]]>Imagine there are N ants in N different corners of an equilateral polygon, and each ant randomly picks a direction and starts traversing the edge of the polygon. What is the probability that none of the ants collide? (Provided condition: N>2)

Write a code.

Solution:

There are only two possibilities in which collision can be occurred.

* All ants move in counterclockwise direction.

* All ants move in anti-counterclockwise direction.

Since every ant has two choices (pick either of two edges going through the corner on which ant is initially sitting). So for N ants there are total 2^{N} possibilities.

Probability that none of the ants collide = (2^{N} – 2)/ 2^{N} = ( 2^{N-1} – 1)/ 2^{N-1}

Coding Solution

```
import math
# Non Collide Probability for N ANTS
# N Number of Ants & N > 2
N = int(input("Enter number of ants:"))
if N <= 2:
print("Number of ants should be greater than 2")
exit()
# P Probability
P = (math.pow(2,N-1)-1)/math.pow(2,N-1)
print('Probability that none of', N, 'ants collide:', P)
```

PS: Maybe it’s not an optimized coding solution, so that non-coders can also understand.

```
Test Output 1:
Enter number of ants:4
Probability that none of 4 ants collide: 0.875
Test Output 2:
Enter number of ants:3
Probability that none of 3 ants collide: 0.75
```

]]>There is an unfair coin. It tends to land on one side more than on the other.

Make a fair (unbiased) coin from an unfair (biased) coin.

Write a program which provides solution for above problem statement.

The coding solution was originally published in my book “Brain Teasers with Coding For Data Scientist”. Puzzles from that book are going to be published on this website. Buy & review my coding puzzle books “**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “**Computational Puzzles To Flex Your Brain: 50 original puzzles to sharpen computing mind and mathematical skills**” at Amazon. For purchasing my books, feel free to contact me.

Coding Solution:

```
from random import randint
# Biased function that returns Heads with 60% probability and
# Tails with 40% probability
def toss_biased(head_prob):
# generate random number between 1-100, both inclusive
r = randint(1, 100)
# return Head if we got number between [1 to Head probability], else return tail
return H if (r <= head_prob) else T
def toss_unbiased(head_prob):
# difference = 0 in case of HH or TT toss again
# difference > 0 in case of HT return H
# difference < 0 in case of TH return T
difference = toss_biased(head_prob) - toss_biased(head_prob)
if difference > 0:
return H
if difference < 0:
return T
return toss_unbiased(head_prob)
# Generate Fair Results from a Biased Coin
if __name__ == '__main__':
# Head
H = 1
# Tail
T = 0
head_prob = int(input("Enter the probability of getting Head:"))
if(head_prob <1 or head_prob >99):
print("Enter probability between 1 & 99")
exit()
if(head_prob == 50):
print("No need to apply a solution")
exit()
print("the probability of getting Head:", head_prob,"%")
print("the probability of getting Tail:", 100-head_prob,"%")
head_count = tail_count = 0
for i in range(10000):
val = toss_unbiased(head_prob)
if val == 1:
head_count += 1
else:
tail_count += 1
print("the probabilities after applying a solution:")
# Heads with ~50% probability
print("HEADS% ~", head_count / 100, "%")
#Tails with ~50% probability
print("TAILS% ~", tail_count / 100, "%")
```

PS: Maybe it’s not an optimized coding solution, so that non-coders can also understand.

```
Test Output 1:
Enter the probability of getting Head:59
the probability of getting Head: 59 %
the probability of getting Tail: 41 %
the probabilities after applying a solution:
HEADS% ~ 50.19 %
TAILS% ~ 49.81 %
Test Output 2:
Enter the probability of getting Head:77
the probability of getting Head: 77 %
the probability of getting Tail: 23 %
the probabilities after applying a solution:
HEADS% ~ 49.8 %
TAILS% ~ 50.2 %
```

The post Unfair Coin Problem appeared first on BYTE-MAN.

]]>You are about to get on a plane to Mumbai, you want to know whether you have to bring an umbrella or not. You call N of your random friends in Mumbai and ask each one of them if it is raining. The probability that your any friend is telling the truth is 2/3 and the probability that (s)he is playing a prank on you by lying is 1/3. If all N of them tell that it is raining, then what is the probability that it is actually raining in Mumbai.

Can you write a program that calculates the probability that it is actually raining in Mumbai.

The coding solution was originally published in my book “Brain Teasers with Coding For Data Scientist”. Puzzles from that book are going to be published on this website. Buy & review my coding puzzle books “**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “

Solution

You only require one of the friends to be telling the truth.

The probability that at least one of them is telling the truth will be =

1 – (Probability that all of them Lied)

The probability that one of them lied is 1/3

So, the probability that all N lied is 1/3 * 1/3 * 1/3 * …* 1/3 (N times multiplication of 1/3) = 1/(3^N)

So, now the probability that at least one of them told the truth is or there is a raining is = 1 – (1/(3^N))

```
# Probability of Raining
import math
# N Number of friends
N = int(input("Enter N:"))
if N < 1:
print("N should be greater than 0")
exit()
# P Probability = 1 - (Probability that all of them Lied)
P = 1 - (1/pow(3,N))
print('Possibility of Raining', P*100,'%')
```

PS: Maybe it’s not an optimized coding solution, so that non-coders can also understand.

```
Test Output 1:
Enter N:1
Possibility of Raining 66.66666666666667 %
Test Output 2:
Enter N:2
Possibility of Raining 88.88888888888889 %
Test Output 3:
Enter N:3
Possibility of Raining 96.2962962962963 %
Test Output 4:
Enter N:5
Possibility of Raining 99.58847736625515 %
```

]]>The director of a prison offers N death row prisoners, who are numbered from 1 to N, a last chance. A room contains a cupboard with N boxes. The director randomly puts one prisoner’s number in each closed boxes. The prisoners enter the room, one after another. Each prisoner may open and look into N/2 boxes in any order. The boxes are closed again afterwards. If, during this search, every prisoner finds his number in one of the boxes, all prisoners are pardoned. If just one prisoner does not find his number, all prisoners die. Before the first prisoner enters the room, the prisoners may discuss strategy — but may not communicate once the first prisoner enters to look in the boxes.

What is the prisoners’ best strategy?

Write a code for scenario for any one prisoner.

The coding solution was originally published in my book “Brain Teasers with Coding For Data Scientist”. Puzzles from that book are going to be published on this website. Buy & review my coding puzzle books “**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “

Solution

There is a strategy that provides a better survival probability than

randomly opening the boxes.

To describe the strategy, not only the prisoners, but also the boxes

are also numbered from 1 to N. The strategy is now as follows:

1.) Each prisoner first opens the box with his own number.

2.) If that box contains his number then he is successful.

3.) Otherwise, the box contains the number of another prisoner and

he next opens the box with this number.

4.) The prisoner repeats steps 2 and 3 until he finds his own number

or has opened N/2 drawers.

Coding Solution:

```
#Checking for an individual prisoner
from random import randint
# Flling N Boxes randomly
def fillBoxes(N, NBox):
r = randint(1, N)
if r in NBox:
fillBoxes(N, NBox)
else:
NBox.append(r)
if(len(NBox) <N):
fillBoxes(N, NBox)
return NBox
# Finding Own Number
def findingNumber(chosenOne, NBox, checkBoxNo, count, N):
if count >= N/2:
if(NBox[checkBoxNo-1] == chosenOne):
print('Number is found')
else:
print('Number is not found')
return
elif(NBox[checkBoxNo-1] == chosenOne):
print('Number is found')
return 1
else:
print('At Step:', count+1,': ','checked box number:', NBox[checkBoxNo-1])
findingNumber(chosenOne, NBox,NBox[checkBoxNo-1], count+1, N)
# N Number of Prisoners
N = int(input("Enter N:"))
if N < 1:
print("N should be greater than 0")
exit()
print('Total number of Prisoners', N)
# Fill N boxes randomly with numbers 1 to N
NBox = []
NBox = fillBoxes(N, NBox)
print('Arrangement of Boxes', NBox)
chosenOne = randint(1, N)
print('Prison No.', chosenOne,'is sent')
print('At step: 1: checked box number:', chosenOne)
findingNumber(chosenOne, NBox, chosenOne, 1, N)
```

PS: Maybe it’s not an optimized coding solution, so that non-coders can also understand.

```
Test Output 1:
Enter N:75
Total number of Prisoners 75
Arrangement of Boxes [39, 46, 55, 19, 21, 45, 12, 52, 14, 53, 7, 34, 62, 18, 37, 70, 31, 67, 2, 71, 63, 51, 24, 57, 13, 5, 41, 49, 25, 36, 74, 66, 22, 27, 48, 8, 30, 44, 3, 42, 64, 47, 1, 65, 23, 38, 68, 15, 69, 16, 59, 56, 72, 29, 73, 33, 26, 20, 60, 43, 4, 54, 35, 61, 50, 75, 40, 32, 6, 58, 17, 9, 28, 11, 10]
Prison No. 73 is sent
At step: 1: checked box number: 73
At Step: 2 : checked box number: 28
At Step: 3 : checked box number: 49
At Step: 4 : checked box number: 69
At Step: 5 : checked box number: 6
At Step: 6 : checked box number: 45
At Step: 7 : checked box number: 23
At Step: 8 : checked box number: 24
At Step: 9 : checked box number: 57
At Step: 10 : checked box number: 26
At Step: 11 : checked box number: 5
At Step: 12 : checked box number: 21
At Step: 13 : checked box number: 63
At Step: 14 : checked box number: 35
At Step: 15 : checked box number: 48
At Step: 16 : checked box number: 15
At Step: 17 : checked box number: 37
At Step: 18 : checked box number: 30
At Step: 19 : checked box number: 36
At Step: 20 : checked box number: 8
At Step: 21 : checked box number: 52
At Step: 22 : checked box number: 56
At Step: 23 : checked box number: 33
At Step: 24 : checked box number: 22
At Step: 25 : checked box number: 51
At Step: 26 : checked box number: 59
At Step: 27 : checked box number: 60
At Step: 28 : checked box number: 43
At Step: 29 : checked box number: 1
At Step: 30 : checked box number: 39
At Step: 31 : checked box number: 3
At Step: 32 : checked box number: 55
Number is found
Test Output 2:
Enter N:110
Total number of Prisoners 110
Arrangement of Boxes [106, 38, 62, 67, 59, 82, 79, 105, 47, 49, 5, 50, 46, 104, 76, 69, 94, 48, 86, 109, 63, 32, 1, 16, 13, 101, 30, 18, 56, 8, 72, 58, 14, 43, 93, 96, 44, 55, 33, 4, 25, 81, 78, 66, 83, 17, 10, 26, 22, 15, 65, 77, 23, 57, 74, 20, 40, 34, 6, 87, 54, 21, 71, 19, 84, 42, 45, 110, 36, 24, 89, 51, 88, 52, 102, 103, 95, 98, 53, 41, 107, 31, 108, 90, 80, 68, 35, 11, 12, 29, 61, 73, 3, 91, 7, 2, 39, 28, 64, 60, 92, 37, 75, 100, 27, 9, 97, 85, 99, 70]
Prison No. 10 is sent
At step: 1: checked box number: 10
At Step: 2 : checked box number: 49
At Step: 3 : checked box number: 22
At Step: 4 : checked box number: 32
At Step: 5 : checked box number: 58
At Step: 6 : checked box number: 34
At Step: 7 : checked box number: 43
At Step: 8 : checked box number: 78
At Step: 9 : checked box number: 98
At Step: 10 : checked box number: 28
At Step: 11 : checked box number: 18
At Step: 12 : checked box number: 48
At Step: 13 : checked box number: 26
At Step: 14 : checked box number: 101
At Step: 15 : checked box number: 92
At Step: 16 : checked box number: 73
At Step: 17 : checked box number: 88
At Step: 18 : checked box number: 11
At Step: 19 : checked box number: 5
At Step: 20 : checked box number: 59
At Step: 21 : checked box number: 6
At Step: 22 : checked box number: 82
At Step: 23 : checked box number: 31
At Step: 24 : checked box number: 72
At Step: 25 : checked box number: 51
At Step: 26 : checked box number: 65
At Step: 27 : checked box number: 84
At Step: 28 : checked box number: 90
At Step: 29 : checked box number: 29
At Step: 30 : checked box number: 56
At Step: 31 : checked box number: 20
At Step: 32 : checked box number: 109
At Step: 33 : checked box number: 99
At Step: 34 : checked box number: 64
At Step: 35 : checked box number: 19
At Step: 36 : checked box number: 86
At Step: 37 : checked box number: 68
At Step: 38 : checked box number: 110
At Step: 39 : checked box number: 70
At Step: 40 : checked box number: 24
At Step: 41 : checked box number: 16
At Step: 42 : checked box number: 69
At Step: 43 : checked box number: 36
At Step: 44 : checked box number: 96
At Step: 45 : checked box number: 2
At Step: 46 : checked box number: 38
At Step: 47 : checked box number: 55
At Step: 48 : checked box number: 74
At Step: 49 : checked box number: 52
At Step: 50 : checked box number: 77
At Step: 51 : checked box number: 95
At Step: 52 : checked box number: 7
At Step: 53 : checked box number: 79
At Step: 54 : checked box number: 53
At Step: 55 : checked box number: 23
Number is not found
```

The post N Prisoners and N Boxes appeared first on BYTE-MAN.

]]>Few companies ask the below brain teaser to the candidates during the interview.

You have 1000 wine bottles, one of which is poisoned. You want to determine which bottle is poisoned by feeding the wine to the rats. The poisoned wine takes 1 hour to work. How many rats are necessary to find the poisoned bottle in 1 hour?

But what if it is a coding challenge:

You have X wine bottles, one of which is poisoned. You want to determine which bottle is poisoned by feeding the wine to the rats. The poisoned wine takes Z hour to work. How many rats are necessary to find the poisoned bottle in Y hour? (Provided condition: Y is multiple of Z.)

Can you write a program which takes X, Y & Z as input and gives the solution?

**Brain Teasers** **with Coding For Data Scientist 2: 9 New Computational Puzzles**” and “**Puzzles with Coding: Puzzles for Everyone**” and “

Solution:

Coding Solution

```
import math
#X wine bottles
X = int(input("Enter X:"))
#Z hour time after which the poison works
Z = int(input("Enter Z:"))
#Y hour time to find the poisoned bottle
Y = int(input("Enter Y(Y should be multiple of Z):"))
T = Y/Z
print ("Number of rats required to find the poisoned bottle: ", end="")
print (math.ceil(math.log(X,T+1)))
```

PS: Maybe it’s not an optimized coding solution, so that non-coders can also understand.

```
Test Output 1:
Enter X:1000
Enter Z:24
Enter Y(Y should be multiple of Z):48
Number of rats required to find the poisoned bottle: 7
Test Output 2:
Enter X:1000
Enter Z:24
Enter Y(Y should be multiple of Z):24
Number of rats required to find the poisoned bottle: 10
```

]]>You have N bags full of coins. In each bag are infinite coins. But one bag is full of forgeries, and you can’t remember which one. But you do know that genuine coins weigh 1 gram, but forgeries weigh 1.1 grams. You have to identify that bag in minimum readings. You are provided with a digital weighing machine.

You have N bags full of coins. In each bag are infinite coins. But one bag is full of forgeries, and you can’t remember which one. But you do know that genuine coins weigh 1 gram, but forgeries weigh 1.1 grams. You have to identify that bag in minimum readings. You are provided with a digital weighing machine.

Write a program that can take N as input and the rest solution is generated by it.

Solution:

There is only 1 bag with forgeries, so take 1 coin from the first bag, 2 coins from the second bag . . . N coins from the Nth bag and simply weigh the picked coins together.

If there were no forgeries, you know that the total weight should be (1+2+…+n) = n*(n+1)/2 grams.

So, the number difference between them will give the bag number of fake coins.

Coding Solution:

```
# Finding Bag No filled with fake coins
from random import randint
# N Number of bags
N = int(input("Enter N:(N>0):"))
if N < 1:
print('N should be greater than zero')
exit()
print('Total number of bags:', N)
# r Any random number between 1 & N
r = randint(1, N)
print('random bag number where to put fake coins:', r)
coinArr = []
sumCoin = 0.0
#Putting 1 g coins in each bag except r in which putting 1.1g fake coins
for x in range(1,N+1):
if x == r :
coinArr.append(1.1)
else:
coinArr.append(1)
print('Coin Bags:', coinArr)
#Finding fake coin bags
#Taking k numbers of coin from k bags & weighing them
for k in range(len(coinArr)):
sumCoin += (coinArr[k]) * (k+1)
print('Weight with fake coins:', sumCoin)
#Wanted weight if no coins are fake
actualSumCoin = N * (N+1) / 2;
#Difference between sumCoin and actualSumCoin
diff = sumCoin - actualSumCoin
#round function for correcting floating point difference in Python
fakeBagNo = round(diff,4)*10
print('Bag No. with fake coins:', round(fakeBagNo))
```

```
Output:
Test Output 1:
Enter N:(N>0):30
Total number of bags: 30
random bag number where to put fake coins: 30
Coin Bags: [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.1]
Weight with fake coins: 468.0
Bag No. with fake coins: 30
Test Output 2:
Enter N:(N>0):12
Total number of bags: 12
random bag number where to put fake coins: 4
Coin Bags: [1, 1, 1, 1.1, 1, 1, 1, 1, 1, 1, 1, 1]
Weight with fake coins: 78.4
Bag No. with fake coins: 4
```

]]>Few companies ask the below brain teaser to the candidates during the interview.

You have 100 coins laying flat on a table, each with a head side and a tail side. 10 of them are heads up, rest are tails up. You can’t feel, see or in any other way find out which 10 are heads up.

Your goal: split the coins into two piles in such a way that there are the same numbers of heads-up coins in each pile.

For coding candidates, tech companies ask

You have an N coins laying flat on a table, each with a head side and a tail side. M of them are heads up, rest are tails up. You can’t feel, see or in any other way find out which M are heads up.

Your goal: split the coins into two piles in such a way that there are the same numbers of heads-up coins in each pile.

Write a program that can take N as an input and the rest solution can be generated by a program.

Coding solution was originally published in my book.

Solution:

1.) If there are M heads-up coins in N coins then pick randomly M coins from the given N coins and create two piles. (M coins, (N-M) coins)

2.) Flip all coins from a pile of M coins. You’re done. You have successfully created two piles so that there are the same numbers of heads-up coins in each pile.

```
from random import randint
import array as arr
# Random function that returns N Coins with M Heads
def random_coins():
# generate random number either 1 or 0
r = randint(0, 1)
# return Head if we got number 1, else return T
return H if (r == 1) else T
# Generate Two Piles with Same Number of Heads-up Coins
if __name__ == '__main__':
# Head
H = 1
# Tail
T = 0
head_count = tail_count = 0
#Number of coins, let's take 100
N = int(input("Enter Number(N):"))
coins = []
for i in range(N):
val = random_coins()
if val == 1:
head_count += 1
coins.append(1)
else:
tail_count += 1
coins.append(0)
print('Randomly Generated Coins')
print(coins)
print('In single pile of', N, 'coins:', head_count, 'are Heads and ', tail_count, ' are Tails')
print('***Solution for splitting the coins into two piles***')
pile1_coins = coins[0:head_count]
print('Size of 1st piles coins:',len(pile1_coins))
print('1st piles coins:', pile1_coins)
pile2_coins = coins[len(pile1_coins):N]
print('Size of 2nd piles coins:', len(pile2_coins))
print('2nd piles coins:', pile2_coins)
pile1_coins_head = pile2_coins_head = 0
print('flip all coins of 1st pile')
for g in range(len(pile1_coins)):
if pile1_coins[g] == 1:
pile1_coins[g] = 0
else:
pile1_coins[g] = 1
print('1st piles coins after a flip:', pile1_coins)
for j in range(len(pile1_coins)):
if pile1_coins[j] == 1:
pile1_coins_head += 1
for k in range(len(pile2_coins)):
if pile2_coins[k] == 1:
pile2_coins_head += 1
print('Number of coins with head in 1st pile:',pile1_coins_head)
print('Number of coins with head in 2nd pile:',pile2_coins_head)
```

]]>Some people think due to some ethical issues like lack of transparency (For example: ChatGPT is a proprietary software so consumers are unaware of its rules of processing) or embedded bias (For example: Models learn from old test datasets which are sometimes biased) etc, and that’s why ChatGPT won’t replace humans. But over the period of time, new better technologies, models, datasets, algorithms or methods will be invented and these ethical issues may be resolved.

However, in my view, the real problem is the energy and its footprint consumed by each ChatGPT query. At present, the cost of processing a simple general query (For Example: what is the answer to 1+6) to ChatGPT isn’t economical compared to asking a human. The cost per query in ChatGPT is estimated to be roughly 0.36 cents for users who subscribe. But for free users, this cost is likely to be much higher. That’s why many researchers are working on how to reduce energy cost per query at the microchip level. You might be wondering if we aren’t using energy and creating an energy footprint while searching on Google. Yes, we are. However, as per one estimation, on average, a single ChatGPT query consumes 15 times more energy than a Google Search query. A single complex ChatGPT query may consume upto 0.01 kilo-Watt-hours of power. To put it in context, a 60 W incandescent light bulb consumes 0.06 kilo-Watt-hours of power in 1 hour. In a few years, powering AI could use as much electricity as a small country.

At present, China is the largest producer of AI research papers in the world and has been pouring billions into AI development and research in its goal to become a global leader in AI by 2030. It is more likely that Chinese researchers have identified the energy problem of AI software too early. To overcome these problems, China is making the ‘Artificial Sun’. The artificial sun project is based on nuclear fusion giving China an unlimited energy source without generating residual waste.

On the other hand, India also aspires to be the global AI lab for emerging economies and it has shown the highest growth rates for AI patent applications by country. But, at present, we are still lagging behind both China & the US, not only in research publications but also in talent and data processing. For example, in one such reported case, the dataset, like voice samples from India, was sold to agencies in China for use and analysis without permission. To counter such activities, new acts are introduced and some old are amended in India too. We are also focusing on improving the skill sets of the developers. However, we still have to figure out the environmentally friendly energy solution on an urgent basis, otherwise it’s impossible to be one of the AI leaders.

The post Forget AI Models, The Real Battlefield is The Energy appeared first on BYTE-MAN.

]]>In the open and global competitive market space of India, any MNC company is welcome and a consumer is a king.

As per data analysis by us, around 20000 government-funded higher education colleges are using .edu, .net, .com etc domain extensions over .in, .ac.in, .edu.in etc for their official websites. These domain extension prices are higher than any .in domain extension per year. In fact, .edu domain is quite restrictive and its price is around $77(Rs.6500/year) while .edu.in is under Rs.1000/year. At the same time as we are promoting “Make in India”, then why are some prominent government-funded colleges shying away from using .in domain extension? While .in or .bharat already have many subdomain extensions, getting a proper one shouldn’t be an issue for any college in cases of name clashes.

We, as a private company or college or university, use .com or .net domains, then it must be fine because we are also investing in our domains with our own money. I personally recommend .com or other gtld domain extensions for investment. However, if government-funded colleges aren’t using domain extension for investment purposes, then they must have to use .in domain because they depend on government funds. It not only saves money for the government but also increases our .IN domain extension visibility. If prominent Chinese or Japanese universities are using .cn or .jp extensions, then global visibility for Indian institutions shouldn’t be an issue.

Even, after producing one of the highest numbers of computer science graduates each year and the second biggest internet consumer country, our .in is not in the top 10 domain extensions. Our policy maker should aim for that place.

Once again reiterating, this is a personal view and any MNC company is welcome in India and a consumer is a king. We haven’t any problems with any gTLD and also recommend our clients.

The post .IN domain – Vision 2030? appeared first on BYTE-MAN.

]]>This article represents an individual view.

**What are the proposed Central Institutes of Technology?**

- Different from IITs/NITs/IIITs

IITs and IIITs have no state quota, while NITs and IIEST have a 50% state quota. But there are several central technical institutes where the state quota is institute dependent. In some central technical institutes, a 0% state quota, in some that is 80% and in some 90%. Some institutes are deemed to be universities, some are affiliated to central universities and some are affiliated to state universities. We need a unique branded umbrella “Central Institutes of Technology” backed by the new ‘Central Institutes of Technology Act’ that covers all these types of fully centrally funded technical institutes and declares them institutions of national importance. The name ‘Central Institute of Technology’ is taken from a centrally funded technical institute, CIT Kokrajhar, Assam.

**What’s the need for creating one more engineering institute tag brand?**

I am in favour of creating the CIT group of engineering institutes (Central Institutes of Technology) in India. Now one simple question: if we already have IITs, NITs & IIITs in India for engineering, then why spend more taxpayers’ money on developing CITs? What’s the need for creating one more engineering institute tag brand? Generally, I am the person who supports some level of privatisation even in the education field, but I still believe at the present stage central government intervening and all state governments’ support is required to create some strong technical education institute brand in a shorter period of time, because generally, Indian parents and students trust more in central government colleges. If anything happens during 4 years of engineering education, then if you are a government college student, then you don’t need to worry much about it. A government can step up and take care of the situation, while a single private institute or university may or may not handle the situation depending upon their own strength. Secondly, it’s not easy for a private institute or university to create and maintain multiple campuses all over India in a short period of time. Thirdly, because of the increasing population of India each year, we also require more institutes of national importance to accommodate and create more skill-forces.

- Avail to More Students

Central Institute of Technology can also provide a 3-year diploma engineering course and also allow lateral entry (for e.g., direct 2nd year admission to degree engineering courses for diploma holders). These facilities aren’t allowed in IITs/NITs/IIITs, but at present, several other centrally funded technical institutes or engineering departments of central universities are providing these facilities. Keep any state or other quota as it is initially in each CIT. Each CIT should be affiliated or clustered with a central university. It also helps any central university with resource sharing, more academic diversity, research activities, university ranking etc.

- Less setup cost

The government has taken a policy decision to not convert any state university/institute into a central university/institute for reasons of legacy issues, adjustment of existing staff and disaffiliation of affiliated colleges. But the government can upgrade the central funded institutes without any disaffiliation. Only totally centrally funded institutes or engineering departments of central universities should be converted into CITs without compromising any affiliation. Since these selected institutes are already funded by the central government, there should be no high additional setup expenditures.

- More research facilities creation

Presently, most undergraduate students take admission to colleges based on placement or tag rather than passion or research. College tag is directly associated with placements rather than research activities. [ While most international or national ranking is based on academic performance (including faculty members), so higher importance is given to research or white paper publication over campus placement. That’s why some reputed institutes with strong placement records are ranked poorly. Sometimes even because of lower student or professor strength.] But, CITs being institutes of national importance, many public and private enterprises will set up their collaborative research centres there, like IITs or NITs. Many firms or industrialists prefer to give donations to setup research centres or buildings in these kinds of national institutes over some state institutes. These facilities may attract more students towards research activities.

- Larger Talent Pool

Some companies only hire from IITs/NITs/IIITs/top elite public-private institutes. Some investors or VCs prefer to invest in those start-ups founded by the alumni of these institutes. If we create one more INI (Institutes of National Importance) engineering institution brand, then they will create a larger talent pool covering more students and fresh graduates.

- More students getting Desiring Branch

For example, at present, computer science is the most preferred branch among engineering aspirants. The major reasons are campus placement and high numbers of career opportunities and pay scale. Having said this, we can’t ignore any core engineering branch. But the problem is, no one wants to take a risk for passion and everybody wants to play a safe game. Getting a higher salary at a fresher level is a major driving force to encourage students and parents to go to the CS branch without seeing where a student’s passion lies. I don’t blame anyone for this, it’s a human tendency. But, it’s not possible for every aspirant to get a desired branch. By creating better quality INI tag institutes, students will get a lot of options.

- Beneficial To All Stream

Some centrally funded technical institutes are already conducting and others will also start B.A.(Eco.), B.Sc./M.Sc., BBA, MBA, MCA etc programmes in which other stream students can also take admission and can improve their chance to study from INI institutes. It also brings more academic diversity.

**Selecting institutes for CITs formation**

- The future campus means a central university will provide engineering courses at its permanent location in the future.
- Each CIT should be affiliated or clustered with a central university.

The below-mentioned institutes are fully residential-deemed universities and already Centrally Funded Technical Institutes (Ministry of Education). Keep any state or other quota as it is initially.

- CIT, Kokrajhar should be the first CIT. (Make cluster with Assam University)

- SLIET, Longowal should be converted into CIT Longowal. (Make cluster with Central University of Punjab)

- NERIST, Itanagar should be converted into CIT Itanagar. (Make cluster with Rajiv Gandhi University)

The below-mentioned institutes are already funded by the central government (Ministry of Education) and affiliated to some state universities. Keep any state or other quota as it is initially.

- NIAMT Ranchi (affiliated to Jharkhand University of Technology) should be converted into CIT Ranchi. (Make a cluster with Central University of Jharkhand).

- NIELIT Chhatrapati Sambhajinagar (affiliated to Dr. Babasaheb Ambedkar Marathwada University) should be converted into CIT Chhatrapati Sambhajinagar. (Make a cluster with Mahatma Gandhi Antarrashtriya Hindi Vishwavidyalaya).

- GKCIET, Malda (affiliated to Maulana Abul Kalam Azad University of Technology) should be converted into CIT Malda. (Make cluster with Visva-Bharti University)

The below-mentioned institutes/departments are already funded by the central government (Ministry of Education) and affiliated to some central university. Keep any state or other quota as it is initially.

- ZHCET, Aligarh (affiliated to Aligarh Muslim University) should be converted into CIT Aligarh.

- JKIAPT, Prayagraj (affiliated to Allahabad University) should be converted into CIT Prayagraj.

- SEST, Hyderabad (affiliated to University of Hyderabad) should be converted into CIT Hyderabad.

- ITGGU, Bilaspur (affiliated to Guru Ghasidas Vishwavidyalaya) should be converted into CIT Bilaspur.
- SCSICT, Motihari (affiliated to Mahatma Gandhi Central University) should be converted into CIT Motihari.

- DBRAIT, Port Blair (affiliated to Pondicherry University) should be converted into CIT Port Blair.

- SIST, Chisopani (affiliated to Sikkim University) should be converted into CIT Chisopani.

- MIT, Imphal (affiliated to Manipur University) should be converted into CIT Imphal.

- TIT, Agartala (affiliated to Tripura University) should be converted into CIT Agartala.

- SET-NU, Dimapur (affiliated to Nagaland University) should be converted into CIT Dimapur.

- SOE, Tezpur (affiliated to Tezpur University) should be converted into CIT Tezpur.

- IoET, Sagar (affiliated to Dr. H.S. Gour University) should be converted into CIT Sagar.

- SoT, Shillong (affiliated to North-Eastern Hill University) should be converted into CIT Shillong.

- MZU SET, Aizawl (affiliated to Mizoram University) should be converted into CIT Aizawl.

- SoET, Mahendragarh (affiliated to Central University of Haryana) should be converted into CIT Mahendragarh.

- SoET, Ajmer (affiliated to Central University of Rajasthan) should be converted into CIT Ajmer.

- School of Engineering, Samba (affiliated to Central University of Jammu) should be converted into CIT Jammu.
- School of Engineering, Ganderbal (affiliated to Central University of Kashmir) should be converted into CIT Ganderbal.

- SoET, Srinagar (Garhwal) (affiliated to Hemvati Nandan Bahuguna Garhwal University) should be converted into CIT Srinagar.

- UIET, Lucknow (affiliated to Babasaheb Bhimrao Ambedkar University) should be converted into CIT Lucknow.
- Since Delhi city has many central universities – (DU, JNU & JMI), the engineering faculty of any one central university should be converted into CIT Delhi.

The post Need for Central Institutes of Technology appeared first on BYTE-MAN.

]]>In the recently released World University Rankings 2024 by Times Higher Education (THE), the Indian Institute of Science (IISc) has emerged as the leading university in India by securing a position in the world’s top 250. However, no Indian university is featured in the top 200.

Highlights:

- The Indian Institute of Science (IISc) has claimed the highest position among Indian universities, securing the 201-250th spot in THE World University Rankings 2024.
- India has made a notable presence in the rankings, with a total of 91 universities featured in THE World University Rankings 2024. That’s an increase from 75 last year.
- In the world, the US holds the first position with 169 universities, followed by Japan with 119 and the UK with 104. In Asia, Japan holds the first position with 119 universities, followed by India with 91 and China with 86 universities. India secures the fourth position in terms of the number of universities featured in the rankings, with 91 universities listed.
- Since 2020, IITs has boycotted the THE World University Rankings over issues of transparency after none of them were ranked among the world’s top 300 institutions. In 2023, THE World University introduced specific changes in the performance parameters to address the former’s concerns. However, in this year’s rankings, all the top IITs are missing.

The post THE World University Rankings 2024 and India appeared first on BYTE-MAN.

]]>The post Online Gaming Intermediary appeared first on BYTE-MAN.

]]>