1. S

    Algorithm for convert binary search tree to max heap

    Hello, I have BST in a custom size and I want to convert it to max-heap. What algorithm do we have for this? Thanks
  2. A

    Logarithm binary numbers

    Hello everyone, I am currently learning about binary numbers and I have stumbled on this problem: "write a function (log n) that calculates the logarithm (base 2) of number n. Number n is a positive binary number". (only using binary arithmetic operations) I know this is a very basic question...
  3. N

    Binary to hex

    Hi all, Should I represent 1000 1101 1010₂ as 8DA or (8DA)₁₆? Thanks.
  4. S

    Binary Search

    If f(x)=0 and a<x<b Computing the following gives: f(a)<0 f(b)>0 f((a+b)/2)>0 By using a binary search, how many iterations would be needed to arrive at an answer correct to 4dp? I'm completely lost here, am I looking in the right place with Binary logarithms? I have found the...
  5. Z

    Cantor's Infinite Binary Sequence

    Let Ln be the list of n-place binary sequences: 00......00 n-binary digits 00......01 00......10 00......11 00....100 ............ 1111111 n-ones What is the difference between \lim_{n \rightarrow \infty}Ln and Cantor's list* of infinite binary sequences? *...
  6. szz

    Bit probability from a PDF of binary messages

    Hello, I am stuck on an homework for which I can't find a solution. The statement is based on a entropy coding. Given the following map of independent messages and its probability: \begin{array}{c c } m_0 = 0 \mapsto 0 & p(m_0) = 0.4\\ m_1 = +1 \mapsto 10 & p(m_1) = 0.3\\ m_2 =...
  7. Z

    Is an Infinite Binary Sequence a Natural Number?

    Is an infinite binary sequence, interpreted as coefficients of 2^{n}, a natural number? a_{0}a_{1}a_{2}.....\equiv a_{0}\times 2^{0}+a^{1}\times 2^{1} + a_{2}\times 2^{2}+....., \\ \text{where } a_n \in \{0,1\} \\ \text{Example:} \\ 00100....=0\times2^{0}+0\times2^{1}+1\times...
  8. K

    Binary Probability Formula

    Hi I don't good at math so I need a formula. For example there are 4 cells A-B-C-D and their probabilities %40-%60-%45-%55. I want to calculate which binary is the best, A-B or C-D?
  9. M

    how do I convert binary to hexadecimal?

    hi i wanted to know how to convert a binary(base 2) number to hexadecimal (base 16). i can do it by converting binary to decimal and decimal to hexadecimal but i want to know how i can do this conversion in one step. let's take 01100001 for example which equals to 97 in decimal and 61 in...
  10. S

    How to find the nth binary permutation?

    I need to complete this. Let's say I have 4 bits with 2 bits set as 1, 0011. The total number of permutations for this number is 0011, 0101, 0110, 1001, 1010, 1100, 6 cases. This can be computed using the calculation. 4! / ((2!)(4-2)!) = 6 Now I want to be able to find the nth sequence...
  11. AshBox

    Need to get the nth binary permutation.

    This is the last missing piece I need to complete my compression algorithm, new one. Let's say I have 4 bits with 2 bits set as 1, 0011. The total number of permutations for this number is 0011, 0101, 0110, 1001, 1010, 1100, 6 cases. This can be computed using the calculation. 4! /...
  12. B

    My Teacher Isn't Believing Me That He Did His Binary Wrong

    For the number 356 to binary, I got "101100100" and I used several different online converters to confirm, and did a trick that my teacher taught me awhile back. He used the Windows 10 calculator and the divide method and got "001011010" but with his, it isn't converted properly because the 8th...
  13. J

    binary operations

    Let binary operation * be defined by a*b=a-b+ab, where a and b are real numbers. Solve lx*2l=1 I have solved the question... now I am not so sure whether my answer is correct. I got x=1 or x=1/3
  14. B

    Taking the binary logarithm - error propagation?

    Hi, How do I calculate the error (in my case represented by the standard deviation) of a set of data which are converted to their binary logarithm? I have for example 10 numerical values for which I can calculate the standard deviation. After converting these 10 values to their binary...
  15. Z

    Cantor's Diagonal Argument and Binary Sequences

    Countably Infinite Reversed Binary Sequence Definitions: Binary Number, Binary Sequence, Reversed Binary Number, Reversed Binary Sequences BN=p_{n}2^{n}+p_{n-1}2^{n-1}+...p_{0}2^{0}\\ BS=p_{n}p_{n-1}....p_{2}p_{1}p_{0}\\ RBN=p_{0}2^{0}+p_{1}2^{1}+p_{2}2^{2}+...p_{n}2^{n}\\...
  16. D

    Binary Matrix

    Hi, I put my question in the attached print-screen. Thanks a lot in advance! :D
  17. Z

    Real Number as Binary Sequence

    Binary sequence: r =.011.... = p1×(1/2)^1 + p2×(1/2)^2 + p3×(1/2)^3 + ...... Let r be in L= [0,1) 1) divide L by 2 p1=0 if r in L1=[0,1/2], r1 = .0 2) divide L1 by 2 p2 =1 if r in [1/4,1/2], r2 = .01 3) divide L2 by 2 p3=1 if r in [3/8,1/2], r3 = .011 ...... r=.011......... = lim rn...
  18. A

    Integer linear programming - auxillary binary range constraint variable

    Hello, I'm currently facing this problem in ILP: I have two matrices of dimension 1*n of variables : $$s_i,x_i$$ I would like to create a matrix of new variables (dimension n*k, where k is an arbitrary natural number). Using constraints, I would like the variables to have the following...
  19. Chikis

    Binary counting system.

    I was asked to write down the first 1111111111 in binary counting system. I could not attempt the problem because I don't understand what they want me to do. Could anyone put me through please?
  20. L

    x% get a binary answer right - how many of them by chance (chance=0.5)?

    I was thinking about how to reply to people who keep correcting people about the distinction between poisonous/toxic or venomous/toxic/poisonous. *(Never mind that I get this wrong even five seconds after just having read the respective definitions because I just don't care.)* This got me to...