Answer:
def replace_at_index(str, number):
new = str.replace(str[number], "-")
return new
print(replace_at_index("eggplant", 3))
Explanation:
- Create a function called <em>replace_at_index</em> that takes a string and an integer
- Initialize a new variable called <em>new</em>, that will hold the new string
- Replace the character at given index with dash using <em>replace</em> function, it takes two parameters: the first is the character we want to replace, the second is the new character.
- Return the new string
- Call the function with the required inputs
Answer:
Probability Distribution={(A, 4/7), (B, 2/7), (C, 1/7)}
H(X)=5.4224 bits per symb
H(X|Y="not C")=0.54902 bits per symb
Explanation:
P(B)=2P(C)
P(A)=2P(B)
But
P(A)+P(B)+P(C)=1
4P(C)+2P(C)+P(C)=1
P(C)=1/7
Then
P(A)=4/7
P(B)=2/7
Probability Distribution={(A, 4/7), (B, 2/7), (C, 1/7)}
iii
If X={A,B,C}
and P(Xi)={4/7,2/7,1/7}
where Id =logarithm to base 2
Entropy, H(X)=-{P(A) Id P(A) +P(B) Id P(B) + P(C) Id P(C)}
=-{(1/7)Id1/7 +(2/7)Id(2/7) +(4/7)Id(4/7)}
=5.4224 bits per symb
if P(C) =0
P(A)=2P(B)
P(B)=1/3
P(A)=2/3
H(X|Y="not C")= -(1/3)Id(I/3) -(2/3)Id(2/3)
=0.54902 bits per symb
A router is a web device that directs packages over a web towards their final destination is true.
<h3>What is the router?</h3>
- A router is a machine that combines two or more packet-switched grids or subnetworks.
- A router accepts and data transmits on computer networks. Routers are sometimes confused with network hubs, modems, or network controllers.
- However, routers can integrate the functions of these components, and secure with these devices, to improve Internet entry or help create interaction networks.
- A router is a device that is used for forwarding the internet connection to all the related devices.
- A Wi-Fi connects the networking parts of a router and a wireless access point.
- A wireless router (or Wi-Fi router) works much like a wired router, but it returns wires with wireless radio calls.
To learn more about router, refer to:
brainly.com/question/24812743
#SPJ4
Collage graduates that are currently jobless or looking to apply for a jod
Types in java are divided into two categories. the primitive types are boolean, byte, char, short, not, long, float, and double. all other types are REFERENCE types